mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-10 03:47:29 -03:00
build: more robustly check for fcf-protection support
When using Clang 7, we may end up trying to use the flag when it won't work properly, which can lead to confusing errors. i.e: ```bash /usr/bin/ld: error: ... <corrupt x86 feature size: 0x8> ``` Use CHECK_LINK_FLAG & --fatal-warnings to ensure we wont use the flag in this case.
This commit is contained in:
parent
f1dbf92ff0
commit
e9189a750b
1 changed files with 4 additions and 1 deletions
|
@ -819,7 +819,10 @@ if test x$use_hardening != xno; then
|
|||
AX_CHECK_COMPILE_FLAG([-Wstack-protector],[HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -Wstack-protector"])
|
||||
AX_CHECK_COMPILE_FLAG([-fstack-protector-all],[HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -fstack-protector-all"])
|
||||
|
||||
AX_CHECK_COMPILE_FLAG([-fcf-protection=full],[HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -fcf-protection=full"])
|
||||
dnl -fcf-protection used with Clang 7 causes ld to emit warnings:
|
||||
dnl ld: error: ... <corrupt x86 feature size: 0x8>
|
||||
dnl Use CHECK_LINK_FLAG & --fatal-warnings to ensure we wont use the flag in this case.
|
||||
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.
|
||||
dnl We use the test case from https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90458
|
||||
|
|
Loading…
Reference in a new issue