diff --git a/CMakeLists.txt b/CMakeLists.txt index e2a0f361634..81da07aeb1a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -223,12 +223,11 @@ if (ENABLE_MOLD_LINKER) add_link_options(-fuse-ld=mold) endif() -if(NOT "${SERENITY_ARCH}" STREQUAL "aarch64") - if (CMAKE_CXX_COMPILER_ID MATCHES "Clang$" OR ENABLE_MOLD_LINKER) - add_link_options(LINKER:--pack-dyn-relocs=relr) - else() - add_link_options(LINKER:-z,pack-relative-relocs) - endif() +if (CMAKE_CXX_COMPILER_ID MATCHES "Clang$" OR ENABLE_MOLD_LINKER) + add_link_options(LINKER:--pack-dyn-relocs=relr) +elseif("${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() add_subdirectory(Userland) diff --git a/Kernel/CMakeLists.txt b/Kernel/CMakeLists.txt index d62768a568e..a72a9a8d002 100644 --- a/Kernel/CMakeLists.txt +++ b/Kernel/CMakeLists.txt @@ -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)