From 7196dfdb26ca166d7d0f8dfd0a176c186556b70b Mon Sep 17 00:00:00 2001 From: Baruch Siach Date: Tue, 5 Apr 2016 15:24:55 +0300 Subject: [PATCH] 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. --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 3c9dea0..f579968 100644 --- a/configure.ac +++ b/configure.ac @@ -93,7 +93,7 @@ AS_IF([test x"$hardening" != x"no"], [ # 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([-fstack-protector-all], + check_link_flag([-fstack-protector-all], [HARDEN_CFLAGS="$HARDEN_CFLAGS -fstack-protector-all" check_cc_cxx_flag([-Wstack-protector], [HARDEN_CFLAGS="$HARDEN_CFLAGS -Wstack-protector"], [], [-fstack-protector-all])