From d56999aef9199943c79793637c525fbff6c92a8d Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Fri, 20 Jan 2017 15:32:47 -0800 Subject: [PATCH] travis: Enable testing i686 musl This fixes the final issues with the target related to unwinding by disabling removal of frame pointers. --- src/ci/docker/linux-tested-targets/Dockerfile | 2 +- src/ci/docker/linux-tested-targets/build-musl.sh | 2 +- .../target/i686_unknown_linux_musl.rs | 14 ++++++++++++++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/ci/docker/linux-tested-targets/Dockerfile b/src/ci/docker/linux-tested-targets/Dockerfile index 7f95e17c709..2a43201ed0a 100644 --- a/src/ci/docker/linux-tested-targets/Dockerfile +++ b/src/ci/docker/linux-tested-targets/Dockerfile @@ -32,10 +32,10 @@ ENV RUST_CONFIGURE_ARGS \ --musl-root-x86_64=/musl-x86_64 \ --musl-root-i686=/musl-i686 -# FIXME should also test i686-unknown-linux-musl ENV SCRIPT \ python2.7 ../x.py test \ --target x86_64-unknown-linux-musl \ + --target i686-unknown-linux-musl \ --target i586-unknown-linux-gnu \ && \ python2.7 ../x.py dist \ diff --git a/src/ci/docker/linux-tested-targets/build-musl.sh b/src/ci/docker/linux-tested-targets/build-musl.sh index 2382605f9bd..260dc11509f 100644 --- a/src/ci/docker/linux-tested-targets/build-musl.sh +++ b/src/ci/docker/linux-tested-targets/build-musl.sh @@ -57,7 +57,7 @@ cp lib/libunwind.a /musl-x86_64/lib # for x86_64 again) rm -rf * # for i686 -CFLAGS="$CFLAGS -m32 -g" CXXFLAGS="$CXXFLAGS -m32 -g" cmake ../libunwind-release_37 \ +CFLAGS="$CFLAGS -m32" CXXFLAGS="$CXXFLAGS -m32" cmake ../libunwind-release_37 \ -DLLVM_PATH=/build/llvm-release_37 \ -DLIBUNWIND_ENABLE_SHARED=0 make -j10 diff --git a/src/librustc_back/target/i686_unknown_linux_musl.rs b/src/librustc_back/target/i686_unknown_linux_musl.rs index 3d563fa6e5d..ced59448f7f 100644 --- a/src/librustc_back/target/i686_unknown_linux_musl.rs +++ b/src/librustc_back/target/i686_unknown_linux_musl.rs @@ -17,6 +17,20 @@ pub fn target() -> TargetResult { base.pre_link_args.push("-m32".to_string()); base.pre_link_args.push("-Wl,-melf_i386".to_string()); + // The unwinder used by i686-unknown-linux-musl, the LLVM libunwind + // implementation, apparently relies on frame pointers existing... somehow. + // It's not clear to me why nor where this dependency is introduced, but the + // test suite does not pass with frame pointers eliminated and it passes + // with frame pointers present. + // + // If you think that this is no longer necessary, then please feel free to + // ignore! If it still passes the test suite and the bots then sounds good + // to me. + // + // This may or may not be related to this bug: + // https://llvm.org/bugs/show_bug.cgi?id=30879 + base.eliminate_frame_pointer = false; + Ok(Target { llvm_target: "i686-unknown-linux-musl".to_string(), target_endian: "little".to_string(),