feat: add llvm13
This commit is contained in:
parent
5c95e00d55
commit
bc99adf54e
2 changed files with 94 additions and 0 deletions
76
src/core/llvm13/Containerfile
Normal file
76
src/core/llvm13/Containerfile
Normal file
|
@ -0,0 +1,76 @@
|
|||
FROM scratch as base
|
||||
ARG VERSION=13.0.1
|
||||
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=326335a830f2e32d06d0a36393b5455d17dc73e0bd1211065227ee014f92cbf8
|
||||
|
||||
FROM base as fetch
|
||||
ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} .
|
||||
|
||||
FROM fetch as build
|
||||
COPY --from=busybox . /
|
||||
COPY --from=binutils . /
|
||||
COPY --from=cmake . /
|
||||
COPY --from=ninja . /
|
||||
COPY --from=musl . /
|
||||
COPY --from=gcc . /
|
||||
COPY --from=python . /
|
||||
COPY --from=py-setuptools . /
|
||||
COPY --from=zlib . /
|
||||
COPY --from=openssl . /
|
||||
# HACK: figure out why gcc package puts these in the wrong path at install time
|
||||
COPY --from=gcc /usr/lib64/* /usr/lib/
|
||||
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=OFF \
|
||||
-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 <<-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
|
||||
RUN find /rootfs -exec touch -hcd "@0" "{}" +
|
||||
|
||||
FROM scratch as package
|
||||
COPY --from=install /rootfs /
|
|
@ -250,6 +250,23 @@ out/linux-headers/index.json: \
|
|||
out/stage3/index.json
|
||||
$(call build,core,linux-headers)
|
||||
|
||||
.PHONY: llvm13
|
||||
llvm13: out/llvm13/index.json
|
||||
out/llvm13/index.json: \
|
||||
src/core/llvm13/Containerfile \
|
||||
out/binutils/index.json \
|
||||
out/busybox/index.json \
|
||||
out/cmake/index.json \
|
||||
out/gcc/index.json \
|
||||
out/make/index.json \
|
||||
out/musl/index.json \
|
||||
out/ninja/index.json \
|
||||
out/openssl/index.json \
|
||||
out/py-setuptools/index.json \
|
||||
out/python/index.json \
|
||||
out/zlib/index.json
|
||||
$(call build,core,llvm13)
|
||||
|
||||
.PHONY: llvm
|
||||
llvm: out/llvm/index.json
|
||||
out/llvm/index.json: \
|
||||
|
@ -418,6 +435,7 @@ out/rust/index.json: \
|
|||
out/cmake/index.json \
|
||||
out/gcc/index.json \
|
||||
out/libunwind/index.json \
|
||||
out/llvm13/index.json \
|
||||
out/llvm/index.json \
|
||||
out/make/index.json \
|
||||
out/musl/index.json \
|
||||
|
|
Loading…
Reference in a new issue