Skip to content

Commit ad067e0

Browse files
authored
Merge pull request #2232 from barton2526/fstack
build: Use -fstack-reuse=none
2 parents 4fbfe84 + c06743b commit ad067e0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

configure.ac

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -638,6 +638,10 @@ if test x$TARGET_OS != xwindows; then
638638
AX_CHECK_COMPILE_FLAG([-fPIC],[PIC_FLAGS="-fPIC"])
639639
fi
640640

641+
# All versions of gcc that we commonly use for building are subject to bug
642+
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90348. To work around that, set
643+
# -fstack-reuse=none for all gcc builds. (Only gcc understands this flag)
644+
AX_CHECK_COMPILE_FLAG([-fstack-reuse=none],[HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -fstack-reuse=none"])
641645
if test x$use_hardening != xno; then
642646
AX_CHECK_COMPILE_FLAG([-Wstack-protector],[HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -Wstack-protector"])
643647
AX_CHECK_COMPILE_FLAG([-fstack-protector-all],[HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -fstack-protector-all"])

0 commit comments

Comments
 (0)