diff options
| author | Brent Cook <bcook@openbsd.org> | 2015-06-13 22:26:58 -0500 |
|---|---|---|
| committer | Brent Cook <bcook@openbsd.org> | 2015-06-13 22:26:58 -0500 |
| commit | b091d23685dd59185b0b8e8e23786a452f622b16 (patch) | |
| tree | c61a0ca3a13bbee2fdcc68a62ce3f9058fc97406 | |
| parent | bc7b93470f694eee13cd3d9012caa4caefaeb9bc (diff) | |
| download | portable-b091d23685dd59185b0b8e8e23786a452f622b16.tar.gz portable-b091d23685dd59185b0b8e8e23786a452f622b16.tar.bz2 portable-b091d23685dd59185b0b8e8e23786a452f622b16.zip | |
fix libtool 2.4.2 stack-protector flag handling
Teach libtool 2.4.2 how to pass -fstack-protector* to the linker so
libssp is properly linked in on some toolchains. See upstream patch:
https://github.com/instantinfrastructure/poky-daisy/blob/master/meta/recipes-devtools/libtool/libtool/respect-fstack-protector.patch
Thanks to kinichiro inoguchi
| -rwxr-xr-x | autogen.sh | 5 | ||||
| -rw-r--r-- | m4/check-hardening-options.m4 | 4 |
2 files changed, 8 insertions, 1 deletions
| @@ -4,3 +4,8 @@ set -e | |||
| 4 | ./update.sh | 4 | ./update.sh |
| 5 | mkdir -p m4 | 5 | mkdir -p m4 |
| 6 | autoreconf -i -f | 6 | autoreconf -i -f |
| 7 | |||
| 8 | # Patch libtool 2.4.2 to pass -fstack-protector as a linker argument | ||
| 9 | sed 's/-fuse-linker-plugin)/-fuse-linker-plugin|-fstack-protector*)/' \ | ||
| 10 | ltmain.sh > ltmain.sh.fixed | ||
| 11 | mv -f ltmain.sh.fixed ltmain.sh | ||
diff --git a/m4/check-hardening-options.m4 b/m4/check-hardening-options.m4 index 544d283..3ffdb1a 100644 --- a/m4/check-hardening-options.m4 +++ b/m4/check-hardening-options.m4 | |||
| @@ -94,7 +94,9 @@ AC_DEFUN([CHECK_C_HARDENING_OPTIONS], [ | |||
| 94 | AC_MSG_WARN([compiler does not appear to support stack protection]) | 94 | AC_MSG_WARN([compiler does not appear to support stack protection]) |
| 95 | ) | 95 | ) |
| 96 | ) | 96 | ) |
| 97 | AC_SEARCH_LIBS([__stack_chk_guard],[ssp]) | 97 | AS_IF([test "x$HOST_OS" = "xwin"], [ |
| 98 | AC_SEARCH_LIBS([__stack_chk_guard],[ssp]) | ||
| 99 | ]) | ||
| 98 | ]) | 100 | ]) |
| 99 | ]) | 101 | ]) |
| 100 | 102 | ||
