stagex/packages/binutils/Containerfile

58 lines
1.4 KiB
Text
Raw Normal View History

2024-02-09 07:30:28 +00:00
FROM scratch as base
ARG ARCH=x86_64
ENV VERSION=2.35
ENV SRC_HASH=1b11659fb49e20e18db460d44485f09442c8c56d5df165de9461eb09c8302f85
ENV SRC_FILE=binutils-${VERSION}.tar.xz
ENV SRC_SITE=https://ftp.gnu.org/gnu/binutils/${SRC_FILE}
2023-11-13 22:45:56 +00:00
2023-12-16 23:50:40 +00:00
FROM base as fetch
2024-02-09 07:30:28 +00:00
ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} .
2023-12-16 23:50:40 +00:00
FROM fetch as build
2024-02-09 07:30:28 +00:00
COPY --from=stage3 . /
RUN tar -xf binutils-${VERSION}.tar.xz
WORKDIR binutils-${VERSION}
RUN --network=none <<-EOF
set -ex
CFLAGS='-Os -Wformat -Werror=format-security -O2' \
CXXFLAGS='-Os -Wformat -Werror=format-security -O2' \
./configure \
--build=${ARCH}-linux-musl \
--host=${ARCH}-linux-musl \
--target=${ARCH}-linux-musl \
--with-build-sysroot= \
--with-sysroot=/ \
--prefix=/usr \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--sysconfdir=/etc \
--enable-plugins \
--without-zstd \
--disable-shared \
--disable-jansson \
--disable-gdb \
--disable-gprofng \
--disable-multilib \
--disable-nls \
--disable-werror \
--enable-gold \
--enable-64-bit-bfd \
--enable-default-execstack=no \
--enable-default-hash-style=gnu \
--enable-deterministic-archives \
--enable-ld=default \
--enable-new-dtags \
--enable-relro \
--enable-threads \
--with-mmap \
--with-pic
2023-12-16 23:50:40 +00:00
make -j "$(nproc)"
2024-02-09 07:30:28 +00:00
EOF
2023-12-16 23:50:40 +00:00
FROM build as install
2024-02-09 07:30:28 +00:00
RUN --network=none make DESTDIR="/rootfs" install
RUN find /rootfs -exec touch -hcd "@0" "{}" +
2023-11-13 22:45:56 +00:00
2023-12-12 17:45:39 +00:00
FROM scratch as package
2023-12-16 23:50:40 +00:00
COPY --from=install /rootfs /