aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2019-05-08 14:28:57 -0400
committerfanquake <fanquake@gmail.com>2019-06-07 10:07:36 +0200
commit05fb9f7fbb270638f8ff4990fe68037e1a52a85f (patch)
tree69d0144888fa9c10a0213cca858ae2bf463e3337
parent6cf81b01b48e871a35072dd08e7735c3ba42528c (diff)
downloadbitcoin-05fb9f7fbb270638f8ff4990fe68037e1a52a85f.tar.xz
build with -fstack-reuse=none
Github-Pull: #15983 Rebased-From: faf38bc056e523485520f98f3f725c583a3b89bf
-rw-r--r--configure.ac4
1 files changed, 4 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 9cc01a4028..8449617085 100644
--- a/configure.ac
+++ b/configure.ac
@@ -693,6 +693,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"])