2024-02-14 00:49:58 +00:00
|
|
|
FROM scratch as base
|
2024-02-14 01:12:07 +00:00
|
|
|
ENV VERSION=16.0.6
|
|
|
|
ENV SRC_HASH=ce5e71081d17ce9e86d7cbcfa28c4b04b9300f8fb7e78422b1feb6bc52c3028e
|
|
|
|
ENV SRC_FILE=llvm-project-${VERSION}.src.tar.xz
|
2024-02-14 00:49:58 +00:00
|
|
|
ENV SRC_SITE=https://github.com/llvm/llvm-project/releases/download/llvm-org-${VERSION}/${SRC_FILE}
|
2024-02-09 21:17:17 +00:00
|
|
|
|
2024-02-14 00:49:58 +00:00
|
|
|
FROM base as fetch
|
|
|
|
ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} .
|
|
|
|
|
|
|
|
FROM fetch as build
|
2024-02-16 16:11:30 +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 . /
|
|
|
|
COPY --from=stagex/llvm . /
|
2024-02-26 01:36:48 +00:00
|
|
|
COPY --from=stagex/zlib . /
|
2024-02-16 16:11:30 +00:00
|
|
|
|
2024-02-14 01:12:07 +00:00
|
|
|
RUN tar -xf ${SRC_FILE}
|
|
|
|
WORKDIR llvm-project-${VERSION}.src
|
2024-02-09 21:17:17 +00:00
|
|
|
RUN set -eux; \
|
|
|
|
cmake \
|
2024-02-14 00:49:58 +00:00
|
|
|
-S clang \
|
2024-02-09 21:17:17 +00:00
|
|
|
-B build \
|
|
|
|
-G Ninja \
|
2024-02-14 00:49:58 +00:00
|
|
|
-Wno-dev \
|
2024-02-09 21:17:17 +00:00
|
|
|
-DCMAKE_BUILD_TYPE=Release \
|
|
|
|
-DCMAKE_INSTALL_PREFIX=/usr/ \
|
|
|
|
-DCMAKE_INSTALL_RPATH=/usr/ \
|
|
|
|
-DCLANG_BUILT_STANDALONE=ON \
|
|
|
|
-DCLANG_LINK_CLANG_DYLIB=ON \
|
|
|
|
-DCLANG_PLUGIN_SUPPORT=ON \
|
|
|
|
-DCLANG_VENDOR=stagex \
|
|
|
|
-DLIBCLANG_BUILD_STATIC=ON; \
|
|
|
|
cmake --build build
|
|
|
|
|
|
|
|
FROM build as install
|
2024-02-14 00:49:58 +00:00
|
|
|
RUN DESTDIR="/rootfs" cmake --install build
|
2024-02-09 21:17:17 +00:00
|
|
|
RUN find /rootfs -exec touch -hcd "@0" "{}" +
|
|
|
|
|
|
|
|
FROM scratch as package
|
|
|
|
COPY --from=install /rootfs /
|