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
This commit is contained in:
Brent Cook 2015-06-13 22:26:58 -05:00
parent bc7b93470f
commit b091d23685
2 changed files with 8 additions and 1 deletions

View File

@ -4,3 +4,8 @@ set -e
./update.sh
mkdir -p m4
autoreconf -i -f
# Patch libtool 2.4.2 to pass -fstack-protector as a linker argument
sed 's/-fuse-linker-plugin)/-fuse-linker-plugin|-fstack-protector*)/' \
ltmain.sh > ltmain.sh.fixed
mv -f ltmain.sh.fixed ltmain.sh

View File

@ -94,9 +94,11 @@ AC_DEFUN([CHECK_C_HARDENING_OPTIONS], [
AC_MSG_WARN([compiler does not appear to support stack protection])
)
)
AS_IF([test "x$HOST_OS" = "xwin"], [
AC_SEARCH_LIBS([__stack_chk_guard],[ssp])
])
])
])
# Restore CC, LD
CC="$saved_CC"