summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorGunnar Beutner <gbeutner@serenityos.org>2021-06-28 17:19:18 +0200
committerAndreas Kling <kling@serenityos.org>2021-06-28 22:29:28 +0200
commite35b0605013163ea2f3425ec4ed4489e64d03280 (patch)
treef85946bd1c6b36b377997373fdb53f8c96e65f8e /CMakeLists.txt
parente979a88af4d4a1fea392a7620436bd37579a6a1f (diff)
downloadserenity-e35b0605013163ea2f3425ec4ed4489e64d03280.zip
Userland: Set linker max page size to 4096
Neither the kernel nor LibELF support loading libraries with larger PT_LOAD alignment. The default on x86 is 4096 while it's 2MiB on x86_64. This changes the alignment to 4096 on all platforms.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt2
1 files changed, 1 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 70bfff6059..992292e470 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -182,7 +182,7 @@ endforeach()
set(CMAKE_INSTALL_NAME_TOOL "")
set(CMAKE_SHARED_LIBRARY_SUFFIX ".so")
set(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "-shared -Wl,--hash-style=gnu,-z,relro,-z,now,-z,noexecstack")
-set(CMAKE_CXX_LINK_FLAGS "-Wl,--hash-style=gnu,-z,relro,-z,now,-z,noexecstack")
+set(CMAKE_CXX_LINK_FLAGS "-Wl,--hash-style=gnu,-z,relro,-z,now,-z,noexecstack,-z,max-page-size=0x1000")
# We disable it completely because it makes cmake very spammy.
# This will need to be revisited when the Loader supports RPATH/RUN_PATH.