aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcoFalke <[email protected]>2019-05-08 14:28:57 -0400
committerMarcoFalke <[email protected]>2019-05-15 15:41:28 -0400
commitfaf38bc056e523485520f98f3f725c583a3b89bf (patch)
treed70062e09acd163e654c3fdce6e05fd8eee7aff3
parentMerge #15971: validation: Add compile-time checking for negative locking requ... (diff)
downloaddiscoin-faf38bc056e523485520f98f3f725c583a3b89bf.tar.xz
discoin-faf38bc056e523485520f98f3f725c583a3b89bf.zip
build with -fstack-reuse=none
-rw-r--r--configure.ac4
1 files changed, 4 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 854d6b1d4..d57e3b919 100644
--- a/configure.ac
+++ b/configure.ac
@@ -734,6 +734,10 @@ if test x$TARGET_OS != xwindows; then
AX_CHECK_COMPILE_FLAG([-fPIC],[PIC_FLAGS="-fPIC"])
fi
+# All versions of gcc that we commonly use for building are subject to bug
+# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90348. To work around that, set
+# -fstack-reuse=none for all gcc builds. (Only gcc understands this flag)
+AX_CHECK_COMPILE_FLAG([-fstack-reuse=none],[HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -fstack-reuse=none"])
if test x$use_hardening != xno; then
use_hardening=yes
AX_CHECK_COMPILE_FLAG([-Wstack-protector],[HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -Wstack-protector"])