MSYS2-packages/msys2-runtime-3.4/0038-dumper-avoid-linker-problem-when-libbfd-depends-on-l.patch
Christoph Reiter 14e5524bed Add msys2-runtime-3.4
This will be the msys2-runtime variant that still works on Win7.
2024-03-15 17:55:50 +01:00

52 lines
1.8 KiB
Diff

From 58e01d2be06adfd9fb70615bf50750635a880a26 Mon Sep 17 00:00:00 2001
From: Johannes Schindelin <johannes.schindelin@gmx.de>
Date: Wed, 1 Feb 2023 15:08:16 +0100
Subject: [PATCH 38/N] 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>
---
winsup/configure.ac | 5 +++++
winsup/utils/Makefile.am | 4 ++++
2 files changed, 9 insertions(+)
diff --git a/winsup/configure.ac b/winsup/configure.ac
index e55e19a..59b77fe 100644
--- a/winsup/configure.ac
+++ b/winsup/configure.ac
@@ -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
diff --git a/winsup/utils/Makefile.am b/winsup/utils/Makefile.am
index fa6499d..f10335e 100644
--- a/winsup/utils/Makefile.am
+++ b/winsup/utils/Makefile.am
@@ -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