Skip to content

Commit ca0499d

Browse files
committed
ci: use musl shared script in dist-x86_64-musl
1 parent b24d12e commit ca0499d

File tree

2 files changed

+17
-8
lines changed

2 files changed

+17
-8
lines changed

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

+8-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,14 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
1717
pkg-config
1818

1919
WORKDIR /build/
20-
COPY dist-x86_64-musl/build-musl.sh /build/
21-
RUN sh /build/build-musl.sh && rm -rf /build
20+
21+
COPY scripts/musl.sh /build/
22+
# We need to mitigate rust-lang/rust#34978 when compiling musl itself as well
23+
RUN CC=gcc \
24+
CFLAGS="-fPIC -Wa,-mrelax-relocations=no" \
25+
CXX=g++ \
26+
CXXFLAGS="-Wa,-mrelax-relocations=no" \
27+
bash musl.sh x86_64 && rm -rf /build
2228

2329
COPY scripts/sccache.sh /scripts/
2430
RUN sh /scripts/sccache.sh

src/ci/docker/dist-x86_64-musl/build-musl.sh renamed to src/ci/docker/scripts/musl.sh

+9-6
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,13 @@
1111

1212
set -ex
1313

14-
# We need to mitigate rust-lang/rust#34978 when compiling musl itself as well
15-
export CFLAGS="-fPIC -Wa,-mrelax-relocations=no"
16-
export CXXFLAGS="-Wa,-mrelax-relocations=no"
14+
TAG=$1
15+
shift
1716

1817
MUSL=musl-1.1.17
1918
curl https://www.musl-libc.org/releases/$MUSL.tar.gz | tar xzf -
2019
cd $MUSL
21-
./configure --prefix=/musl-x86_64 --disable-shared
20+
./configure --disable-shared --prefix=/musl-$TAG $@
2221
make -j10
2322
make install
2423

@@ -33,6 +32,10 @@ curl -L https://github.com/llvm-mirror/libunwind/archive/release_37.tar.gz | tar
3332
mkdir libunwind-build
3433
cd libunwind-build
3534
cmake ../libunwind-release_37 -DLLVM_PATH=/build/llvm-release_37 \
36-
-DLIBUNWIND_ENABLE_SHARED=0
35+
-DLIBUNWIND_ENABLE_SHARED=0 \
36+
-DCMAKE_C_COMPILER=$CC \
37+
-DCMAKE_CXX_COMPILER=$CXX \
38+
-DCMAKE_C_FLAGS="$CFLAGS" \
39+
-DCMAKE_CXX_FLAGS="$CXXFLAGS"
3740
make -j10
38-
cp lib/libunwind.a /musl-x86_64/lib
41+
cp lib/libunwind.a /musl-$TAG/lib

0 commit comments

Comments
 (0)