mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-05-05 17:30:59 +02:00
build: don't try and use -fstack-clash-protection on Windows
This has never worked with any of the mingw-w64 compilers we use, and the -O0 is causing issues for builders applying spectre mitigations. Recent discussion on https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90458 also indicates that this should just not be used on Windows.
This commit is contained in:
parent
b972913c33
commit
7b3434f800
15
configure.ac
15
configure.ac
@ -866,11 +866,16 @@ if test x$use_hardening != xno; then
|
|||||||
dnl Use CHECK_LINK_FLAG & --fatal-warnings to ensure we won't use the flag in this case.
|
dnl Use CHECK_LINK_FLAG & --fatal-warnings to ensure we won't use the flag in this case.
|
||||||
AX_CHECK_LINK_FLAG([-fcf-protection=full],[HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -fcf-protection=full"],, [[$LDFLAG_WERROR]])
|
AX_CHECK_LINK_FLAG([-fcf-protection=full],[HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -fcf-protection=full"],, [[$LDFLAG_WERROR]])
|
||||||
|
|
||||||
dnl stack-clash-protection does not work properly when building for Windows.
|
case $host in
|
||||||
dnl We use the test case from https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90458
|
*mingw*)
|
||||||
dnl to determine if it can be enabled.
|
dnl stack-clash-protection doesn't currently work, and likely should just be skipped for Windows.
|
||||||
AX_CHECK_COMPILE_FLAG([-fstack-clash-protection],[HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -fstack-clash-protection"],[],["-O0"],
|
dnl See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90458 for more details.
|
||||||
[AC_LANG_SOURCE([[class D {public: unsigned char buf[32768];}; int main() {D d; return 0;}]])])
|
;;
|
||||||
|
*)
|
||||||
|
AX_CHECK_COMPILE_FLAG([-fstack-clash-protection],[HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -fstack-clash-protection"])
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
|
||||||
dnl When enable_debug is yes, all optimizations are disabled.
|
dnl When enable_debug is yes, all optimizations are disabled.
|
||||||
dnl However, FORTIFY_SOURCE requires that there is some level of optimization, otherwise it does nothing and just creates a compiler warning.
|
dnl However, FORTIFY_SOURCE requires that there is some level of optimization, otherwise it does nothing and just creates a compiler warning.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user