Meta: Enable glibc fortify checks on Linux

Define _FORTIFY_SOURCE=3 for Linux builds so glibc can use dynamic
object size checks around fortified libc calls.
This commit is contained in:
Andreas Kling 2026-06-10 00:23:49 +02:00 committed by Andreas Kling
parent 65eddc925c
commit ec3ea7ed25

View file

@ -198,6 +198,7 @@ if(CMAKE_CXX_LINK_PIE_SUPPORTED)
endif()
if (LINUX)
add_cxx_compile_definitions(_FORTIFY_SOURCE=3)
add_cxx_compile_definitions(_FILE_OFFSET_BITS=64)
add_cxx_compile_options(-fstack-clash-protection)
add_cxx_link_option_if_supported(LINKER:-z,relro)