about summary refs log tree commit diff
path: root/src/ci/docker
diff options
context:
space:
mode:
authorMarco A L Barbosa <malbarbo@gmail.com>2018-01-12 21:22:06 -0200
committerMarco A L Barbosa <malbarbo@gmail.com>2018-01-22 16:14:51 -0200
commit68db72d8cd613f88ea69d37bcd159c4ff659aab1 (patch)
tree051cbd9f58fa05e54443ba553f1de9f720fdf6ba /src/ci/docker
parentfdc18b3067b5bad257ccbe7400e3c4fb617e9e18 (diff)
downloadrust-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/ci/docker')
-rw-r--r--src/ci/docker/dist-various-1/Dockerfile31
-rw-r--r--src/ci/docker/scripts/musl.sh11
2 files changed, 31 insertions, 11 deletions
diff --git a/src/ci/docker/dist-various-1/Dockerfile b/src/ci/docker/dist-various-1/Dockerfile
index 0f08bcddd38..c195645efad 100644
--- a/src/ci/docker/dist-various-1/Dockerfile
+++ b/src/ci/docker/dist-various-1/Dockerfile
@@ -30,6 +30,15 @@ RUN ./build-rumprun.sh
 COPY dist-various-1/install-x86_64-redox.sh /build
 RUN ./install-x86_64-redox.sh
 
+COPY dist-various-1/install-mips-musl.sh /build
+RUN ./install-mips-musl.sh
+
+COPY dist-various-1/install-mipsel-musl.sh /build
+RUN ./install-mipsel-musl.sh
+
+# Suppress some warnings in the openwrt toolchains we downloaded
+ENV STAGING_DIR=/tmp
+
 COPY scripts/musl.sh /build
 RUN env \
     CC=arm-linux-gnueabi-gcc CFLAGS="-march=armv6 -marm" \
@@ -47,14 +56,16 @@ RUN env \
     CC=aarch64-linux-gnu-gcc \
     CXX=aarch64-linux-gnu-g++ \
     bash musl.sh aarch64 && \
+    env \
+    CC=mips-openwrt-linux-gcc \
+    CXX=mips-openwrt-linux-g++ \
+    bash musl.sh mips && \
+    env \
+    CC=mipsel-openwrt-linux-gcc \
+    CXX=mipsel-openwrt-linux-g++ \
+    bash musl.sh mipsel && \
     rm -rf /build/*
 
-COPY dist-various-1/install-mips-musl.sh /build
-RUN ./install-mips-musl.sh
-
-COPY dist-various-1/install-mipsel-musl.sh /build
-RUN ./install-mipsel-musl.sh
-
 ENV TARGETS=asmjs-unknown-emscripten
 ENV TARGETS=$TARGETS,wasm32-unknown-emscripten
 ENV TARGETS=$TARGETS,x86_64-rumprun-netbsd
@@ -77,16 +88,16 @@ ENV CC_mipsel_unknown_linux_musl=mipsel-openwrt-linux-gcc \
     CC_armv5te_unknown_linux_gnueabi=arm-linux-gnueabi-gcc \
     CFLAGS_armv5te_unknown_linux_gnueabi="-march=armv5te -marm -mfloat-abi=soft"
 
-# Suppress some warnings in the openwrt toolchains we downloaded
-ENV STAGING_DIR=/tmp
-
 ENV RUST_CONFIGURE_ARGS \
       --enable-extended \
       --target=$TARGETS \
       --musl-root-arm=/musl-arm \
       --musl-root-armhf=/musl-armhf \
       --musl-root-armv7=/musl-armv7 \
-      --musl-root-aarch64=/musl-aarch64
+      --musl-root-aarch64=/musl-aarch64 \
+      --musl-root-mips=/musl-mips \
+      --musl-root-mipsel=/musl-mipsel
+
 ENV SCRIPT python2.7 ../x.py dist --target $TARGETS
 
 # sccache
diff --git a/src/ci/docker/scripts/musl.sh b/src/ci/docker/scripts/musl.sh
index 7a7233216a3..d08cdfeb445 100644
--- a/src/ci/docker/scripts/musl.sh
+++ b/src/ci/docker/scripts/musl.sh
@@ -49,7 +49,16 @@ hide_output make clean
 
 cd ..
 
-LLVM=39
+# use version 60 for all targets after llvm 6.0 release
+case $TAG in
+  mips|mipsel)
+    LLVM=60
+    ;;
+  *)
+    LLVM=39
+    ;;
+esac
+
 # may have been downloaded in a previous run
 if [ ! -d libunwind-release_$LLVM ]; then
   curl -L https://github.com/llvm-mirror/llvm/archive/release_$LLVM.tar.gz | tar xzf -