mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-22 23:26:15 +00:00
Changed: Display more warnings if using -fstack-protector
This commit is contained in:
parent
8c4e14e20b
commit
b73cf7ac22
1 changed files with 8 additions and 0 deletions
|
@ -939,6 +939,14 @@ MACRO(NL_SETUP_BUILD)
|
|||
# hardening
|
||||
ADD_PLATFORM_FLAGS("-fstack-protector --param=ssp-buffer-size=4")
|
||||
|
||||
# If -fstack-protector or -fstack-protector-all enabled, enable too new warnings and fix possible link problems
|
||||
IF(WITH_WARNINGS)
|
||||
ADD_PLATFORM_FLAGS("-Wstack-protector")
|
||||
ENDIF()
|
||||
|
||||
# Fix undefined reference to `__stack_chk_fail' error
|
||||
ADD_PLATFORM_LINKFLAGS("-lc")
|
||||
|
||||
IF(NOT APPLE)
|
||||
ADD_PLATFORM_LINKFLAGS("-Wl,--no-undefined -Wl,--as-needed")
|
||||
ENDIF()
|
||||
|
|
Loading…
Reference in a new issue