Skip to content

Enables LTO for Travis Release Builds#3770

Merged
daniel-j-h merged 2 commits intomasterfrom
travis-lto
Mar 15, 2017
Merged

Enables LTO for Travis Release Builds#3770
daniel-j-h merged 2 commits intomasterfrom
travis-lto

Conversation

@daniel-j-h
Copy link
Copy Markdown
Member

LTO builds for Travis release jobs. Let's wait for Travis and see how it goes.

@daniel-j-h daniel-j-h requested a review from TheMarex March 2, 2017 16:02
.travis.yml Outdated
sources: ['ubuntu-toolchain-r-test']
packages: ['libstdc++-5-dev']
env: CLANG_VERSION='3.9.1' BUILD_TYPE='Release' ENABLE_MASON=ON ENABLE_SANITIZER=ON
env: CLANG_VERSION='3.9.1' BUILD_TYPE='Release' ENABLE_MASON=ON ENABLE_SANITIZER=ON ENABLE_LTO=ON
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Would omit this one, I don't think need we need this for the sanitzer build.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Hm having the same build setup sanitizes that we're using for releases would be nice though - without lto things like undefined behavior due to e.g. ODR violations can behave differently. I don't have a strong opinion here, though. Removed it for now.

@daniel-j-h
Copy link
Copy Markdown
Member Author

Urgh I've just seen the Clang error with LTO builds on Travis

clang-3.9: error: unable to execute command: Segmentation fault (core dumped)
clang-3.9: error: linker command failed due to signal (use -v to see invocation)

@TheMarex
Copy link
Copy Markdown
Member

TheMarex commented Mar 3, 2017

@daniel-j-h weird, we are using clang 3.9.1 in node-osrm as well and we use it to compile osrm-backend. Any specifics about our setup?

@daniel-j-h
Copy link
Copy Markdown
Member Author

Hm no, we are using the exact same Clang version in node-osrm:
https://github.com/Project-OSRM/node-osrm/blob/master/scripts/build.sh#L17

The failing build is Mason+Clang3.9.1+LTO specifically. I can try to reproduce locally.

@TheMarex
Copy link
Copy Markdown
Member

TheMarex commented Mar 7, 2017

/cc @springmeyer You might have some experience with clang 3.9 vs. LTO linking here? Anything that we do in node-osrm that we don't here?

@springmeyer
Copy link
Copy Markdown
Contributor

Thanks for the ping. I recall that clang 3.9.0 and binutils 2.27 had a bad interaction that was fixed in clang 3.9.1: #3389 (comment). The fact that this is happening now with 3.9.1 is curious. I'll attempt to replicate later today and see if I see any clues.

@daniel-j-h daniel-j-h mentioned this pull request Mar 8, 2017
8 tasks
@daniel-j-h
Copy link
Copy Markdown
Member Author

daniel-j-h commented Mar 9, 2017

I just spawned up a local Trusty Docker container, replicating the build environment with binutils, clang and really all deps. from Mason - except for zlib and libstdc++ (from ubuntu toolchain ppa, as we do on Travis).

But I can not replicate the segfault.

What I tried is clearing the Travis caches primarily for ccache and restarting the build.
But we still hit the Clang 3.9.1 segfault.

@daniel-j-h
Copy link
Copy Markdown
Member Author

It works with Clang 4.0. Argh. At least we are unblocked by it now.

@springmeyer as soon as we merge this PR we depend on Clang 4.0 for all our production builds. Can you make sure to bundle a recent Clang 4.0 RC and once the release is out (should be a matter of days) bundle this.

@daniel-j-h
Copy link
Copy Markdown
Member Author

Blocked by having LLVM 4 in Mason mapbox/mason#385

@springmeyer
Copy link
Copy Markdown
Contributor

Blocked by having LLVM 4 in Mason mapbox/mason#385

llvm 4.0 packages are now available via mason. This includes separate packages:

  • llvm (all tools in one download)
  • clang++ - just the compiler + libraries needed for -fsanitize=* and -flto
  • llvm-cov
  • clang-tidy
  • clang-format
  • lldb
  • include-what-you-use

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.

3 participants