2024-08-08 07:47:42 +00:00
|
|
|
FROM scratch AS base
|
2024-02-26 01:37:08 +00:00
|
|
|
ENV VERSION=16.0.6
|
|
|
|
ENV SRC_HASH=ce5e71081d17ce9e86d7cbcfa28c4b04b9300f8fb7e78422b1feb6bc52c3028e
|
|
|
|
ENV SRC_FILE=llvm-project-${VERSION}.src.tar.xz
|
|
|
|
ENV SRC_SITE=https://github.com/llvm/llvm-project/releases/download/llvmorg-${VERSION}/${SRC_FILE}
|
|
|
|
|
2024-08-08 07:47:42 +00:00
|
|
|
FROM base AS fetch
|
2024-02-26 01:37:08 +00:00
|
|
|
ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} .
|
|
|
|
|
2024-08-08 07:47:42 +00:00
|
|
|
FROM fetch AS build
|
2024-02-26 01:37:08 +00:00
|
|
|
COPY --from=stagex/busybox . /
|
|
|
|
COPY --from=stagex/binutils . /
|
|
|
|
COPY --from=stagex/cmake . /
|
|
|
|
COPY --from=stagex/ninja . /
|
|
|
|
COPY --from=stagex/musl . /
|
|
|
|
COPY --from=stagex/gcc . /
|
|
|
|
COPY --from=stagex/python . /
|
|
|
|
COPY --from=stagex/py-setuptools . /
|
|
|
|
COPY --from=stagex/openssl . /
|
|
|
|
COPY --from=stagex/gcc . /
|
2024-08-14 10:12:27 +00:00
|
|
|
COPY --from=stagex/llvm . /
|
2024-02-26 01:37:08 +00:00
|
|
|
COPY --from=stagex/zlib . /
|
|
|
|
# HACK: figure out why gcc package puts these in the wrong path at install time
|
|
|
|
COPY --from=stagex/gcc /usr/lib64/* /usr/lib/
|
|
|
|
|
|
|
|
RUN tar -xf ${SRC_FILE}
|
|
|
|
WORKDIR llvm-project-${VERSION}.src
|
|
|
|
RUN set -eux; \
|
|
|
|
cmake \
|
|
|
|
-S lld \
|
|
|
|
-B build \
|
|
|
|
-G Ninja \
|
|
|
|
-Wno-dev \
|
|
|
|
-DCMAKE_BUILD_TYPE=Release \
|
|
|
|
-DCMAKE_INSTALL_PREFIX=/usr/ \
|
|
|
|
-DCMAKE_INSTALL_RPATH=/usr/ \
|
|
|
|
-DLLVM_ENABLE_ZLIB=FORCE_ON; \
|
|
|
|
cmake --build build
|
|
|
|
|
2024-08-08 07:47:42 +00:00
|
|
|
FROM build AS install
|
2024-04-11 20:09:20 +00:00
|
|
|
RUN --network=none DESTDIR="/rootfs" cmake --install build
|
2024-02-26 01:37:08 +00:00
|
|
|
|
2024-08-08 07:47:42 +00:00
|
|
|
FROM stagex/filesystem AS package
|
2024-03-01 18:30:23 +00:00
|
|
|
COPY --from=install /rootfs/. /
|