$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