1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 13:07:46 +00:00

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.
This commit is contained in:
Tim Schumacher 2022-10-25 23:53:07 +02:00 committed by Linus Groh
parent 7834e26ddb
commit 678db534ff
7 changed files with 45 additions and 21 deletions

View file

@ -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)