2019-02-27 06:55:26 +00:00
|
|
|
FROM debian:buster-slim AS base
|
2021-02-02 02:54:17 +00:00
|
|
|
RUN echo "deb http://os.loongnix.org/mirrors/debian/debian/ buster main" > /etc/apt/sources.list
|
2020-03-11 09:57:16 +00:00
|
|
|
RUN apt-get update && apt-get --no-install-recommends install -y \
|
2019-02-27 06:55:26 +00:00
|
|
|
binutils-arm-linux-gnueabihf \
|
|
|
|
binutils-aarch64-linux-gnu \
|
2019-06-04 06:21:04 +00:00
|
|
|
binutils-x86-64-linux-gnu \
|
2019-08-06 01:03:20 +00:00
|
|
|
binutils-i686-linux-gnu \
|
2019-07-30 21:55:46 +00:00
|
|
|
binutils-riscv64-linux-gnu \
|
|
|
|
binutils-s390x-linux-gnu \
|
2021-02-02 02:54:17 +00:00
|
|
|
binutils-powerpc64le-linux-gnu \
|
|
|
|
binutils-mips64el-linux-gnuabi64 \
|
|
|
|
binutils-mips64-linux-gnuabi64
|
2019-02-27 06:55:26 +00:00
|
|
|
WORKDIR /src
|
|
|
|
|
|
|
|
|
|
|
|
FROM base AS exit-amd64
|
|
|
|
COPY fixtures/exit.amd64.s .
|
2020-10-17 18:10:54 +00:00
|
|
|
RUN x86_64-linux-gnu-as --noexecstack -o exit.o exit.amd64.s && x86_64-linux-gnu-ld -o exit -s exit.o
|
2019-02-27 06:55:26 +00:00
|
|
|
|
2019-08-06 01:03:20 +00:00
|
|
|
FROM base AS exit-386
|
|
|
|
COPY fixtures/exit.386.s .
|
2020-10-17 18:10:54 +00:00
|
|
|
RUN i686-linux-gnu-as --noexecstack -o exit.o exit.386.s && i686-linux-gnu-ld -o exit -s exit.o
|
2019-08-06 01:03:20 +00:00
|
|
|
|
2019-02-27 06:55:26 +00:00
|
|
|
FROM base AS exit-arm64
|
|
|
|
COPY fixtures/exit.arm64.s .
|
2020-10-17 18:10:54 +00:00
|
|
|
RUN aarch64-linux-gnu-as --noexecstack -o exit.o exit.arm64.s && aarch64-linux-gnu-ld -o exit -s exit.o
|
2019-02-27 06:55:26 +00:00
|
|
|
|
|
|
|
FROM base AS exit-arm
|
|
|
|
COPY fixtures/exit.arm.s .
|
2020-10-17 18:10:54 +00:00
|
|
|
RUN arm-linux-gnueabihf-as --noexecstack -o exit.o exit.arm.s && arm-linux-gnueabihf-ld -o exit -s exit.o
|
2019-02-27 06:55:26 +00:00
|
|
|
|
2019-06-04 06:21:04 +00:00
|
|
|
FROM base AS exit-riscv64
|
|
|
|
COPY fixtures/exit.riscv64.s .
|
2020-10-17 18:10:54 +00:00
|
|
|
RUN riscv64-linux-gnu-as --noexecstack -o exit.o exit.riscv64.s && riscv64-linux-gnu-ld -o exit -s exit.o
|
2019-06-04 06:21:04 +00:00
|
|
|
|
2019-07-30 21:55:46 +00:00
|
|
|
FROM base AS exit-s390x
|
|
|
|
COPY fixtures/exit.s390x.s .
|
2020-10-17 18:10:54 +00:00
|
|
|
RUN s390x-linux-gnu-as --noexecstack -o exit.o exit.s390x.s && s390x-linux-gnu-ld -o exit -s exit.o
|
2019-07-30 21:55:46 +00:00
|
|
|
|
|
|
|
FROM base AS exit-ppc64le
|
|
|
|
COPY fixtures/exit.ppc64le.s .
|
2020-10-17 18:10:54 +00:00
|
|
|
RUN powerpc64le-linux-gnu-as --noexecstack -o exit.o exit.ppc64le.s && powerpc64le-linux-gnu-ld -o exit -s exit.o
|
2019-06-04 06:21:04 +00:00
|
|
|
|
2021-02-02 02:54:17 +00:00
|
|
|
FROM base AS exit-mips64le
|
|
|
|
COPY fixtures/exit.mips64le.s .
|
|
|
|
RUN mips64el-linux-gnuabi64-as --noexecstack -o exit.o exit.mips64le.s && mips64el-linux-gnuabi64-ld -o exit -s exit.o
|
|
|
|
|
|
|
|
FROM base AS exit-mips64
|
|
|
|
COPY fixtures/exit.mips64.s .
|
|
|
|
RUN mips64-linux-gnuabi64-as --noexecstack -o exit.o exit.mips64.s && mips64-linux-gnuabi64-ld -o exit -s exit.o
|
|
|
|
|
2021-08-17 02:56:45 +00:00
|
|
|
FROM golang:1.17-alpine AS generate
|
2019-02-27 06:55:26 +00:00
|
|
|
WORKDIR /src
|
|
|
|
COPY --from=exit-amd64 /src/exit amd64
|
2019-08-06 01:03:20 +00:00
|
|
|
COPY --from=exit-386 /src/exit 386
|
2019-02-27 06:55:26 +00:00
|
|
|
COPY --from=exit-arm64 /src/exit arm64
|
|
|
|
COPY --from=exit-arm /src/exit arm
|
2019-06-04 06:21:04 +00:00
|
|
|
COPY --from=exit-riscv64 /src/exit riscv64
|
2019-07-30 21:55:46 +00:00
|
|
|
COPY --from=exit-s390x /src/exit s390x
|
|
|
|
COPY --from=exit-ppc64le /src/exit ppc64le
|
2021-02-02 02:54:17 +00:00
|
|
|
COPY --from=exit-mips64le /src/exit mips64le
|
|
|
|
COPY --from=exit-mips64 /src/exit mips64
|
2019-02-27 06:55:26 +00:00
|
|
|
COPY generate.go .
|
|
|
|
|
2021-02-02 02:54:17 +00:00
|
|
|
RUN go run generate.go amd64 386 arm64 arm riscv64 s390x ppc64le mips64le mips64 && ls -l
|
2019-02-27 06:55:26 +00:00
|
|
|
|
|
|
|
|
|
|
|
FROM scratch
|
2019-02-26 06:46:12 +00:00
|
|
|
COPY --from=generate /src/*_binary.go /
|