From 3fd5fdd8d3e64e957a7eafe3d6d0b10ef4170d59 Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Sun, 24 Jul 2016 21:42:11 -0500 Subject: 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. 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 --- src/libstd/Cargo.toml | 1 + src/libstd/lib.rs | 3 +++ 2 files changed, 4 insertions(+) (limited to 'src/libstd') 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..d227fb1404f 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -322,6 +322,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; -- cgit 1.4.1-3-g733a5