Talk:LTO
This is a Talk page - please see the documentation about using talk pages. Add newer comments below older ones, sign comments using four tildes (
~~~~
), and indent successive comments with colons (:
).
Add new sections at the bottom of the page, under a heading (== ==
). Please remember to mark sections as "open for discussion" using {{talk|open}}
, so they will show up in the list of open discussions.Idea: -Werror
Based on the work going on with the Gentoo tinderbox, and confirmed anecdotally, the adding -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing
can help replace subtle runtime failures with obvious compile failures. Making incompatible packages more obvious. The downside is that users may never trigger the runtime behaviour that would lead to the crash, and will definitely see the compile failure. — The preceding unsigned comment was added by Anthonyryan1 (talk • contribs) 2023-05-20T02:01:32
- I tried to keep this pretty simple for users when writing so left this idea as being highlighted in Project:Toolchain/LTO in the See also section for those that like to enjoy troubleshoot more. If you have a better way to do this though then please add.
- Immolo (talk) 11:37, 21 May 2023 (UTC)
Common misconception: -fuse-linker-plugin
-flto
in CFLAGS
, CXXFLAGS
, etc. implies -fuse-linker-plugin
Citation: https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html#index-fuse-linker-plugin — The preceding unsigned comment was added by Anthonyryan1 (talk • contribs) 2023-05-20T02:01:32
- This particular section of the discussion was meant Q&A style rather than a discussion. I added it because there's been a lot of historical confusion about how to enable LTO on the Gentoo forums, reddit's /r/gentoo etc and various blogs. I felt it was worth noting in the discussion page. The citation linked above authoritatively states it is not necessary. I just wanted the note preserved here for future editors who may be coming to this page with imperfect information, as I was.
- Anthonyryan1 (talk) 11:42, 21 May 2023 (UTC)
Common misconception: LDFLAGS
Is it necessary to specify -flto
in LDFLAGS
? Should it be specified as -Wl,-flto
or -flto
Citation needed. — The preceding unsigned comment was added by Anthonyryan1 (talk • contribs) 2023-05-20T02:01:32
- AFAIK it is not required anymore. Their are old forums posts that do say it's needed and I can see the GentooLTO overlay hasn't enabled it. If there is a better citation available then it would be great to have added but currently I can't find one I'm happy to add.
- Immolo (talk) 11:46, 21 May 2023 (UTC)