Skip to content

Commit 0caa251

Browse files
committed
Conditionally provide cc in musl-toolchain.sh
1 parent f74debb commit 0caa251

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

src/ci/docker/dist-x86_64-musl/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ COPY scripts/musl-toolchain.sh /build/
2323
# We need to mitigate rust-lang/rust#34978 when compiling musl itself as well
2424
RUN CFLAGS="-Wa,-mrelax-relocations=no -Wa,--compress-debug-sections=none -Wl,--compress-debug-sections=none" \
2525
CXXFLAGS="-Wa,-mrelax-relocations=no -Wa,--compress-debug-sections=none -Wl,--compress-debug-sections=none" \
26-
bash musl-toolchain.sh x86_64 && rm -rf build
26+
REPLACE_CC=1 bash musl-toolchain.sh x86_64 && rm -rf build
2727

2828
COPY scripts/sccache.sh /scripts/
2929
RUN sh /scripts/sccache.sh

src/ci/docker/scripts/musl-toolchain.sh

+8-6
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,14 @@ ln -s $OUTPUT/$TARGET/lib/libc.so /lib/ld-musl-$ARCH.so.1
4646
echo $OUTPUT/$TARGET/lib >> /etc/ld-musl-$ARCH.path
4747

4848
# Now when musl bootstraps itself create proper toolchain symlinks to make build and tests easier
49-
for exec in cc gcc; do
50-
ln -s $TARGET-gcc /usr/local/bin/$exec
51-
done
52-
for exec in cpp c++ g++; do
53-
ln -s $TARGET-g++ /usr/local/bin/$exec
54-
done
49+
if [ "$REPLACE_CC" = "1" ]; then
50+
for exec in cc gcc; do
51+
ln -s $TARGET-gcc /usr/local/bin/$exec
52+
done
53+
for exec in cpp c++ g++; do
54+
ln -s $TARGET-g++ /usr/local/bin/$exec
55+
done
56+
fi
5557

5658
export CC=$TARGET-gcc
5759
export CXX=$TARGET-g++

0 commit comments

Comments
 (0)