From 4eedbf08081b83a09c3b6263a2facab80afaeb2d Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Thu, 24 May 2012 11:04:42 -0400 Subject: [PATCH] Don't add -fstack-protector to CFLAGS if ld gets an error trying to ust it. This can happen when libssp cannot be found. --HG-- branch : 1.7 --- configure | 6 ++++-- configure.in | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/configure b/configure index fccd06234..45ea22d12 100755 --- a/configure +++ b/configure @@ -19866,7 +19866,6 @@ fi $as_echo "$ax_cv_check_cflags___fstack_protector" >&6; } if test x"$ax_cv_check_cflags___fstack_protector" = xyes; then : - CFLAGS="${CFLAGS} -fstack-protector" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the linker accepts -fstack-protector" >&5 $as_echo_n "checking whether the linker accepts -fstack-protector... " >&6; } if ${ax_cv_check_ldflags___fstack_protector+:} false; then : @@ -19898,7 +19897,10 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_ldflags___fstack_protector" >&5 $as_echo "$ax_cv_check_ldflags___fstack_protector" >&6; } if test x"$ax_cv_check_ldflags___fstack_protector" = xyes; then : - LDFLAGS="${LDFLAGS} -fstack-protector" + + CFLAGS="${CFLAGS} -fstack-protector" + LDFLAGS="${LDFLAGS} -fstack-protector" + else : fi diff --git a/configure.in b/configure.in index 83b55040b..7e6492f8c 100644 --- a/configure.in +++ b/configure.in @@ -2984,8 +2984,10 @@ dnl if test "$enable_hardening" != "no"; then AC_LANG_WERROR AX_CHECK_COMPILE_FLAG([-fstack-protector], [ - CFLAGS="${CFLAGS} -fstack-protector" - AX_CHECK_LINK_FLAG([-fstack-protector], [LDFLAGS="${LDFLAGS} -fstack-protector"]) + AX_CHECK_LINK_FLAG([-fstack-protector], [ + CFLAGS="${CFLAGS} -fstack-protector" + LDFLAGS="${LDFLAGS} -fstack-protector" + ]) ]) AX_CHECK_LINK_FLAG([-Wl,-z,relro], [LDFLAGS="${LDFLAGS} -Wl,-z,relro"]) fi -- 2.49.0