File tree Expand file tree Collapse file tree 3 files changed +8
-12
lines changed Expand file tree Collapse file tree 3 files changed +8
-12
lines changed Original file line number Diff line number Diff line change @@ -21,10 +21,9 @@ WORKDIR /build/
2121
2222COPY scripts/musl-toolchain.sh /build/
2323# We need to mitigate rust-lang/rust#34978 when compiling musl itself as well
24- # TODO: Check what this issue is and if we can ignore it
2524RUN CFLAGS="-Wa,-mrelax-relocations=no" \
2625 CXXFLAGS="-Wa,-mrelax-relocations=no" \
27- bash musl-toolchain.sh x86_64-linux-musl && rm -rf build
26+ bash musl-toolchain.sh x86_64 && rm -rf build
2827
2928COPY scripts/sccache.sh /scripts/
3029RUN sh /scripts/sccache.sh
@@ -45,9 +44,8 @@ ENV HOSTS=x86_64-unknown-linux-musl \
4544 CC_x86_64_unknown_linux_musl=x86_64-linux-musl-gcc \
4645 CXX_x86_64_unknown_linux_musl=x86_64-linux-musl-g++
4746
48- # CARGO_TARGET_ARM_UNKNOWN_LINUX_MUSLEABIHF_LINKER=musl-gcc \
49- # CARGO_TARGET_ARM_UNKNOWN_LINUX_MUSLEABIHF_RUNNER="qemu-arm -L /musl-arm"
50-
47+ # Musl defaults to static libs but we need them to be dynamic for host toolchain.
48+ # The toolchain will produce static libs by default.
5149ENV RUSTFLAGS="-C target-feature=-crt-static"
5250
5351ENV SCRIPT python2.7 ../x.py dist --host $HOSTS --target $HOSTS
Original file line number Diff line number Diff line change @@ -17,10 +17,8 @@ exit 1
1717 set -x
1818}
1919
20- TARGET=$1
21- # ARCH=$1
22- # TARGET=linux-musl-$ARCH
23- ARCH=x86_64
20+ ARCH=$1
21+ TARGET=linux-musl-$ARCH
2422
2523OUTPUT=/usr/local
2624shift
@@ -33,8 +31,7 @@ hide_output make install TARGET=$TARGET OUTPUT=$OUTPUT
3331
3432cd -
3533
36- # Make musl binaries executable
37-
34+ # Install musl library to make binaries executable
3835ln -s $OUTPUT /$TARGET /lib/libc.so /lib/ld-musl-$ARCH .so.1
3936echo $OUTPUT /$TARGET /lib >> /etc/ld-musl-$ARCH .path
4037
@@ -50,6 +47,7 @@ if [ ! -d libunwind-release_$LLVM ]; then
5047 curl -L https://github.com/llvm-mirror/libunwind/archive/release_$LLVM .tar.gz | tar xzf -
5148fi
5249
50+ # fixme(mati865): Replace it with https://github.com/rust-lang/rust/pull/59089
5351mkdir libunwind-build
5452cd libunwind-build
5553cmake ../libunwind-release_$LLVM \
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ WORKDIR /build/
2727COPY scripts/musl-toolchain.sh /build/
2828RUN CFLAGS="-Wa,-mrelax-relocations=no" \
2929 CXXFLAGS="-Wa,-mrelax-relocations=no" \
30- bash musl-toolchain.sh x86_64-linux-musl && rm -rf build
30+ bash musl-toolchain.sh x86_64 && rm -rf build
3131WORKDIR /
3232
3333COPY scripts/sccache.sh /scripts/
You can’t perform that action at this time.
0 commit comments