mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 22:27:35 +00:00
CMake: Enable RELR relocations for Clang OR x86-64
While LLD and mold support RELR "packed" relocations on all architectures, the BFD linker currently only implements them on x86-64 and POWER. This fixes two issues: - The Kernel had it enabled even for AArch64 + GCC, which led to the following being printed: `warning: -z pack-relative-relocs ignored`. - The userland always had it disabled, even in the supported AArch64 + Clang/mold scenarios.
This commit is contained in:
parent
11896868d6
commit
055d2b6c8a
2 changed files with 9 additions and 7 deletions
|
@ -611,7 +611,10 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
|||
set_source_files_properties(Library/MiniStdLib.cpp
|
||||
PROPERTIES COMPILE_FLAGS "-fno-tree-loop-distribution -fno-tree-loop-distribute-patterns")
|
||||
|
||||
add_link_options(LINKER:-z,pack-relative-relocs)
|
||||
if ("${SERENITY_ARCH}" STREQUAL "x86_64")
|
||||
# The BFD linker only supports RELR relocations on x86 and POWER.
|
||||
add_link_options(LINKER:-z,pack-relative-relocs)
|
||||
endif()
|
||||
else() # Assume Clang
|
||||
add_compile_options(-Waddress-of-packed-member)
|
||||
add_compile_options(-faligned-allocation)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue