about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2016-09-13 15:08:12 -0700
committerGitHub <noreply@github.com>2016-09-13 15:08:12 -0700
commitb1363a73ede57ae595f3a1be2bb75d308ba4f7f6 (patch)
tree145ce98f3c6eeea3723fd23ae7610b55c8676542 /src/libstd
parent2fd060815f9e9c4ae787cb1cd44df51aeb91fe6e (diff)
parent848cfe20a01b3d43d4c9838bd7d9b0da32dace42 (diff)
downloadrust-b1363a73ede57ae595f3a1be2bb75d308ba4f7f6.tar.gz
rust-b1363a73ede57ae595f3a1be2bb75d308ba4f7f6.zip
Auto merge of #35021 - japaric:rustc-builtins, r=alexcrichton
crate-ify compiler-rt into compiler-builtins

libcompiler-rt.a is dead, long live libcompiler-builtins.rlib

This commit moves the logic that used to build libcompiler-rt.a into a
compiler-builtins crate on top of the core crate and below the std crate.
This new crate still compiles the compiler-rt instrinsics using gcc-rs
but produces an .rlib instead of a static library.

Also, with this commit rustc no longer passes -lcompiler-rt to the
linker. This effectively makes the "no-compiler-rt" field of target
specifications a no-op. Users of `no_std` will have to explicitly add
the compiler-builtins crate to their crate dependency graph *if* they
need the compiler-rt intrinsics - this is a [breaking-change]. Users
of the `std` have to do nothing extra as the std crate depends
on compiler-builtins.

Finally, this a step towards lazy compilation of std with Cargo as the
compiler-rt intrinsics can now be built by Cargo instead of having to
be supplied by the user by some other method.

closes #34400

---

r? @alexcrichton
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/Cargo.toml1
-rw-r--r--src/libstd/lib.rs4
2 files changed, 5 insertions, 0 deletions
diff --git a/src/libstd/Cargo.toml b/src/libstd/Cargo.toml
index 3ce6841fdd4..21e6acc37f3 100644
--- a/src/libstd/Cargo.toml
+++ b/src/libstd/Cargo.toml
@@ -19,6 +19,7 @@ collections = { path = "../libcollections" }
 core = { path = "../libcore" }
 libc = { path = "../rustc/libc_shim" }
 rand = { path = "../librand" }
+compiler_builtins = { path = "../libcompiler_builtins" }
 rustc_unicode = { path = "../librustc_unicode" }
 unwind = { path = "../libunwind" }
 
diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs
index 4a637b5cfcf..115a24fc83c 100644
--- a/src/libstd/lib.rs
+++ b/src/libstd/lib.rs
@@ -224,6 +224,7 @@
 #![feature(char_internals)]
 #![feature(collections)]
 #![feature(collections_bound)]
+#![feature(compiler_builtins_lib)]
 #![feature(const_fn)]
 #![feature(core_float)]
 #![feature(core_intrinsics)]
@@ -322,6 +323,9 @@ extern crate unwind;
 #[cfg(stage0)]
 extern crate alloc_system;
 
+// compiler-rt intrinsics
+extern crate compiler_builtins;
+
 // Make std testable by not duplicating lang items and other globals. See #2912
 #[cfg(test)] extern crate std as realstd;