-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Fix build of compiler-rt on FreeBSD #35004
Conversation
Broken since ee6011f removed cmake from the process. There are likely other platforms still broken, but I didn't test on them.
r? @aturon (rust_highfive has picked a reviewer for you, use r? to override) |
The compiler-rt build system has been a never ending cause of pain for Rust unfortunately: * The build system is very difficult to invoke and configure to only build compiler-rt, especially across platforms. * The standard build system doesn't actually do what we want, not working for some of our platforms and requiring a significant number of patches on our end which are difficult to apply when updating compiler-rt. * Compiling compiler-rt requires LLVM to be compiled, which... is a big dependency! This also means that over time compiler-rt is not guaranteed to build against older versions of LLVM (or newer versions), and we often want to work with multiple versions of LLVM simultaneously. The makefiles and rustbuild already know how to compile C code, the code here is far from the *only* C code we're compiling. This patch jettisons all logic to work with compiler-rt's build system and just goes straight to the source. We just list all files manually (copied from compiler-rt's lib/builtins/CMakeLists.txt) and compile them into an archive. It's likely that this means we'll fail to pick up new files when we upgrade compiler-rt, but that seems like a much less significant cost to pay than what we're currently paying. cc #34400, first steps towards that
This fix should probably be applied to rustbuild as well, the relevant function is this one as far as I can tell. |
@@ -384,7 +384,11 @@ COMPRT_OBJS_$(1) += emutls.o | |||
endif | |||
|
|||
ifeq ($$(findstring msvc,$(1)),) | |||
|
|||
ifeq ($$(findstring freebsd,$(1)),) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
err, this condition is inside one which checks for msvc
. Pretty sure there’s no combination of freebsd and msvc out there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe these conditions are Makefile-speak for "not contains" (findstring
returns the found string, which is then compared to the empty string, as far as I know).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct, the first condition checks for "not msvc" and the second checks for "not freebsd".
Disable gcc_personality_v0.c in rustbuild as well as the normal build. Rustbuild now gets further on FreeBSD, but it still fails due to other problems.
⌛ Testing commit 8604c54 with merge 45047fa... |
💔 Test failed - auto-win-msvc-64-opt |
@bors: retry On Tue, Jul 26, 2016 at 3:44 AM, bors [email protected] wrote:
|
Travis fails |
@Manishearth that failure is unrelated to this pr and has recently been fixed (#35014). |
Yeah, just noticed 😄 |
@bors: retry |
@bors: rollup |
@bors: retry |
Fix build of compiler-rt on FreeBSD Broken since ee6011f removed cmake from the process. There are likely other platforms still broken, but I didn't test on them.
Fix build of compiler-rt on FreeBSD Broken since ee6011f removed cmake from the process. There are likely other platforms still broken, but I didn't test on them.
Broken since ee6011f removed cmake from the
process. There are likely other platforms still broken, but I didn't test on them.