Skip to content

Commit

Permalink
Merge pull request #2793 from div72/debug-fortify
Browse files Browse the repository at this point in the history
build: omit _FORTIFY_SOURCE on debug
  • Loading branch information
jamescowens authored Feb 3, 2025
2 parents 0928f6f + fb8a575 commit 7d55388
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -716,12 +716,14 @@ if test "$use_hardening" != "no"; then
;;
esac

AX_CHECK_PREPROC_FLAG([-D_FORTIFY_SOURCE=2],[
AX_CHECK_PREPROC_FLAG([-U_FORTIFY_SOURCE],[
HARDENED_CPPFLAGS="$HARDENED_CPPFLAGS -U_FORTIFY_SOURCE"
])
HARDENED_CPPFLAGS="$HARDENED_CPPFLAGS -D_FORTIFY_SOURCE=2"
])
if test "$enable_debug" != "yes"; then
AX_CHECK_PREPROC_FLAG([-D_FORTIFY_SOURCE=2],[
AX_CHECK_PREPROC_FLAG([-U_FORTIFY_SOURCE],[
HARDENED_CPPFLAGS="$HARDENED_CPPFLAGS -U_FORTIFY_SOURCE"
])
HARDENED_CPPFLAGS="$HARDENED_CPPFLAGS -D_FORTIFY_SOURCE=2"
])
fi

AX_CHECK_LINK_FLAG([[-Wl,--dynamicbase]], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,--dynamicbase"])
AX_CHECK_LINK_FLAG([[-Wl,--nxcompat]], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,--nxcompat"])
Expand Down

0 comments on commit 7d55388

Please sign in to comment.