Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disables link-time optimization unless -DENABLE_LTO=ON is passed. #3524

Merged
merged 1 commit into from Jan 6, 2017

Conversation

daniel-j-h
Copy link
Member

This disables the -flto LTO flag by default since we're seeing
segfaults in compiler lto plugins, binutils and linker errors again and
again for various clang / gcc / binutils combinations.

You can pass -DNEBALE_LTO to cmake in order to re-enable LTO.

LTO situation in short:

  • LTO does not work at all for gcc<4.9
  • With gcc>=4.9 the "slim" LTO format is getting used dumping IR
  • Older binutils need LTO plugins which know how to read this IR
  • Recent binutils handle this format all by themselves
  • LLVM is more or less the same with some Clang versions segfaulting

If you need the performance benefit of LTO, make sure your compiler and
binutils are up to date and see for yourself if LTO builds work for you.

References:

(and a ton of other LTO tickets if you search for them)

This disables the `-flto` LTO flag by default since we're seeing
segfaults in compiler lto plugins, binutils and linker errors again and
again for various clang / gcc / binutils combinations.

Pass `-DNEBALE_LTO` to `cmake` in order to re-enable LTO.

LTO situation in short:
- LTO does not work at all for gcc<4.9
- With gcc>=4.9 the "slim" LTO format is getting used dumping IR
- Older binutils need LTO plugins which know how to read this IR
- Recent binutils handle this format all by themselves
- LLVM is more or less the same with some Clang versions segfaulting

If you need the performance benefit of LTO, make sure your compiler and
binutils are up to date and see for yourself if LTO builds work for you.

References:
- https://gcc.gnu.org/wiki/LinkTimeOptimizationFAQ
- #3481 (comment)
- #3501
- #3441

(and a ton of other LTO tickets if you search for them)
@daniel-j-h
Copy link
Member Author

Which downstream projects relied on this default and have to be updated now?

@TheMarex
Copy link
Member

TheMarex commented Jan 5, 2017

@daniel-j-h node-osrm needs to be updated to pass the changed default.

daniel-j-h added a commit to Project-OSRM/node-osrm that referenced this pull request Jan 5, 2017
The default just flipped from on to off upstream.
Re-enables LTO. See Project-OSRM/osrm-backend#3524.
Copy link
Member

@TheMarex TheMarex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be fine, while LTO is something we want, it will be less important when we push for MLD which will yield more templatization anyway.

@daniel-j-h daniel-j-h merged commit c01ea2e into master Jan 6, 2017
TheMarex pushed a commit to Project-OSRM/node-osrm that referenced this pull request Jan 18, 2017
The default just flipped from on to off upstream.
Re-enables LTO. See Project-OSRM/osrm-backend#3524.
@MoKob MoKob deleted the disable-lto branch January 23, 2017 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants