1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-08 22:57:36 +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:
Daniel Bertalan 2021-11-21 08:25:51 +01:00 committed by Brian Gianforcaro
parent f29f9762a2
commit e88ca09609
8 changed files with 159 additions and 60 deletions

View file

@ -0,0 +1,35 @@
diff --git a/clang/tools/libclang/CMakeLists.txt b/clang/tools/libclang/CMakeLists.txt
index bf88dca0a..dfac32b16 100644
--- a/clang/tools/libclang/CMakeLists.txt
+++ b/clang/tools/libclang/CMakeLists.txt
@@ -80,7 +80,7 @@ if(MSVC)
set(LLVM_EXPORTED_SYMBOL_FILE)
endif()
-if (UNIX AND NOT APPLE)
+if (UNIX AND NOT APPLE AND NOT SERENITYOS)
set(LLVM_EXPORTED_SYMBOL_FILE)
set(USE_VERSION_SCRIPT ${LLVM_HAVE_LINK_VERSION_SCRIPT})
endif()
diff --git a/llvm/tools/llvm-shlib/CMakeLists.txt b/llvm/tools/llvm-shlib/CMakeLists.txt
index 76b9a25cb..808838926 100644
--- a/llvm/tools/llvm-shlib/CMakeLists.txt
+++ b/llvm/tools/llvm-shlib/CMakeLists.txt
@@ -33,7 +33,7 @@ if(LLVM_BUILD_LLVM_DYLIB)
add_llvm_library(LLVM SHARED DISABLE_LLVM_LINK_LLVM_DYLIB SONAME ${INSTALL_WITH_TOOLCHAIN} ${SOURCES})
list(REMOVE_DUPLICATES LIB_NAMES)
- if(("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") OR (MINGW) OR (HAIKU)
+ if(("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") OR (MINGW) OR (HAIKU) OR (SERENITYOS)
OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "FreeBSD")
OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "GNU")
OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "OpenBSD")
@@ -46,7 +46,7 @@ if(LLVM_BUILD_LLVM_DYLIB)
# GNU ld doesn't resolve symbols in the version script.
set(LIB_NAMES -Wl,--whole-archive ${LIB_NAMES} -Wl,--no-whole-archive)
- if (NOT LLVM_LINKER_IS_SOLARISLD AND NOT MINGW)
+ if (NOT LLVM_LINKER_IS_SOLARISLD AND NOT MINGW AND NOT SERENITYOS)
# Solaris ld does not accept global: *; so there is no way to version *all* global symbols
set(LIB_NAMES -Wl,--version-script,${LLVM_LIBRARY_DIR}/tools/llvm-shlib/simple_version_script.map ${LIB_NAMES})
endif()