ci: use musl shared script in dist-x86_64-musl

This commit is contained in:
Marco A L Barbosa 2018-01-02 18:02:42 -02:00
parent b24d12e622
commit ca0499d736
2 changed files with 17 additions and 8 deletions

View file

@ -17,8 +17,14 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
pkg-config
WORKDIR /build/
COPY dist-x86_64-musl/build-musl.sh /build/
RUN sh /build/build-musl.sh && rm -rf /build
COPY scripts/musl.sh /build/
# We need to mitigate rust-lang/rust#34978 when compiling musl itself as well
RUN CC=gcc \
CFLAGS="-fPIC -Wa,-mrelax-relocations=no" \
CXX=g++ \
CXXFLAGS="-Wa,-mrelax-relocations=no" \
bash musl.sh x86_64 && rm -rf /build
COPY scripts/sccache.sh /scripts/
RUN sh /scripts/sccache.sh

View file

@ -11,14 +11,13 @@
set -ex
# We need to mitigate rust-lang/rust#34978 when compiling musl itself as well
export CFLAGS="-fPIC -Wa,-mrelax-relocations=no"
export CXXFLAGS="-Wa,-mrelax-relocations=no"
TAG=$1
shift
MUSL=musl-1.1.17
curl https://www.musl-libc.org/releases/$MUSL.tar.gz | tar xzf -
cd $MUSL
./configure --prefix=/musl-x86_64 --disable-shared
./configure --disable-shared --prefix=/musl-$TAG $@
make -j10
make install
@ -33,6 +32,10 @@ curl -L https://github.com/llvm-mirror/libunwind/archive/release_37.tar.gz | tar
mkdir libunwind-build
cd libunwind-build
cmake ../libunwind-release_37 -DLLVM_PATH=/build/llvm-release_37 \
-DLIBUNWIND_ENABLE_SHARED=0
-DLIBUNWIND_ENABLE_SHARED=0 \
-DCMAKE_C_COMPILER=$CC \
-DCMAKE_CXX_COMPILER=$CXX \
-DCMAKE_C_FLAGS="$CFLAGS" \
-DCMAKE_CXX_FLAGS="$CXXFLAGS"
make -j10
cp lib/libunwind.a /musl-x86_64/lib
cp lib/libunwind.a /musl-$TAG/lib