about summary refs log tree commit diff
path: root/src/bootstrap
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-01-28 23:30:15 +0000
committerbors <bors@rust-lang.org>2018-01-28 23:30:15 +0000
commit385ef1514c80fb8c0cb061dc69eb1d953a84e2b3 (patch)
treecd6e3660ce89bcbe652f330b5a56ac2bacc14e2b /src/bootstrap
parent21882aad7299e8e859785845ac12374990f24dae (diff)
parent2875f825fd5a29d94bbfd78b1019ebdedd8d2444 (diff)
downloadrust-385ef1514c80fb8c0cb061dc69eb1d953a84e2b3.tar.gz
rust-385ef1514c80fb8c0cb061dc69eb1d953a84e2b3.zip
Auto merge of #47663 - malbarbo:mips-crt-static, r=alexcrichton
Do not assume dynamic linking for musl/mips[el] targets

All musl targets except mips[el] assume static linking by default. This can be [confusing](https://users.rust-lang.org/t/static-cross-compiled-binaries-arent-really-static/6084).

When the musl/mips[el] targets was [added](https://github.com/rust-lang/rust/pull/31298), dynamic linking was chosen because of binary size concerns, and probably also because libunwind [didn't](https://users.rust-lang.org/t/static-cross-compiled-binaries-arent-really-static/6084/8) supported mips.

Now that we have `crt-static` target-feature (the user can choose dynamic link for musl targets), and libunwind [6.0](https://github.com/llvm-mirror/libunwind/commits/release_60) add support to mips, we do not need to assume dynamic linking.
Diffstat (limited to 'src/bootstrap')
-rw-r--r--src/bootstrap/compile.rs4
-rwxr-xr-xsrc/bootstrap/configure.py4
-rw-r--r--src/bootstrap/sanity.rs2
3 files changed, 7 insertions, 3 deletions
diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs
index 0b247c6f755..cb236cd7e73 100644
--- a/src/bootstrap/compile.rs
+++ b/src/bootstrap/compile.rs
@@ -80,7 +80,7 @@ impl Step for Std {
 
             // Even if we're not building std this stage, the new sysroot must
             // still contain the musl startup objects.
-            if target.contains("musl") && !target.contains("mips") {
+            if target.contains("musl") {
                 let libdir = builder.sysroot_libdir(compiler, target);
                 copy_musl_third_party_objects(build, target, &libdir);
             }
@@ -97,7 +97,7 @@ impl Step for Std {
         println!("Building stage{} std artifacts ({} -> {})", compiler.stage,
                 &compiler.host, target);
 
-        if target.contains("musl") && !target.contains("mips") {
+        if target.contains("musl") {
             let libdir = builder.sysroot_libdir(compiler, target);
             copy_musl_third_party_objects(build, target, &libdir);
         }
diff --git a/src/bootstrap/configure.py b/src/bootstrap/configure.py
index aa9fe459e88..9a4b5e786e1 100755
--- a/src/bootstrap/configure.py
+++ b/src/bootstrap/configure.py
@@ -120,6 +120,10 @@ v("musl-root-armv7", "target.armv7-unknown-linux-musleabihf.musl-root",
   "armv7-unknown-linux-musleabihf install directory")
 v("musl-root-aarch64", "target.aarch64-unknown-linux-musl.musl-root",
   "aarch64-unknown-linux-musl install directory")
+v("musl-root-mips", "target.mips-unknown-linux-musl.musl-root",
+  "mips-unknown-linux-musl install directory")
+v("musl-root-mipsel", "target.mipsel-unknown-linux-musl.musl-root",
+  "mipsel-unknown-linux-musl install directory")
 v("qemu-armhf-rootfs", "target.arm-unknown-linux-gnueabihf.qemu-rootfs",
   "rootfs in qemu testing, you probably don't want to use this")
 v("qemu-aarch64-rootfs", "target.aarch64-unknown-linux-gnu.qemu-rootfs",
diff --git a/src/bootstrap/sanity.rs b/src/bootstrap/sanity.rs
index a8b43ad3c30..5184cca653c 100644
--- a/src/bootstrap/sanity.rs
+++ b/src/bootstrap/sanity.rs
@@ -170,7 +170,7 @@ pub fn check(build: &mut Build) {
         }
 
         // Make sure musl-root is valid
-        if target.contains("musl") && !target.contains("mips") {
+        if target.contains("musl") {
             // If this is a native target (host is also musl) and no musl-root is given,
             // fall back to the system toolchain in /usr before giving up
             if build.musl_root(*target).is_none() && build.config.build == *target {