feat: bump llvm and clang

This commit is contained in:
Anton Livaja 2024-08-13 20:52:57 -04:00
parent 0c799b62b5
commit 09b4cd76bb
No known key found for this signature in database
GPG key ID: 44A86CFF1FDF0E85
12 changed files with 143 additions and 22 deletions

View file

@ -1,6 +1,6 @@
FROM scratch AS base
ENV VERSION=16.0.6
ENV SRC_HASH=ce5e71081d17ce9e86d7cbcfa28c4b04b9300f8fb7e78422b1feb6bc52c3028e
FROM scratch as base
ENV VERSION=18.1.8
ENV SRC_HASH=0b58557a6d32ceee97c8d533a59b9212d87e0fc4d2833924eb6c611247db2f2a
ENV SRC_FILE=llvm-project-${VERSION}.src.tar.xz
ENV SRC_SITE=https://github.com/llvm/llvm-project/releases/download/llvm-org-${VERSION}/${SRC_FILE}
@ -18,7 +18,7 @@ COPY --from=stagex/python . /
COPY --from=stagex/py-setuptools . /
COPY --from=stagex/openssl . /
COPY --from=stagex/gcc . /
COPY --from=stagex/llvm . /
COPY --from=stagex/llvm16 . /
COPY --from=stagex/zlib . /
RUN tar -xf ${SRC_FILE}

View file

@ -0,0 +1,48 @@
FROM scratch as base
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/llvm-org-${VERSION}/${SRC_FILE}
FROM base as fetch
ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} .
FROM fetch as build
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/llvm16 . /
COPY --from=stagex/zlib . /
RUN tar -xf ${SRC_FILE}
WORKDIR llvm-project-${VERSION}.src
RUN --network=none <<-EOF
set -eux
cmake \
-S clang \
-B build \
-G Ninja \
-Wno-dev \
-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
EOF
FROM build as install
RUN --network=none DESTDIR="/rootfs" cmake --install build
FROM stagex/filesystem as package
COPY --from=install /rootfs/. /

View file

@ -13,7 +13,7 @@ COPY --from=stagex/zlib . /
COPY --from=stagex/openssl . /
COPY --from=stagex/ca-certificates . /
COPY --from=stagex/gcc . /
COPY --from=stagex/llvm . /
COPY --from=stagex/llvm16 . /
COPY --from=stagex/binutils . /
COPY --from=stagex/pkgconf . /
COPY --from=stagex/git . /

View file

@ -10,7 +10,7 @@ COPY --from=stagex/rust . /
COPY --from=stagex/busybox . /
COPY --from=stagex/musl . /
COPY --from=stagex/gcc . /
COPY --from=stagex/llvm . /
COPY --from=stagex/llvm16 . /
COPY --from=stagex/libunwind . /
COPY --from=stagex/openssl . /
COPY --from=stagex/zlib . /
@ -24,7 +24,7 @@ ADD <<-EOF /.cargo/config.toml
RUN cargo fetch
FROM fetch AS build
COPY --from=stagex/clang . /
COPY --from=stagex/clang16 . /
COPY --from=stagex/linux-headers . /
COPY --from=stagex/gmp . /
COPY --from=stagex/nettle . /

View file

@ -18,7 +18,7 @@ COPY --from=stagex/python . /
COPY --from=stagex/py-setuptools . /
COPY --from=stagex/openssl . /
COPY --from=stagex/gcc . /
COPY --from=stagex/llvm . /
COPY --from=stagex/llvm16 . /
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/

View file

@ -1,10 +1,9 @@
FROM scratch AS base
ENV VERSION=16.0.6
FROM scratch as base
ENV VERSION=18.1.8
ENV SRC_FILE=llvm-project-${VERSION}.src.tar.xz
ENV SRC_SITE=https://github.com/llvm/llvm-project/releases/download/llvmorg-${VERSION}/${SRC_FILE}
ENV SRC_HASH=ce5e71081d17ce9e86d7cbcfa28c4b04b9300f8fb7e78422b1feb6bc52c3028e
FROM base AS fetch
ENV SRC_HASH=0b58557a6d32ceee97c8d533a59b9212d87e0fc4d2833924eb6c611247db2f2a
FROM base as fetch
ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} .
FROM fetch AS build
@ -21,6 +20,7 @@ COPY --from=stagex/openssl . /
RUN tar -xf ${SRC_FILE}
WORKDIR llvm-project-${VERSION}.src
ADD *.patch .
RUN --network=none <<-EOF
set -eux
python -c "import setuptools; print(setuptools.__version__)"

View file

@ -0,0 +1,73 @@
FROM scratch as base
ENV VERSION=16.0.6
ENV SRC_FILE=llvm-project-${VERSION}.src.tar.xz
ENV SRC_SITE=https://github.com/llvm/llvm-project/releases/download/llvmorg-${VERSION}/${SRC_FILE}
ENV SRC_HASH=ce5e71081d17ce9e86d7cbcfa28c4b04b9300f8fb7e78422b1feb6bc52c3028e
FROM base as fetch
ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} .
FROM fetch as build
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/zlib . /
COPY --from=stagex/openssl . /
RUN tar -xf ${SRC_FILE}
WORKDIR llvm-project-${VERSION}.src
ADD *.patch .
RUN --network=none <<-EOF
set -eux
python -c "import setuptools; print(setuptools.__version__)"
cmake \
-B build \
-G Ninja \
-Wno-dev -S llvm \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr/ \
-DCMAKE_INSTALL_RPATH=/usr/ \
-DLLVM_DEFAULT_TARGET_TRIPLE="x86_64-linux-musl" \
-DLLVM_HOST_TRIPLE="x86_64-linux-musl" \
-DLLVM_APPEND_VC_REV=OFF \
-DLLVM_BINUTILS_INCDIR=/usr/include \
-DLLVM_BUILD_DOCS=OFF \
-DLLVM_BUILD_EXAMPLES=OFF \
-DLLVM_BUILD_EXTERNAL_COMPILER_RT=ON \
-DLLVM_BUILD_LLVM_DYLIB=ON \
-DLLVM_BUILD_TESTS=ON \
-DLLVM_ENABLE_ASSERTIONS=OFF \
-DLLVM_ENABLE_DUMP=ON \
-DLLVM_ENABLE_EH=ON \
-DLLVM_ENABLE_FFI=OFF \
-DLLVM_ENABLE_LIBCXX=OFF \
-DLLVM_ENABLE_LIBEDIT=OFF \
-DLLVM_ENABLE_PIC=ON \
-DLLVM_ENABLE_RTTI=ON \
-DLLVM_ENABLE_SPHINX=OFF \
-DLLVM_ENABLE_TERMINFO=ON \
-DLLVM_ENABLE_ZLIB=FORCE_ON \
-DLLVM_ENABLE_ZSTD=OFF \
-DLLVM_INCLUDE_BENCHMARKS=OFF \
-DLLVM_INCLUDE_EXAMPLES=OFF \
-DLLVM_INSTALL_UTILS=ON \
-DLLVM_LINK_LLVM_DYLIB=ON \
-DLLVM_USE_PERF=ON
cmake --build build
python3 llvm/utils/lit/setup.py build
EOF
FROM build as install
RUN --network=none <<-EOF
set -eux
DESTDIR="/rootfs" cmake --install build
python3 llvm/utils/lit/setup.py install --root="/rootfs"
ln -s lit /rootfs/usr/bin/llvm-lit
EOF
FROM stagex/filesystem as package
COPY --from=install /rootfs/. /

View file

@ -10,7 +10,7 @@ COPY --from=stagex/rust . /
COPY --from=stagex/busybox . /
COPY --from=stagex/musl . /
COPY --from=stagex/gcc . /
COPY --from=stagex/llvm . /
COPY --from=stagex/llvm16 . /
COPY --from=stagex/libunwind . /
COPY --from=stagex/openssl . /
COPY --from=stagex/zlib . /
@ -20,7 +20,7 @@ WORKDIR openpgp-card-tools
RUN cargo fetch
FROM fetch AS build
COPY --from=stagex/clang . /
COPY --from=stagex/clang16 . /
COPY --from=stagex/linux-headers . /
COPY --from=stagex/gmp . /
COPY --from=stagex/nettle . /

View file

@ -14,10 +14,10 @@ COPY --from=stagex/make . /
COPY --from=stagex/musl . /
COPY --from=stagex/pkgconf . /
COPY --from=stagex/icu . /
COPY --from=stagex/llvm . /
COPY --from=stagex/llvm16 . /
COPY --from=stagex/zlib . /
COPY --from=stagex/gcc . /
COPY --from=stagex/clang . /
COPY --from=stagex/clang16 . /
COPY --from=stagex/perl . /
COPY --from=stagex/ncurses . /
COPY --from=stagex/bison . /

View file

@ -13,7 +13,7 @@ COPY --from=stagex/musl . /
COPY --from=stagex/gcc . /
COPY --from=stagex/binutils . /
COPY --from=stagex/pkgconf . /
COPY --from=stagex/llvm . /
COPY --from=stagex/llvm16 . /
COPY --from=stagex/libunwind . /
COPY --from=stagex/openssl . /
COPY --from=stagex/ca-certificates . /

View file

@ -176,8 +176,8 @@ RUN sh build.sh 1.66.0 1.65.0
RUN sh build.sh 1.67.0 1.66.0
RUN sh build.sh 1.68.0 1.67.0
FROM build-script AS build
COPY --from=stagex/llvm . /
FROM build-script as build
COPY --from=stagex/llvm16 . /
COPY --from=build-llvm13 /rust-1.68.0 /rust-1.68.0
COPY --from=stagex/llvm13 /usr/lib/libLLVM-13.so /usr/lib/
RUN sh build.sh 1.69.0 1.68.0

View file

@ -11,12 +11,12 @@ COPY static-glibc.patch .
FROM fetch AS build
COPY --from=stagex/binutils . /
COPY --from=stagex/busybox . /
COPY --from=stagex/clang . /
COPY --from=stagex/clang16 . /
COPY --from=stagex/cmake . /
COPY --from=stagex/gcc . /
COPY --from=stagex/libzstd . /
COPY --from=stagex/lld . /
COPY --from=stagex/llvm . /
COPY --from=stagex/llvm16 . /
COPY --from=stagex/make . /
COPY --from=stagex/musl . /
COPY --from=stagex/openssl . /