From: Fabrice Fontaine Date: Tue, 4 Dec 2018 07:40:05 +0000 (+0100) Subject: configure.ac: fix build without stack-protector X-Git-Tag: lxc-3.1.0~3^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3aa7271157d3c815a4426c1f8eaea2f3b6dafa6a;p=thirdparty%2Flxc.git configure.ac: fix build without stack-protector Compiler based hardening (including -fstack-protector-strong) are enabled since version 3.0.3 and https://github.com/lxc/lxc/commit/2268c27754152aa538db2c9e3753d72d19bcd17a However, some compilers could missed the needed library (-lssp or -lssp_nonshared) at linking step so use ax_check_link_flag instead of ax_check_compile_flag Fixes: - http://autobuild.buildroot.org/results/0b90e7dca2984652842832a41abad93ac49a9b86 Signed-off-by: Fabrice Fontaine --- diff --git a/configure.ac b/configure.ac index 9a9adac32..032e4cfd2 100644 --- a/configure.ac +++ b/configure.ac @@ -696,7 +696,7 @@ AX_CHECK_COMPILE_FLAG([-Wcast-align], [CFLAGS="$CFLAGS -Wcast-align"],,[-Werror] AX_CHECK_COMPILE_FLAG([-Wstrict-prototypes], [CFLAGS="$CFLAGS -Wstrict-prototypes"],,[-Werror]) AX_CHECK_COMPILE_FLAG([-fno-strict-aliasing], [CFLAGS="$CFLAGS -fno-strict-aliasing"],,[-Werror]) AX_CHECK_COMPILE_FLAG([-fstack-clash-protection], [CFLAGS="$CFLAGS -fstack-clash-protection"],,[-Werror]) -AX_CHECK_COMPILE_FLAG([-fstack-protector-strong], [CFLAGS="$CFLAGS -fstack-protector-strong"],,[-Werror]) +AX_CHECK_LINK_FLAG([-fstack-protector-strong], [CFLAGS="$CFLAGS -fstack-protector-strong"],,[-Werror]) AX_CHECK_COMPILE_FLAG([-g], [CFLAGS="$CFLAGS -g"],,[-Werror]) AX_CHECK_COMPILE_FLAG([--mcet -fcf-protection], [CFLAGS="$CFLAGS --mcet -fcf-protection"],,[-Werror]) AX_CHECK_COMPILE_FLAG([-Werror=implicit-function-declaration], [CFLAGS="$CFLAGS -Werror=implicit-function-declaration"],,[-Werror])