⛏️ index : buildtools.git

author Niels Sascha Reedijk <niels.reedijk@gmail.com> 2023-09-24 14:14:17.0 +01:00:00
committer waddlesplash <waddlesplash@gmail.com> 2023-09-25 15:16:10.0 +00:00:00
commit
752d29d62445fdf8b77a75cdc91cf1f749841234 [patch]
tree
b63f6ad875cfc446175702656c4b4b79ddeaeb9d
parent
f7a513f6367dbb570ba0a71a4bbbfcbc217b0201
download
752d29d62445fdf8b77a75cdc91cf1f749841234.tar.gz

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(+)

diff --git a/gcc/libbacktrace/configure b/gcc/libbacktrace/configure
index 6af2c04..dc1bf68 100755
--- a/gcc/libbacktrace/configure
+++ a/gcc/libbacktrace/configure
@@ -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"
diff --git a/gcc/libbacktrace/configure.ac b/gcc/libbacktrace/configure.ac
index 39e6bf4..0323418 100644
--- a/gcc/libbacktrace/configure.ac
+++ a/gcc/libbacktrace/configure.ac
@@ -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])