pkgsrc/lang/gcc48/patches/patch-gcc_configure
maya 89633e9c48 gcc{48,49}: netbsd also provides libssp in libc, adjust LINK_SSP_SPEC accordingly.
already done for newer versions of gcc.

Now on netbsd all gcc packages can successfully build with -fstack-protector.

bump pkgrevision (sorry)
2017-07-10 15:55:40 +00:00

49 lines
1.6 KiB
Text

$NetBSD: patch-gcc_configure,v 1.4 2017/07/10 15:55:40 maya Exp $
Add dl_iterate_phdr detection for FreeBSD and DragonFly.
Detection for NetBSD and OpenBSD is added but commented out in case this
error handling mechanism is activated for these platforms later.
netbsd provides ssp in libc and doesn't build libssp, adjust ssp spec fragment
for it too
--- gcc/configure.orig 2014-04-28 10:05:29.000000000 +0000
+++ gcc/configure
@@ -26886,7 +26886,7 @@ else
# simply assert that glibc does provide this, which is true for all
# realistically usable GNU/Hurd configurations.
gcc_cv_libc_provides_ssp=yes;;
- *-*-darwin* | *-*-freebsd*)
+ *-*-darwin* | *-*-freebsd* | *-*-netbsd*)
ac_fn_c_check_func "$LINENO" "__stack_chk_fail" "ac_cv_func___stack_chk_fail"
if test "x$ac_cv_func___stack_chk_fail" = x""yes; then :
gcc_cv_libc_provides_ssp=yes
@@ -26895,6 +26895,7 @@ else
fi
;;
+ *-*-openbsd*) gcc_cv_libc_provides_ssp=yes ;;
*) gcc_cv_libc_provides_ssp=no ;;
esac
fi
@@ -26967,6 +26968,20 @@ case "$target" in
gcc_cv_target_dl_iterate_phdr=no
fi
;;
+ *-*-dragonfly* | *-*-freebsd*)
+ if grep dl_iterate_phdr $target_header_dir/sys/link_elf.h > /dev/null 2>&1; then
+ gcc_cv_target_dl_iterate_phdr=yes
+ else
+ gcc_cv_target_dl_iterate_phdr=no
+ fi
+ ;;
+# *-*-netbsd* | *-*-openbsd*)
+# if grep dl_iterate_phdr $target_header_dir/link_elf.h > /dev/null 2>&1; then
+# gcc_cv_target_dl_iterate_phdr=yes
+# else
+# gcc_cv_target_dl_iterate_phdr=no
+# fi
+# ;;
esac
if test x$gcc_cv_target_dl_iterate_phdr = xyes; then