-
Notifications
You must be signed in to change notification settings - Fork 365
/
Dockerfile.i586-unknown-linux-musl
43 lines (33 loc) · 1.34 KB
/
Dockerfile.i586-unknown-linux-musl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
FROM ubuntu:20.04 as cross-base
ENV DEBIAN_FRONTEND=noninteractive
COPY common.sh lib.sh /
RUN /common.sh
COPY cmake.sh /
RUN /cmake.sh
COPY xargo.sh /
RUN /xargo.sh
FROM cross-base as build
COPY musl.sh /
RUN /musl.sh TARGET=i586-linux-musl
COPY qemu.sh /
RUN /qemu.sh i386
ENV CROSS_TOOLCHAIN_PREFIX=i586-linux-musl-
ENV CROSS_SYSROOT=/usr/local/i586-linux-musl
COPY musl-symlink.sh /
RUN /musl-symlink.sh $CROSS_SYSROOT i386
COPY qemu-runner base-runner.sh /
COPY toolchain.cmake /opt/toolchain.cmake
ENV CROSS_TARGET_RUNNER="/qemu-runner i586"
ENV CARGO_TARGET_I586_UNKNOWN_LINUX_MUSL_LINKER="$CROSS_TOOLCHAIN_PREFIX"gcc \
CARGO_TARGET_I586_UNKNOWN_LINUX_MUSL_RUNNER="$CROSS_TARGET_RUNNER" \
AR_i586_unknown_linux_musl="$CROSS_TOOLCHAIN_PREFIX"ar \
CC_i586_unknown_linux_musl="$CROSS_TOOLCHAIN_PREFIX"gcc \
CXX_i586_unknown_linux_musl="$CROSS_TOOLCHAIN_PREFIX"g++ \
CMAKE_TOOLCHAIN_FILE_i586_unknown_linux_musl=/opt/toolchain.cmake \
BINDGEN_EXTRA_CLANG_ARGS_i586_unknown_linux_musl="--sysroot=$CROSS_SYSROOT" \
QEMU_LD_PREFIX="$CROSS_SYSROOT" \
CROSS_CMAKE_SYSTEM_NAME=Linux \
CROSS_CMAKE_SYSTEM_PROCESSOR=x86 \
CROSS_CMAKE_CRT=musl \
CROSS_CMAKE_OBJECT_FLAGS="-ffunction-sections -fdata-sections -fPIC -m32 -march=pentium -Wl,-melf_i386"
RUN sed -e "s#@DEFAULT_QEMU_LD_PREFIX@#$QEMU_LD_PREFIX#g" -i /qemu-runner