diff options
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac index 66437ff7ed..d57e3b9196 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"]) @@ -836,8 +840,23 @@ AC_LINK_IFELSE([AC_LANG_SOURCE([ } ])], [ - AC_DEFINE(HAVE_THREAD_LOCAL,1,[Define if thread_local is supported.]) - AC_MSG_RESULT(yes) + case $host in + *mingw*) + # mingw32's implementation of thread_local has also been shown to behave + # erroneously under concurrent usage; see: + # https://gist.github.com/jamesob/fe9a872051a88b2025b1aa37bfa98605 + AC_MSG_RESULT(no) + ;; + *darwin*) + # TODO enable thread_local on later versions of Darwin where it is + # supported (per https://stackoverflow.com/a/29929949) + AC_MSG_RESULT(no) + ;; + *) + AC_DEFINE(HAVE_THREAD_LOCAL,1,[Define if thread_local is supported.]) + AC_MSG_RESULT(yes) + ;; + esac ], [ AC_MSG_RESULT(no) |