about summary refs log tree commit diff
path: root/src/ci
diff options
context:
space:
mode:
authorMateusz Mikuła <matti@marinelayer.io>2019-05-02 17:22:14 +0200
committerMateusz Mikuła <mati865@gmail.com>2019-05-10 16:12:47 +0200
commitf74debbe7d2bf43171270d5f3f5b42f2cc2e6243 (patch)
tree88f5daa4edb5816aff2bfe8b3cc6875d73bb83c4 /src/ci
parent0ac53da03dad79655e2f3e65a58f94a2f3314d5f (diff)
downloadrust-f74debbe7d2bf43171270d5f3f5b42f2cc2e6243.tar.gz
rust-f74debbe7d2bf43171270d5f3f5b42f2cc2e6243.zip
Make tests compatible with musl host
Diffstat (limited to 'src/ci')
-rw-r--r--src/ci/docker/dist-x86_64-musl/Dockerfile6
-rw-r--r--src/ci/docker/scripts/musl-toolchain.sh7
2 files changed, 9 insertions, 4 deletions
diff --git a/src/ci/docker/dist-x86_64-musl/Dockerfile b/src/ci/docker/dist-x86_64-musl/Dockerfile
index 39ad785b41a..bc3a3bd6fbc 100644
--- a/src/ci/docker/dist-x86_64-musl/Dockerfile
+++ b/src/ci/docker/dist-x86_64-musl/Dockerfile
@@ -35,10 +35,7 @@ ENV RUST_CONFIGURE_ARGS \
       --enable-extended \
       --disable-docs \
       --set target.x86_64-unknown-linux-musl.crt-static=false \
-      --build $HOSTS \
-      --set target.x86_64-unknown-linux-musl.cc=x86_64-linux-musl-gcc \
-      --set target.x86_64-unknown-linux-musl.cxx=x86_64-linux-musl-g++ \
-      --set target.x86_64-unknown-linux-musl.linker=x86_64-linux-musl-gcc
+      --build $HOSTS
 
 # Newer binutils broke things on some vms/distros (i.e., linking against
 # unknown relocs disabled by the following flag), so we need to go out of our
@@ -49,4 +46,5 @@ ENV RUST_CONFIGURE_ARGS \
 ENV CFLAGS_x86_64_unknown_linux_musl="-Wa,-mrelax-relocations=no -Wa,--compress-debug-sections=none \
     -Wl,--compress-debug-sections=none"
 
+# To run native tests replace `dist` below with `test`
 ENV SCRIPT python2.7 ../x.py dist --build $HOSTS
diff --git a/src/ci/docker/scripts/musl-toolchain.sh b/src/ci/docker/scripts/musl-toolchain.sh
index 8cdbfebea4d..e132615738b 100644
--- a/src/ci/docker/scripts/musl-toolchain.sh
+++ b/src/ci/docker/scripts/musl-toolchain.sh
@@ -45,6 +45,13 @@ cd -
 ln -s $OUTPUT/$TARGET/lib/libc.so /lib/ld-musl-$ARCH.so.1
 echo $OUTPUT/$TARGET/lib >> /etc/ld-musl-$ARCH.path
 
+# Now when musl bootstraps itself create proper toolchain symlinks to make build and tests easier
+for exec in cc gcc; do
+    ln -s $TARGET-gcc /usr/local/bin/$exec
+done
+for exec in cpp c++ g++; do
+    ln -s $TARGET-g++ /usr/local/bin/$exec
+done
 
 export CC=$TARGET-gcc
 export CXX=$TARGET-g++