Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update binutils to 2.41 #127

Merged
merged 3 commits into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ variable "BINUTILS_VERSION_ONLY" {
}

variable "BINUTILS_VERSION" {
default = "2.38"
default = "2.41"
}

function "binutilsTag" {
Expand Down
25 changes: 13 additions & 12 deletions src/ld/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
#syntax=docker/dockerfile:1.5

ARG ALPINE_VERSION=3.18
ARG LIBTAPI_VERSION=1100.0.11
ARG CCTOOLS_VERSION=949.0.1-ld64-530
ARG SIGTOOL_VERSION=1dafd2ca4651210ba9acce10d279ace22b50fb01
# BINUTILS_PATCHES_VERSION defines version of aports to use for patches
ARG BINUTILS_PATCHES_VERSION=3.16-stable
ARG BINUTILS_VERSION=2.38
ARG BINUTILS_PATCHES_VERSION=master
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

using master because patches for binutils 2.41 are only on Alpine edge repo.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes this tag looks good, I'll open a follow-up to pin to it.

ARG BINUTILS_VERSION=2.41

FROM --platform=$BUILDPLATFORM tonistiigi/xx AS xx

FROM --platform=${BUILDPLATFORM} alpine AS libtapi-base
FROM --platform=${BUILDPLATFORM} alpine:${ALPINE_VERSION} AS libtapi-base
RUN apk add --no-cache git clang lld cmake make python3 bash
COPY --from=xx / /
ARG LIBTAPI_VERSION
Expand Down Expand Up @@ -42,7 +43,7 @@ RUN export INSTALLPREFIX=/opt/libtapi/ \
./build.sh && cd build && make -j $(nproc) LLVMObject tapiCore LLVMSupport LLVMDemangle LLVMMC LLVMBinaryFormat install-tapi-headers && mkdir /opt/libtapi/lib && cp -a ./lib/*.a /opt/libtapi/lib/ && \
cd .. && rm -rf build

FROM --platform=${BUILDPLATFORM} alpine AS cctools-base
FROM --platform=${BUILDPLATFORM} alpine:${ALPINE_VERSION} AS cctools-base
RUN apk add --no-cache git clang lld make llvm
COPY --from=xx / /
WORKDIR /work
Expand Down Expand Up @@ -101,7 +102,7 @@ COPY --from=ld64-static / /
COPY --from=sigtool / /
COPY ld64.signed /

FROM --platform=$BUILDPLATFORM alpine AS ld64-tgz-build
FROM --platform=$BUILDPLATFORM alpine:${ALPINE_VERSION} AS ld64-tgz-build
WORKDIR /work
ARG TARGETOS TARGETARCH TARGETVARIANT
RUN --mount=from=ld64-signed-static \
Expand All @@ -127,7 +128,7 @@ FROM scratch AS cctools
COPY --from=libtapi /opt/libtapi/lib/*.so /usr/lib/
COPY --from=cctools-build /opt/cctools /usr

FROM --platform=${BUILDPLATFORM} alpine AS sigtool-base
FROM --platform=${BUILDPLATFORM} alpine:${ALPINE_VERSION} AS sigtool-base
RUN apk add --no-cache git clang lld cmake make pkgconf
COPY --from=xx / /
WORKDIR /work
Expand Down Expand Up @@ -156,8 +157,8 @@ FROM scratch AS sigtool
COPY --from=codesign-static / /
COPY --from=sigtool-base /work/sigtool/build/gensig /sigtool-gensig

FROM --platform=$BUILDPLATFORM alpine AS binutils-base0
RUN apk add --no-cache file git clang lld zlib-dev gcc patch make musl-dev bison flex texinfo
FROM --platform=$BUILDPLATFORM alpine:${ALPINE_VERSION} AS binutils-base0
RUN apk add --no-cache file git clang lld linux-headers zlib-dev zstd-dev gcc patch make musl-dev musl-libintl bison flex texinfo
WORKDIR /work
ARG BINUTILS_PATCHES_VERSION
RUN git clone --depth 1 -b ${BINUTILS_PATCHES_VERSION} https://github.com/alpinelinux/aports.git && \
Expand All @@ -173,11 +174,11 @@ RUN export CC=xx-clang CXX=xx-clang++ LD=lld BINUTILS_TARGET=${TARGETPLATFORM} &
tar xf binutils-${BINUTILS_VERSION}.tar.gz && \
cd binutils-${BINUTILS_VERSION} && \
for f in ../patches/*; do patch -p1 < $f; done && \
./configure --disable-separate-code --libdir=/lib --prefix=/usr --disable-multilib --enable-deterministic-archives --target=$(TARGETPLATFORM=$BINUTILS_TARGET xx-info) --disable-nls && \
./configure --disable-separate-code --libdir=/lib --prefix=/usr --disable-multilib --enable-deterministic-archives --target=$(TARGETPLATFORM=$BINUTILS_TARGET xx-info) --disable-nls --disable-gprofng && \
make -j $(nproc) && \
make install && \
cd .. && rm -rf binutils-${BINUTILS_VERSION}
RUN xx-apk add --no-cache musl-dev gcc g++ zlib-dev
RUN xx-apk add --no-cache musl-dev gcc g++ zlib-dev zstd-dev

FROM binutils-base0 AS ld-base
RUN xx-apk add --no-cache zlib-static
Expand All @@ -192,7 +193,7 @@ RUN export CC=xx-clang CXX=xx-clang++ CFLAGS="$LD_CFLAGS --static" CXXFLAGS="$LD
tar xf binutils-${BINUTILS_VERSION}.tar.gz && \
cd binutils-${BINUTILS_VERSION} && \
for f in ../patches/*; do patch -p1 < $f; done && \
./configure --disable-separate-code --libdir=/lib --prefix=/ --disable-multilib --enable-deterministic-archives --target=$LD_TARGET_TRIPLE --host $(xx-clang --print-target-triple) --disable-nls --disable-gold --enable-relro --disable-plugins --with-pic --with-mmap --with-system-zlib --disable-gas --disable-elfcpp --disable-binutils --disable-gprof $BINUTILS_CONFIG && \
./configure --disable-separate-code --libdir=/lib --prefix=/ --disable-multilib --enable-deterministic-archives --target=$LD_TARGET_TRIPLE --host $(xx-clang --print-target-triple) --disable-nls --disable-gold --enable-relro --disable-plugins --with-pic --with-mmap --with-system-zlib --disable-gas --disable-elfcpp --disable-binutils --disable-gprofng $BINUTILS_CONFIG && \
make -j $(nproc) && \
make install && \
cd .. && rm -rf binutils-${BINUTILS_VERSION} && \
Expand Down Expand Up @@ -224,7 +225,7 @@ RUN export CC=xx-clang CXX=xx-clang++ CFLAGS="$BINUTILS_CFLAGS" CXXFLAGS="$BINUT
tar xf binutils-${BINUTILS_VERSION}.tar.gz && \
cd binutils-${BINUTILS_VERSION} && \
for f in ../patches/*; do patch -p1 < $f; done && \
./configure --disable-separate-code --libdir=/lib --prefix=/out --disable-multilib --enable-deterministic-archives --target=$(TARGETPLATFORM= TARGETPAIR=$BINUTILS_TARGET xx-info) --host $(xx-clang --print-target-triple) --disable-nls --enable-gold --enable-relro --enable-plugins --with-pic --with-mmap --with-system-zlib $BINUTILS_CONFIG && \
./configure --disable-separate-code --libdir=/lib --prefix=/out --disable-multilib --enable-deterministic-archives --target=$(TARGETPLATFORM= TARGETPAIR=$BINUTILS_TARGET xx-info) --host $(xx-clang --print-target-triple) --disable-nls --enable-gold --enable-relro --enable-plugins --with-pic --with-mmap --with-system-zlib --disable-gprofng $BINUTILS_CONFIG && \
make -j $(nproc) && \
make install && \
cd .. && rm -rf binutils-${BINUTILS_VERSION} && \
Expand Down
Loading