1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 22:57:44 +00:00

Kernel: Introduce workaround to make LTO builds work with Clang

LLD fails to define the _GLOBAL_OFFSET_TABLE_ symbol if all inputs to it
are LLVM bitcode files (i.e. those used for LTO). To allow the kernel to
be built with ThinLTO, the workaround suggested in the original LLVM bug
report (<https://bugs.llvm.org/show_bug.cgi?id=39634>) is added in this
commit.
This commit is contained in:
Daniel Bertalan 2021-10-09 19:05:19 +02:00 committed by Linus Groh
parent 3c3df95958
commit 1faffc2192
2 changed files with 13 additions and 0 deletions

View file

@ -489,6 +489,7 @@ set_target_properties(Kernel PROPERTIES LINK_DEPENDS "${CMAKE_CURRENT_BINARY_DIR
if (ENABLE_KERNEL_LTO)
include(CheckIPOSupported)
check_ipo_supported()
add_definitions(-DENABLE_KERNEL_LTO)
set_property(TARGET Kernel PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE)
endif()