Skip to content

Commit aa32c01

Browse files
committed
cmake: only use _FORTIFY_SOURCE with hardening
1 parent 79598bf commit aa32c01

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

cmake/DaemonFlags.cmake

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -315,17 +315,15 @@ else()
315315
endif()
316316

317317
# Hardening.
318-
if (USE_HARDENING OR NOT MINGW)
318+
if (USE_HARDENING)
319319
# MinGW with _FORTIFY_SOURCE and without -fstack-protector
320320
# causes unsatisfied dependency on libssp.
321321
# https://github.com/msys2/MINGW-packages/issues/5868
322322
set_c_cxx_flag("-D_FORTIFY_SOURCE=2" RELEASE)
323323
set_c_cxx_flag("-D_FORTIFY_SOURCE=2" RELWITHDEBINFO)
324324
set_c_cxx_flag("-D_FORTIFY_SOURCE=2" MINSIZEREL)
325325
# Don't set _FORTIFY_SOURCE in debug builds.
326-
endif()
327326

328-
if (USE_HARDENING)
329327
# PNaCl accepts the flags but does not define __stack_chk_guard and __stack_chk_fail.
330328
if (NOT NACL)
331329
try_c_cxx_flag(FSTACK_PROTECTOR_STRONG "-fstack-protector-strong")

0 commit comments

Comments
 (0)