public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin/main] dumper: avoid linker problem when `libbfd` depends on `libsframe`
@ 2023-02-01 19:01 Corinna Vinschen
  0 siblings, 0 replies; only message in thread
From: Corinna Vinschen @ 2023-02-01 19:01 UTC (permalink / raw)
  To: cygwin-cvs

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=89f930a9649ed9e419c7d8b2372c684313069a5b

commit 89f930a9649ed9e419c7d8b2372c684313069a5b
Author:     Johannes Schindelin <johannes.schindelin@gmx.de>
AuthorDate: Wed Feb 1 15:08:16 2023 +0100
Commit:     Corinna Vinschen <corinna@vinschen.de>
CommitDate: Wed Feb 1 20:00:01 2023 +0100

    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>

Diff:
---
 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 b155cabe4374..76baf0a7da62 100644
--- a/winsup/configure.ac
+++ b/winsup/configure.ac
@@ -118,6 +118,11 @@ AC_ARG_ENABLE([dumper],
 
 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([
     Makefile
     cygwin/Makefile
diff --git a/winsup/utils/Makefile.am b/winsup/utils/Makefile.am
index d4d56386f72e..f59cf9f50c75 100644
--- a/winsup/utils/Makefile.am
+++ b/winsup/utils/Makefile.am
@@ -89,6 +89,10 @@ profiler_LDADD = $(LDADD) -lntdll
 cygps_LDADD = $(LDADD) -lpsapi -lntdll
 newgrp_LDADD = $(LDADD) -luserenv
 
+if HAVE_LIBSFRAME
+dumper_LDADD += -lsframe
+endif
+
 if CROSS_BOOTSTRAP
 SUBDIRS = mingw
 endif

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-02-01 19:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-01 19:01 [newlib-cygwin/main] dumper: avoid linker problem when `libbfd` depends on `libsframe` Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).