Files
shredos.x86_64/package/sudo/0003-Preserve-LDFLAGS-when-checking-for-stack-protector.patch
Vicente Olivert Riera 40c2b4e952 sudo: fix -fstack-protector detection
Backport a patch series from upstream to fix the configure check for
-fstack-protector.

Fixes:
  http://autobuild.buildroot.net/results/bdd3e5352aa283b96717202a794f9762d15cc736/

Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2015-10-31 10:02:08 +01:00

82 lines
2.7 KiB
Diff

Preserve LDFLAGS when checking for stack protector as they may include
rpath settings to allow the stack protector lib to be found. Avoidusing
existing CFLAGS since we don't want the compiler to optimize away the
stack variable.
Backported from upstream:
http://www.sudo.ws/repos/sudo/rev/e6bc59225c06
Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
# HG changeset patch
# User Todd C. Miller <Todd.Miller@courtesan.com>
# Date 1446149181 21600
# Node ID e6bc59225c06c5d45580197519a73e3feea14cbd
# Parent 4ade5d1249f483c4dd6c579c70b327791094afe8
Preserve LDFLAGS when checking for stack protector as they may include
rpath settings to allow the stack protector lib to be found. Avoid
using existing CFLAGS since we don't want the compiler to optimize
away the stack variable.
diff -r 4ade5d1249f4 -r e6bc59225c06 configure
--- a/configure Thu Oct 29 10:51:09 2015 -0600
+++ b/configure Thu Oct 29 14:06:21 2015 -0600
@@ -23926,7 +23926,7 @@
_CFLAGS="$CFLAGS"
_LDFLAGS="$LDFLAGS"
CFLAGS="-fstack-protector-strong"
- LDFLAGS="-fstack-protector-strong"
+ LDFLAGS="$_LDFLAGS -fstack-protector-strong"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -23947,7 +23947,7 @@
else
CFLAGS="-fstack-protector-all"
- LDFLAGS="-fstack-protector-all"
+ LDFLAGS="$_LDFLAGS -fstack-protector-all"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -23968,7 +23968,7 @@
else
CFLAGS="-fstack-protector"
- LDFLAGS="-fstack-protector"
+ LDFLAGS="$_LDFLAGS -fstack-protector"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
diff -r 4ade5d1249f4 -r e6bc59225c06 configure.ac
--- a/configure.ac Thu Oct 29 10:51:09 2015 -0600
+++ b/configure.ac Thu Oct 29 14:06:21 2015 -0600
@@ -3985,7 +3985,7 @@
_CFLAGS="$CFLAGS"
_LDFLAGS="$LDFLAGS"
CFLAGS="-fstack-protector-strong"
- LDFLAGS="-fstack-protector-strong"
+ LDFLAGS="$_LDFLAGS -fstack-protector-strong"
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],
[[char buf[1024]; buf[1023] = '\0';]])
@@ -3993,7 +3993,7 @@
sudo_cv_var_stack_protector="-fstack-protector-strong"
], [
CFLAGS="-fstack-protector-all"
- LDFLAGS="-fstack-protector-all"
+ LDFLAGS="$_LDFLAGS -fstack-protector-all"
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],
[[char buf[1024]; buf[1023] = '\0';]])
@@ -4001,7 +4001,7 @@
sudo_cv_var_stack_protector="-fstack-protector-all"
], [
CFLAGS="-fstack-protector"
- LDFLAGS="-fstack-protector"
+ LDFLAGS="$_LDFLAGS -fstack-protector"
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],
[[char buf[1024]; buf[1023] = '\0';]])