diff options
| author | Vicente Olivert Riera <Vincent.Riera@imgtec.com> | 2015-10-30 16:05:35 +0000 |
|---|---|---|
| committer | Peter Korsgaard <peter@korsgaard.com> | 2015-10-31 10:02:08 +0100 |
| commit | 40c2b4e95297761aa7c40d7c814b3e209bb4ce55 (patch) | |
| tree | c035e76ec0941cdf8ac2c0c3c777f2f7a080a18a /package/sudo/0003-Preserve-LDFLAGS-when-checking-for-stack-protector.patch | |
| parent | d5f36eb63d7b3dd0104b8ce3458b8d0b54dd883f (diff) | |
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>
Diffstat (limited to 'package/sudo/0003-Preserve-LDFLAGS-when-checking-for-stack-protector.patch')
| -rw-r--r-- | package/sudo/0003-Preserve-LDFLAGS-when-checking-for-stack-protector.patch | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/package/sudo/0003-Preserve-LDFLAGS-when-checking-for-stack-protector.patch b/package/sudo/0003-Preserve-LDFLAGS-when-checking-for-stack-protector.patch new file mode 100644 index 000000000..6ba3bb37c --- /dev/null +++ b/package/sudo/0003-Preserve-LDFLAGS-when-checking-for-stack-protector.patch @@ -0,0 +1,81 @@ +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';]]) + |
