diff options
author | Tim Schumacher <timschumi@gmx.de> | 2022-10-25 23:53:07 +0200 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-11-01 14:49:09 +0000 |
commit | 678db534ff772cb9d35d7edf10af8a9f89ad3638 (patch) | |
tree | 765539a01d0cb93685e08d54dc67476bb9faf1ed /Userland/Libraries/LibSanitizer | |
parent | 7834e26ddb6f0205b8a4688b5df339f50803cc48 (diff) | |
download | serenity-678db534ff772cb9d35d7edf10af8a9f89ad3638.zip |
LibC: Properly implement stack protectors
The shared parts are now firmly compiled into LibC instead of being
defined as a static library and then being copied over manually.
The non-shared ("local") parts are kept as a static library that is
linked into each binary on demand.
This finally allows us to support linking with the -fstack-protector
flag, which now replaces the `ssp` target being linked into each binary
accidentally via CMake.
Diffstat (limited to 'Userland/Libraries/LibSanitizer')
-rw-r--r-- | Userland/Libraries/LibSanitizer/CMakeLists.txt | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Userland/Libraries/LibSanitizer/CMakeLists.txt b/Userland/Libraries/LibSanitizer/CMakeLists.txt index cf13d1f531..988e8b2971 100644 --- a/Userland/Libraries/LibSanitizer/CMakeLists.txt +++ b/Userland/Libraries/LibSanitizer/CMakeLists.txt @@ -1,10 +1,11 @@ set(SOURCES UBSanitizer.cpp ../LibC/ssp.cpp + ../LibC/ssp_nonshared.cpp ) -set_source_files_properties (../LibC/ssp.cpp PROPERTIES COMPILE_FLAGS - "-fno-stack-protector") +set_source_files_properties(../LibC/ssp.cpp PROPERTIES COMPILE_FLAGS "-fno-stack-protector") +set_source_files_properties(../LibC/ssp_nonshared.cpp PROPERTIES COMPILE_FLAGS "-fno-stack-protector") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -nostdlib") serenity_libc(LibUBSanitizer ubsan) |