summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGunnar Beutner <gbeutner@serenityos.org>2021-06-26 06:28:50 +0200
committerAndreas Kling <kling@serenityos.org>2021-06-26 11:08:52 +0200
commit787f80d11402ba6ef2f53b6fc7e5d78ad652e12b (patch)
tree567ddc3b94badb595f22dad961299c898c7707fd
parentb9f6b406519f52675639e5ea3def5c323c872b89 (diff)
downloadserenity-787f80d11402ba6ef2f53b6fc7e5d78ad652e12b.zip
Kernel: Specify -fno-pic when using -mcmodel=large
According to the gcc man page these are mutually exclusive and did in fact cause problems when trying to get the address for asm labels on x86_64.
-rw-r--r--Kernel/CMakeLists.txt6
1 files changed, 4 insertions, 2 deletions
diff --git a/Kernel/CMakeLists.txt b/Kernel/CMakeLists.txt
index 58e0a8fd12..41c919408d 100644
--- a/Kernel/CMakeLists.txt
+++ b/Kernel/CMakeLists.txt
@@ -348,7 +348,7 @@ set(SOURCES
)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unknown-warning-option -Wvla -Wnull-dereference")
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pie -fPIE -fno-rtti -ffreestanding -fbuiltin")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti -ffreestanding -fbuiltin")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mno-80387 -mno-mmx -mno-sse -mno-sse2")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-asynchronous-unwind-tables")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fstack-protector-strong")
@@ -357,7 +357,9 @@ if (NOT ${CMAKE_HOST_SYSTEM_NAME} MATCHES SerenityOS)
endif()
if ("${SERENITY_ARCH}" STREQUAL "x86_64")
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mcmodel=large -mno-red-zone -z max-page-size=0x1000")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mcmodel=large -fno-pic -mno-red-zone -z max-page-size=0x1000")
+else()
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pie -fPIE")
endif()
# Kernel Undefined Behavior Sanitizer (KUBSAN)