Skip to content

Commit

Permalink
Conditionally provide cc in musl-toolchain.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
mati865 committed May 10, 2019
1 parent f74debb commit 0caa251
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/ci/docker/dist-x86_64-musl/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ COPY scripts/musl-toolchain.sh /build/
# We need to mitigate rust-lang/rust#34978 when compiling musl itself as well
RUN CFLAGS="-Wa,-mrelax-relocations=no -Wa,--compress-debug-sections=none -Wl,--compress-debug-sections=none" \
CXXFLAGS="-Wa,-mrelax-relocations=no -Wa,--compress-debug-sections=none -Wl,--compress-debug-sections=none" \
bash musl-toolchain.sh x86_64 && rm -rf build
REPLACE_CC=1 bash musl-toolchain.sh x86_64 && rm -rf build

COPY scripts/sccache.sh /scripts/
RUN sh /scripts/sccache.sh
Expand Down
14 changes: 8 additions & 6 deletions src/ci/docker/scripts/musl-toolchain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,14 @@ 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
if [ "$REPLACE_CC" = "1" ]; then
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
fi

export CC=$TARGET-gcc
export CXX=$TARGET-g++
Expand Down

0 comments on commit 0caa251

Please sign in to comment.