dumper: avoid linker problem when `libbfd` depends on `libsframe`

A recent binutils version introduced `libsframe` and made it a
dependency of `libbfd`. This caused a linker problem in the MSYS2
project, and once Cygwin upgrades to that binutils version it would
cause the same problems there.

Let's preemptively detect the presence of `libsframe` and if detected,
link to it in addition to `libbfd`.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
Johannes Schindelin 2023-02-01 15:08:16 +01:00 committed by Corinna Vinschen
parent 3a4c740f59
commit 89f930a964
2 changed files with 9 additions and 0 deletions

View File

@ -118,6 +118,11 @@ AC_ARG_ENABLE([dumper],
AM_CONDITIONAL(BUILD_DUMPER, [test "x$build_dumper" = "xyes"]) AM_CONDITIONAL(BUILD_DUMPER, [test "x$build_dumper" = "xyes"])
AC_CHECK_LIB([sframe], [sframe_decode],
AC_MSG_NOTICE([Detected libsframe; Assuming that libbfd depends on it]), [true])
AM_CONDITIONAL(HAVE_LIBSFRAME, [test "x$ac_cv_lib_sframe_sframe_decode" = "xyes"])
AC_CONFIG_FILES([ AC_CONFIG_FILES([
Makefile Makefile
cygwin/Makefile cygwin/Makefile

View File

@ -89,6 +89,10 @@ profiler_LDADD = $(LDADD) -lntdll
cygps_LDADD = $(LDADD) -lpsapi -lntdll cygps_LDADD = $(LDADD) -lpsapi -lntdll
newgrp_LDADD = $(LDADD) -luserenv newgrp_LDADD = $(LDADD) -luserenv
if HAVE_LIBSFRAME
dumper_LDADD += -lsframe
endif
if CROSS_BOOTSTRAP if CROSS_BOOTSTRAP
SUBDIRS = mingw SUBDIRS = mingw
endif endif