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

mk: Stop using cmake for compiler-rt #34873

Merged
merged 2 commits into from
Jul 21, 2016

Conversation

alexcrichton
Copy link
Member

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

@rust-highfive
Copy link
Collaborator

r? @brson

(rust_highfive has picked a reviewer for you, use r? to override)

@bors
Copy link
Contributor

bors commented Jul 17, 2016

☔ The latest upstream changes (presumably #34606) made this pull request unmergeable. Please resolve the merge conflicts.

@brson
Copy link
Contributor

brson commented Jul 18, 2016

@bors r+

@bors
Copy link
Contributor

bors commented Jul 18, 2016

📌 Commit d6c0fc2 has been approved by brson


let mut out_of_date = false;
for src in sources {
let src = build.src.join("src/compiler-rt/lib/builtins").join(source);
Copy link
Member

Choose a reason for hiding this comment

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

rustc will fail to compile here. That argument to join there should be src, right?

Copy link
Member Author

Choose a reason for hiding this comment

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

Oops, indeed!

@alexcrichton alexcrichton force-pushed the down-with-compiler-rt-for-good branch from d6c0fc2 to c0ccbf1 Compare July 18, 2016 23:17
@alexcrichton
Copy link
Member Author

@bors: r=brson c0ccbf1

@bors
Copy link
Contributor

bors commented Jul 19, 2016

⌛ Testing commit c0ccbf1 with merge 0ab82ae...

@bors
Copy link
Contributor

bors commented Jul 19, 2016

💔 Test failed - auto-mac-32-opt

@alexcrichton alexcrichton force-pushed the down-with-compiler-rt-for-good branch from c0ccbf1 to 7b68f17 Compare July 19, 2016 01:12
@alexcrichton
Copy link
Member Author

@bors: r=brson

@bors
Copy link
Contributor

bors commented Jul 19, 2016

📌 Commit 7b68f17 has been approved by brson

@alexcrichton
Copy link
Member Author

@bors: p=1

Blocking the LLVM upgrade which is blocking MIR

@bors
Copy link
Contributor

bors commented Jul 19, 2016

⌛ Testing commit 7b68f17 with merge c97c785...

@bors
Copy link
Contributor

bors commented Jul 19, 2016

💔 Test failed - auto-win-msvc-64-opt

We're not writing C code, so there's not really much of a reason for us to get
warnings and errors from code we haven't written!
@alexcrichton alexcrichton force-pushed the down-with-compiler-rt-for-good branch 2 times, most recently from fb25076 to f168d17 Compare July 19, 2016 07:15
@alexcrichton
Copy link
Member Author

@bors: r=brson

@bors
Copy link
Contributor

bors commented Jul 19, 2016

📌 Commit f168d17 has been approved by brson

@bors
Copy link
Contributor

bors commented Jul 19, 2016

⌛ Testing commit f168d17 with merge c2d81d5...

@bors
Copy link
Contributor

bors commented Jul 19, 2016

💔 Test failed - auto-linux-64-cross-freebsd

@bors
Copy link
Contributor

bors commented Jul 20, 2016

⌛ Testing commit 0a66ae3 with merge 22abe50...

@bors
Copy link
Contributor

bors commented Jul 20, 2016

💔 Test failed - auto-linux-64-x-android-t

@bstrie bstrie added this to the Launch MIR into Orbit milestone Jul 20, 2016
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 rust-lang#34400, first steps towards that
@alexcrichton alexcrichton force-pushed the down-with-compiler-rt-for-good branch from 0a66ae3 to ee6011f Compare July 20, 2016 20:22
@alexcrichton
Copy link
Member Author

@bors: r=brson

@bors
Copy link
Contributor

bors commented Jul 20, 2016

📌 Commit ee6011f has been approved by brson

@bors
Copy link
Contributor

bors commented Jul 20, 2016

⌛ Testing commit ee6011f with merge cc548ca...

@bors
Copy link
Contributor

bors commented Jul 20, 2016

💔 Test failed - auto-win-msvc-64-opt-rustbuild

@alexcrichton
Copy link
Member Author

@bors: retry

  • Weird network error

@bors
Copy link
Contributor

bors commented Jul 21, 2016

⌛ Testing commit ee6011f with merge a33622c...

@bors
Copy link
Contributor

bors commented Jul 21, 2016

💔 Test failed - auto-win-gnu-32-opt-rustbuild

@alexcrichton
Copy link
Member Author

@bors
Copy link
Contributor

bors commented Jul 21, 2016

⌛ Testing commit ee6011f with merge e7c822c...

bors added a commit that referenced this pull request Jul 21, 2016
…=brson

mk: Stop using cmake for compiler-rt

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
@bors
Copy link
Contributor

bors commented Jul 21, 2016

💔 Test failed - auto-win-gnu-32-opt

@alexcrichton
Copy link
Member Author

@bors bors merged commit ee6011f into rust-lang:master Jul 21, 2016
@badboy
Copy link
Member

badboy commented Jul 21, 2016

\o/ That took quite some time

@eminence
Copy link
Contributor

@alexcrichton wins another epic battle with @bors 🎉

@alexcrichton alexcrichton deleted the down-with-compiler-rt-for-good branch July 21, 2016 15:43
@Ms2ger
Copy link
Contributor

Ms2ger commented Jul 23, 2016

What's up with the two gcc crates in Cargo.lock?

@alexcrichton
Copy link
Member Author

@Ms2ger one's from git and one's from crates.io

@sanxiyn sanxiyn mentioned this pull request Aug 1, 2016
sanxiyn added a commit to sanxiyn/rust that referenced this pull request Aug 1, 2016
Remove CMake workaround

This isn't needed anymore as we aren't using CMake to build compiler-rt since rust-lang#34873.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.