Skip to content

Commit cd03b14

Browse files
committed
Fix musl-i686 CI failures.
* Override the compiler via CC; ./configure can't seem to detect it. * Unset CROSS_COMPILE when running make. Per the comment, we otherwise end up invoking commands like i686-ar.
1 parent 0ecafc3 commit cd03b14

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

ci/docker/i686-unknown-linux-musl/Dockerfile

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,19 @@ FROM ubuntu:16.10
33
RUN apt-get update
44
RUN apt-get install -y --no-install-recommends \
55
gcc make libc6-dev git curl ca-certificates
6+
# Below we're cross-compiling musl for i686 using the system compiler on an
7+
# x86_64 system. This is an awkward thing to be doing and so we have to jump
8+
# through a couple hoops to get musl to be happy. In particular:
9+
#
10+
# * We specifically pass -m32 in CFLAGS and override CC when running ./configure,
11+
# since otherwise the script will fail to find a compiler.
12+
# * We manually unset CROSS_COMPILE when running make; otherwise the makefile
13+
# will call the non-existent binary 'i686-ar'.
614
RUN curl https://www.musl-libc.org/releases/musl-1.1.15.tar.gz | \
715
tar xzf - && \
816
cd musl-1.1.15 && \
9-
CFLAGS=-m32 ./configure --prefix=/musl-i686 --disable-shared --target=i686 && \
10-
make install -j4 && \
17+
CC=gcc CFLAGS=-m32 ./configure --prefix=/musl-i686 --disable-shared --target=i686 && \
18+
make CROSS_COMPILE= install -j4 && \
1119
cd .. && \
1220
rm -rf musl-1.1.15
1321
ENV PATH=$PATH:/musl-i686/bin:/rust/bin

0 commit comments

Comments
 (0)