Code Monkey home page Code Monkey logo

Comments (11)

mithro avatar mithro commented on May 20, 2024 1

Having LTO on by default with a way to easily turn it off seems like a good plan. If LTO is off by default, it will just end up bit rotting until it no longer works.

from litex.

mithro avatar mithro commented on May 20, 2024

I have a WIP branch at https://github.com/mithro/litex/tree/enable-lto?files=1

from litex.

mithro avatar mithro commented on May 20, 2024

It is unclear why we have to link against libgcc when the symbols should be provided by libcompiler_rt. It seems to be because GCC is generating function calls itself (rather than being in the code) which cause lto to not understand that the symbols are used.

from litex.

enjoy-digital avatar enjoy-digital commented on May 20, 2024

This has been integrated with #401. For now it's enabled with for all processors except LM32. If this is causing issue with others configurations, we'll add a parameter be able to disable LTO when needed.

from litex.

enjoy-digital avatar enjoy-digital commented on May 20, 2024

LTO has been reverted in 979f98e since seems to cause subtle issues on some configurations. We'll have to test it more before enabling it.

from litex.

enjoy-digital avatar enjoy-digital commented on May 20, 2024

cc @mithro @mateusz-holenko.

from litex.

ewenmcneill avatar ewenmcneill commented on May 20, 2024

In case it helps, the link issue I had (in #417) with litex-buildenv was with the "stub firmware" in litex-buildenv, which uses the auto-generated litex compiler/linker/flags/etc, but has its own Makefile. So (copying from my comment on #417 (comment)), " updating the definition of $(LD) in common.mak instead of changing it locally in just the BIOS Makefile" might make these changes more robust (/consistent) for anything else that uses the litex generated compiler/linker/flags, etc. (It looks like that Makefile suffered from trying to use ld with flags intended for gcc, via $(CPUFLAGS), on lm32....)

Also (as I said in the same comment) maybe having a build time option to "force LTO off" would help anyone thinking their target is suffering from bad LTO handling.

In general I think it'd be a great idea to have LTO available as a build option, and probably even on by default.

Ewen

/cc @mithro @mateusz-holenko

from litex.

enjoy-digital avatar enjoy-digital commented on May 20, 2024

I'm also ok with that, we just need to work a bit more on it before integrating it.

from litex.

DurandA avatar DurandA commented on May 20, 2024

I just found this issue, should I close #682 which is a duplicate of this?

* [ ]  Have to link against libgcc

This is not necessary. It was required because libcompiler_rt was optimized out.

from litex.

ewenmcneill avatar ewenmcneill commented on May 20, 2024

should I close #682 which is a duplicate of this?

@DurandA It looks to me like #682 is much more active now. I'd probably lean towards closing this issue (which was already closed once, then reopened when the patch was reverted), with a comment like "LTO (re-)implementation work moved to #682"...

(Looks like @mithro or @enjoy-digital digital would have to be the ones to close this specific older issue.)

Ewen

from litex.

mithro avatar mithro commented on May 20, 2024

Let's keep #682 and close this one.

from litex.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.