build with -fstack-reuse=none

Github-Pull: #15983
Rebased-From: faf38bc056
This commit is contained in:
MarcoFalke 2019-05-08 14:28:57 -04:00 committed by fanquake
parent 6cf81b01b4
commit 05fb9f7fbb
No known key found for this signature in database
GPG key ID: 2EEB9F5CC09526C1

View file

@ -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"])