GCC: disable dl_iterate_phdr in libbacktrace
On Haiku, this is now available as part of libbsd. The build
system for libbacktrace does not know about this library. In a regular
build this does not matter, as the test in the configure script will
fail to compile. However, when libbacktrace is built as a target
library, only the existence of the method in link.h is tested, which
will succeed.
This lead to libgfortan.so having undefined references.
See: https://github.com/haikuports/haikuports/issues/9241
Change-Id: I576d7802d43e11787b3bc1d09c89a42bf982dc3b
Reviewed-on: https://review.haiku-os.org/c/buildtools/+/6950
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Diff
gcc/libbacktrace/configure | 5 +++++
gcc/libbacktrace/configure.ac | 5 +++++
2 files changed, 10 insertions(+)
@@ -13331,6 +13331,11 @@
have_dl_iterate_phdr=no
fi
rm -f conftest*
# On Haiku, this function only exists when linking against libbsd. This
# may be enabled in the future, but for now, disable support.
case "${host}" in
*-*-haiku*) have_dl_iterate_phdr=no ;;
esac
else
ac_fn_c_check_func "$LINENO" "dl_iterate_phdr" "ac_cv_func_dl_iterate_phdr"
@@ -347,6 +347,11 @@
# When built as a GCC target library, we can't do a link test.
AC_EGREP_HEADER([dl_iterate_phdr], [$link_h], [have_dl_iterate_phdr=yes],
[have_dl_iterate_phdr=no])
# On Haiku, this function only exists when linking against libbsd. This
# may be enabled in the future, but for now, disable support.
case "${host}" in
*-*-haiku*) have_dl_iterate_phdr=no ;;
esac
else
AC_CHECK_FUNC([dl_iterate_phdr], [have_dl_iterate_phdr=yes],
[have_dl_iterate_phdr=no])