Skip to content

Commit d52da78

Browse files
committed
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 <[email protected]>
1 parent d325910 commit d52da78

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

winsup/configure.ac

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,11 @@ AC_CHECK_LIB([sframe], [sframe_decode], [BFD_LIBS="${BFD_LIBS} -lsframe"])
129129
AC_CHECK_LIB([zstd], [ZSTD_isError], [BFD_LIBS="${BFD_LIBS} -lzstd"])
130130
AC_SUBST([BFD_LIBS])
131131

132+
AC_CHECK_LIB([sframe], [sframe_decode],
133+
AC_MSG_NOTICE([Detected libsframe; Assuming that libbfd depends on it]), [true])
134+
135+
AM_CONDITIONAL(HAVE_LIBSFRAME, [test "x$ac_cv_lib_sframe_sframe_decode" = "xyes"])
136+
132137
AC_CONFIG_FILES([
133138
Makefile
134139
cygwin/Makefile

winsup/utils/Makefile.am

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,10 @@ profiler_CXXFLAGS = -I$(srcdir) -idirafter ${top_srcdir}/cygwin/local_includes -
8888
profiler_LDADD = $(LDADD) -lntdll
8989
cygps_LDADD = $(LDADD) -lpsapi -lntdll
9090

91+
if HAVE_LIBSFRAME
92+
dumper_LDADD += -lsframe
93+
endif
94+
9195
if CROSS_BOOTSTRAP
9296
SUBDIRS = mingw
9397
endif

0 commit comments

Comments
 (0)