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.
This commit is contained in:
Ian Denhardt 2016-10-04 01:44:15 -04:00
parent 0ecafc3197
commit cd03b14093

View File

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