configure.ac: link test for -fstack-protector-all
There are (broken) compilers out there that accept -fstack-protector-* parameters, but do not provide the needed ssp library. As a result, build does not fail, but link does. Use the local check_link_flag autoconf function to correctly test for SSP availability. Required for the Imagination Technologies Codescape IMG MIPS toolchain, version 2015.10 (and who knows what else). Fixes #744.
This commit is contained in:
+1
-1
@@ -93,7 +93,7 @@ AS_IF([test x"$hardening" != x"no"], [
|
|||||||
# This one will likely succeed, even on platforms where it does nothing.
|
# This one will likely succeed, even on platforms where it does nothing.
|
||||||
check_cc_cxx_flag([-D_FORTIFY_SOURCE=2], [HARDEN_CFLAGS="$HARDEN_CFLAGS -D_FORTIFY_SOURCE=2"])
|
check_cc_cxx_flag([-D_FORTIFY_SOURCE=2], [HARDEN_CFLAGS="$HARDEN_CFLAGS -D_FORTIFY_SOURCE=2"])
|
||||||
|
|
||||||
check_cc_cxx_flag([-fstack-protector-all],
|
check_link_flag([-fstack-protector-all],
|
||||||
[HARDEN_CFLAGS="$HARDEN_CFLAGS -fstack-protector-all"
|
[HARDEN_CFLAGS="$HARDEN_CFLAGS -fstack-protector-all"
|
||||||
check_cc_cxx_flag([-Wstack-protector], [HARDEN_CFLAGS="$HARDEN_CFLAGS -Wstack-protector"],
|
check_cc_cxx_flag([-Wstack-protector], [HARDEN_CFLAGS="$HARDEN_CFLAGS -Wstack-protector"],
|
||||||
[], [-fstack-protector-all])
|
[], [-fstack-protector-all])
|
||||||
|
|||||||
Reference in New Issue
Block a user