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/DynamicLoader | |
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/DynamicLoader')
-rw-r--r-- | Userland/DynamicLoader/CMakeLists.txt | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/DynamicLoader/CMakeLists.txt b/Userland/DynamicLoader/CMakeLists.txt index 71f91e9008..842ee218b7 100644 --- a/Userland/DynamicLoader/CMakeLists.txt +++ b/Userland/DynamicLoader/CMakeLists.txt @@ -33,8 +33,8 @@ set(SOURCES ${LOADER_SOURCES} ${AK_SOURCES} ${ELF_SOURCES} ${LIBC_SOURCES1} ${LI set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti -nostdlib -pie -fpic -DNO_TLS") -set_source_files_properties (../Libraries/LibC/ssp.cpp PROPERTIES COMPILE_FLAGS - "-fno-stack-protector") +set_source_files_properties(../Libraries/LibC/ssp.cpp PROPERTIES COMPILE_FLAGS "-fno-stack-protector") +set_source_files_properties(../Libraries/LibC/ssp_nonshared.cpp PROPERTIES COMPILE_FLAGS "-fno-stack-protector") # Prevent GCC from removing null checks by marking the `FILE*` argument non-null set_source_files_properties(../Libraries/LibC/stdio.cpp PROPERTIES COMPILE_FLAGS "-fno-builtin-fputc -fno-builtin-fputs -fno-builtin-fwrite") |