mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 01:09:25 +00:00
CMake: Use CMAKE_POSITION_INDEPENDENT_CODE instead of explicit -fpic
This makes CMake pass `-fpie` instead of `-fpic` to the compiler when building the Kernel and userland *executables*. This allows the compiler to make certain optimizations based on the fact that the code will be used in an executable, such as not having to emit `.localalias` symbols. This leads to a 450 KiB decrease in the size of the Kernel binary.
This commit is contained in:
@@ -167,8 +167,6 @@ add_link_options(LINKER:-z,text)
|
||||
add_link_options(LINKER:--no-allow-shlib-undefined)
|
||||
|
||||
add_compile_definitions(SANITIZE_PTRS)
|
||||
set(CMAKE_CXX_FLAGS_STATIC "${CMAKE_CXX_FLAGS} -static")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pie -fpic")
|
||||
|
||||
if (ENABLE_COMPILETIME_FORMAT_CHECK)
|
||||
add_compile_definitions(ENABLE_COMPILETIME_FORMAT_CHECK)
|
||||
|
||||
Reference in New Issue
Block a user