mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 13:07:46 +00:00
Ports: Upgrade LLVM to version 13.0.0
With this update, we now use our custom `serenity` Clang target, which means that all system-specific compilation options (e.g. default PIE, header search paths) will be handled automatically. This port has been tested to build `Source/little` on all 4 toolchain-architecture pairs. Furthermore, `lib(std)c++` headers are picked up correctly and our AK headers can be included without any issues. Due to recent kernel fixes related to memory-mapped files, the LLD linker can now be used by default, so there's no need to also build the GCC port alongside this. Although our patches cover building libLLVM as a shared library, this is currently not enabled by default, as DynamicLoader is very slow in dealing with such a large number of relocations.
This commit is contained in:
parent
f29f9762a2
commit
e88ca09609
8 changed files with 159 additions and 60 deletions
|
@ -1,11 +1,12 @@
|
|||
#!/usr/bin/env -S bash ../.port_include.sh
|
||||
port=llvm
|
||||
useconfigure=true
|
||||
version=12.0.0
|
||||
version=13.0.0
|
||||
workdir=llvm-project-llvmorg-${version}
|
||||
configopts=("-DCMAKE_TOOLCHAIN_FILE=${SERENITY_BUILD_DIR}/CMakeToolchain.txt")
|
||||
files="https://github.com/llvm/llvm-project/archive/refs/tags/llvmorg-${version}.zip llvm.zip f77723b70a5d4ab14899feda87d6cf601612165899abb2f6c7b670e517f45e2d"
|
||||
files="https://github.com/llvm/llvm-project/archive/refs/tags/llvmorg-${version}.zip llvm.zip 333a4e053fb543d9efb8dc68126d9e7a948ecb246985f2804a0ecbc5ccdb9d08"
|
||||
auth_type=sha256
|
||||
depends=("ncurses" "zlib")
|
||||
|
||||
pre_patch() {
|
||||
host_env
|
||||
|
@ -18,25 +19,42 @@ pre_patch() {
|
|||
}
|
||||
|
||||
configure() {
|
||||
if [ "$SERENITY_TOOLCHAIN" = "Clang" ]; then
|
||||
stdlib=""
|
||||
unwindlib=""
|
||||
else
|
||||
stdlib="libstdc++"
|
||||
unwindlib="libgcc"
|
||||
fi
|
||||
mkdir -p llvm-build
|
||||
cmake ${workdir}/llvm \
|
||||
-G Ninja \
|
||||
-B llvm-build "${configopts[@]}" \
|
||||
-DCMAKE_BUILD_TYPE=MinSizeRel \
|
||||
-DLLVM_TARGETS_TO_BUILD=X86 \
|
||||
-DCMAKE_FIND_ROOT_PATH="$SERENITY_BUILD_DIR"/Root \
|
||||
-DCLANG_DEFAULT_CXX_STDLIB=$stdlib \
|
||||
-DCLANG_DEFAULT_UNWINDLIB=$unwindlib \
|
||||
-DCLANG_TABLEGEN=$(pwd)/llvm-host/bin/clang-tblgen \
|
||||
-DCOMPILER_RT_BUILD_CRT=ON \
|
||||
-DCOMPILER_RT_BUILD_ORC=OFF \
|
||||
-DCOMPILER_RT_EXCLUDE_ATOMIC_BUILTIN=OFF \
|
||||
-DCOMPILER_RT_OS_DIR=serenity \
|
||||
-DHAVE_LIBRT=OFF \
|
||||
-DLLVM_DEFAULT_TARGET_TRIPLE=$SERENITY_ARCH-pc-serenity \
|
||||
-DLLVM_ENABLE_PROJECTS="clang;lld;compiler-rt" \
|
||||
-DLLVM_TABLEGEN=$(pwd)/llvm-host/bin/llvm-tblgen \
|
||||
-DCMAKE_CROSSCOMPILING=True \
|
||||
-DLLVM_DEFAULT_TARGET_TRIPLE=i386-none-gnueabi \
|
||||
-DLLVM_TARGET_ARCH=X86 \
|
||||
-DLLVM_HAVE_LIBXAR=OFF \
|
||||
-DLLVM_INCLUDE_BENCHMARKS=OFF \
|
||||
-DLLVM_INCLUDE_TESTS=OFF \
|
||||
-DCLANG_TABLEGEN=$(pwd)/llvm-host/bin/clang-tblgen
|
||||
-DLLVM_INSTALL_TOOLCHAIN_ONLY=ON \
|
||||
-DLLVM_PTHREAD_LIB=pthread \
|
||||
-DLLVM_TABLEGEN=$(pwd)/llvm-host/bin/llvm-tblgen \
|
||||
-DLLVM_TARGETS_TO_BUILD=X86
|
||||
}
|
||||
|
||||
build() {
|
||||
make -C llvm-build -j $(nproc) --no-print-directory
|
||||
ninja -C llvm-build
|
||||
}
|
||||
|
||||
install() {
|
||||
make -C llvm-build -j $(nproc) --no-print-directory install
|
||||
ninja -C llvm-build install
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue