toolchain/Dockerfile
Adrien Beaudouin 961fc05af6
Some checks failed
/ build (push) Failing after 2m15s
init
2025-06-06 18:45:24 +02:00

85 lines
2.3 KiB
Docker

FROM gitea.okami101.io/okami101/stagex/core-binutils:latest AS binutils
FROM gitea.okami101.io/okami101/stagex/core-gcc:latest AS gcc
FROM gitea.okami101.io/okami101/stagex/core-make:latest AS make
FROM gitea.okami101.io/okami101/stagex/core-musl:latest AS musl
FROM gitea.okami101.io/okami101/stagex/core-busybox:latest AS busybox
FROM scratch AS bootstrap-c-toolchain
COPY --from=binutils / /
COPY --from=gcc / /
COPY --from=make / /
COPY --from=musl / /
COPY --from=busybox / /
FROM bootstrap-c-toolchain AS build-make
ARG VERSION=4.4.1
WORKDIR /source
RUN wget https://ftp.gnu.org/gnu/make/make-${VERSION}.tar.gz -O make.tar.gz
RUN tar -xzf make.tar.gz --strip-components=1 && \
mkdir build && \
cd build && \
../configure --prefix=/usr --without-guile
RUN cd build && \
make -j$(nproc)
RUN cd build && \
make DESTDIR=/rootfs install
FROM bootstrap-c-toolchain AS build-binutils
ARG VERSION=2.44
WORKDIR /source
RUN wget https://ftp.gnu.org/gnu/binutils/binutils-${VERSION}.tar.xz -O binutils.tar.xz
RUN tar -xJf binutils.tar.xz --strip-components=1 && \
./configure \
--build=${BUILD} \
--host=${HOST} \
--prefix=/usr \
--disable-nls \
--disable-gdb \
--disable-gprofng \
--disable-werror \
--enable-deterministic-archives \
--enable-targets=aarch64-linux-musl,aarch64_be-linux-musl,i686-linux-musl,x86_64-linux-musl,x86_64-linux-muslx32,x86_64-pep
RUN make -j $(nproc)
RUN make DESTDIR=/rootfs install && \
rm -r /rootfs/usr/share/man
# FROM bootstrap-c-toolchain AS build-gcc
# WORKDIR /source
# 14.2.0
# 4.2.2
# 6.2.1
# 1.3.1
# RUN wget https://ftp.gnu.org/gnu/gcc/gcc-{{ .gcc_version }}/gcc-{{ .gcc_version }}.tar.xz -O gcc.tar.gz
# RUN tar -xJf binutils.tar.xz --strip-components=1 && \
# ./configure \
# --build=${BUILD} \
# --host=${HOST} \
# --prefix=/usr \
# --disable-nls \
# --disable-gdb \
# --disable-gprofng \
# --disable-werror \
# --enable-deterministic-archives \
# --enable-targets=aarch64-linux-musl,aarch64_be-linux-musl,i686-linux-musl,x86_64-linux-musl,x86_64-linux-muslx32,x86_64-pep
# RUN make -j $(nproc)
# RUN make DESTDIR=/rootfs install && \
# rm -r /rootfs/usr/share/man
FROM busybox AS final
COPY --from=build-make /rootfs/ /
COPY --from=build-binutils /rootfs/ /