Skip to content

Commit

Permalink
Build musl with -fPIC for all targets
Browse files Browse the repository at this point in the history
  • Loading branch information
malbarbo committed Jan 23, 2018
1 parent abc1061 commit 9b13e40
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/ci/docker/dist-i586-gnu-i586-i686-musl/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ RUN apt-get update && apt-get install -y --no-install-recommends \

WORKDIR /build/
COPY scripts/musl.sh /build/
RUN CC=gcc CFLAGS="-m32 -fPIC -Wa,-mrelax-relocations=no" \
RUN CC=gcc CFLAGS="-m32 -Wa,-mrelax-relocations=no" \
CXX=g++ CXXFLAGS="-m32 -Wa,-mrelax-relocations=no" \
bash musl.sh i686 --target=i686 && \
CC=gcc CFLAGS="-march=pentium -m32 -fPIC -Wa,-mrelax-relocations=no" \
CC=gcc CFLAGS="-march=pentium -m32 -Wa,-mrelax-relocations=no" \
CXX=g++ CXXFLAGS="-march=pentium -m32 -Wa,-mrelax-relocations=no" \
bash musl.sh i586 --target=i586 && \
rm -rf /build
Expand Down
1 change: 0 additions & 1 deletion src/ci/docker/dist-various-1/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ ENV CC_mipsel_unknown_linux_musl=mipsel-openwrt-linux-gcc \
CFLAGS_armv5te_unknown_linux_gnueabi="-march=armv5te -marm -mfloat-abi=soft"

ENV RUST_CONFIGURE_ARGS \
--enable-extended \
--target=$TARGETS \
--musl-root-arm=/musl-arm \
--musl-root-armhf=/musl-armhf \
Expand Down
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 @@ -21,7 +21,7 @@ WORKDIR /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" \
CFLAGS="-Wa,-mrelax-relocations=no" \
CXX=g++ \
CXXFLAGS="-Wa,-mrelax-relocations=no" \
bash musl.sh x86_64 && rm -rf /build
Expand Down
2 changes: 2 additions & 0 deletions src/ci/docker/scripts/musl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ exit 1
TAG=$1
shift

export CFLAGS="-fPIC $CFLAGS"

MUSL=musl-1.1.18

# may have been downloaded in a previous run
Expand Down

0 comments on commit 9b13e40

Please sign in to comment.