Skip to content

Commit

Permalink
dumper: avoid linker problem when libbfd depends on libsframe
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
dscho committed Sep 6, 2023
1 parent d325910 commit d52da78
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions winsup/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,11 @@ AC_CHECK_LIB([sframe], [sframe_decode], [BFD_LIBS="${BFD_LIBS} -lsframe"])
AC_CHECK_LIB([zstd], [ZSTD_isError], [BFD_LIBS="${BFD_LIBS} -lzstd"])
AC_SUBST([BFD_LIBS])

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([
Makefile
cygwin/Makefile
Expand Down
4 changes: 4 additions & 0 deletions winsup/utils/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ profiler_CXXFLAGS = -I$(srcdir) -idirafter ${top_srcdir}/cygwin/local_includes -
profiler_LDADD = $(LDADD) -lntdll
cygps_LDADD = $(LDADD) -lpsapi -lntdll

if HAVE_LIBSFRAME
dumper_LDADD += -lsframe
endif

if CROSS_BOOTSTRAP
SUBDIRS = mingw
endif

0 comments on commit d52da78

Please sign in to comment.