diff options
| author | Marco A L Barbosa <malbarbo@gmail.com> | 2018-01-12 21:22:06 -0200 |
|---|---|---|
| committer | Marco A L Barbosa <malbarbo@gmail.com> | 2018-01-22 16:14:51 -0200 |
| commit | 68db72d8cd613f88ea69d37bcd159c4ff659aab1 (patch) | |
| tree | 051cbd9f58fa05e54443ba553f1de9f720fdf6ba /src/bootstrap | |
| parent | fdc18b3067b5bad257ccbe7400e3c4fb617e9e18 (diff) | |
| download | rust-68db72d8cd613f88ea69d37bcd159c4ff659aab1.tar.gz rust-68db72d8cd613f88ea69d37bcd159c4ff659aab1.zip | |
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.rs | 4 | ||||
| -rwxr-xr-x | src/bootstrap/configure.py | 4 | ||||
| -rw-r--r-- | src/bootstrap/sanity.rs | 2 |
3 files changed, 7 insertions, 3 deletions
diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs index c6adfc7ffae..c40b0ccbd78 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 { |
