diff --git a/base/Dockerfile b/base/Dockerfile index d6e6d9f..343b535 100644 --- a/base/Dockerfile +++ b/base/Dockerfile @@ -86,12 +86,15 @@ RUN export INSTALLPREFIX=/opt/libtapi/ \ cd .. && rm -rf build #xx-verify --static ./build/lib/libtapi.a +#FROM --platform=${BUILDPLATFORM} tonistiigi/xx:binutils-2.36.1-${TARGETOS}-${TARGETARCH}${TARGETVARIANT}-alpine AS binutils-release + FROM --platform=${BUILDPLATFORM} alpine AS cctools-base -RUN apk add --no-cache git clang lld make binutils +RUN apk add --no-cache git clang lld make llvm COPY --from=base / / WORKDIR /work +ARG CCTOOLS_REPO=https://github.com/tpoechtrager/cctools-port ARG CCTOOLS_VERSION=949.0.1-ld64-530 -RUN git clone https://github.com/tpoechtrager/cctools-port -b ${CCTOOLS_VERSION} +RUN git clone $CCTOOLS_REPO -b ${CCTOOLS_VERSION} WORKDIR ./cctools-port/cctools ARG TARGETPLATFORM RUN xx-apk add --no-cache musl-dev gcc g++ @@ -189,9 +192,9 @@ COPY --from=sigtool-base /work/sigtool/build/gensig /sigtool-gensig FROM --platform=$BUILDPLATFORM tonistiigi/osxcross:11.1 AS darwinsdk FROM scratch AS ld64-signed-static -COPY --from=ld64-static / /usr/bin -COPY --from=sigtool / /usr/bin -COPY ld64.signed /usr/bin +COPY --from=ld64-static / / +COPY --from=sigtool / / +COPY ld64.signed / FROM --platform=$BUILDPLATFORM alpine AS ld64-tgz-build WORKDIR /work diff --git a/docker-bake.hcl b/docker-bake.hcl index 4452593..9078420 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -37,6 +37,14 @@ target "base-all" { inherits = ["base", "_all-platforms"] } +target "ld64-tgz" { + context = "base" + target = "ld64-tgz" + output = ["./ld64-tgz"] + platforms = ["linux/amd64", "linux/arm64", "linux/arm", "linux/arm/v6", "linux/386"] + cache-to = ["type=inline"] +} + variable "BINUTILS_VERSION_ONLY" { default = "" }