* [PATCH] dumper: avoid linker problem when `libbfd` depends on `libsframe`
@ 2023-02-01 14:08 Johannes Schindelin
2023-02-01 17:33 ` Corinna Vinschen
0 siblings, 1 reply; 4+ messages in thread
From: Johannes Schindelin @ 2023-02-01 14:08 UTC (permalink / raw)
To: cygwin-patches
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>
---
Published-As: https://github.com/dscho/msys2-runtime/releases/tag/do-link-libsframe-if-available-v1
Fetch-It-Via: git fetch https://github.com/dscho/msys2-runtime do-link-libsframe-if-available-v1
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 b155cabe43..76baf0a7da 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 d4d56386f7..f59cf9f50c 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
base-commit: 3a4c740f59c03b4c8346fa0ee8599b1c0582ae96
--
2.39.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] dumper: avoid linker problem when `libbfd` depends on `libsframe`
2023-02-01 14:08 [PATCH] dumper: avoid linker problem when `libbfd` depends on `libsframe` Johannes Schindelin
@ 2023-02-01 17:33 ` Corinna Vinschen
2023-02-01 18:04 ` Jon Turney
0 siblings, 1 reply; 4+ messages in thread
From: Corinna Vinschen @ 2023-02-01 17:33 UTC (permalink / raw)
To: cygwin-patches; +Cc: Jon TURNEY
On Feb 1 15:08, Johannes Schindelin wrote:
> 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>
> ---
> Published-As: https://github.com/dscho/msys2-runtime/releases/tag/do-link-libsframe-if-available-v1
> Fetch-It-Via: git fetch https://github.com/dscho/msys2-runtime do-link-libsframe-if-available-v1
>
> winsup/configure.ac | 5 +++++
> winsup/utils/Makefile.am | 4 ++++
> 2 files changed, 9 insertions(+)
LGTM. Jon, what do you think?
Thanks,
Corinna
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] dumper: avoid linker problem when `libbfd` depends on `libsframe`
2023-02-01 17:33 ` Corinna Vinschen
@ 2023-02-01 18:04 ` Jon Turney
2023-02-01 19:03 ` Corinna Vinschen
0 siblings, 1 reply; 4+ messages in thread
From: Jon Turney @ 2023-02-01 18:04 UTC (permalink / raw)
To: cygwin-patches
On 01/02/2023 17:33, Corinna Vinschen wrote:
> On Feb 1 15:08, Johannes Schindelin wrote:
>> 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>
>> ---
>> Published-As: https://github.com/dscho/msys2-runtime/releases/tag/do-link-libsframe-if-available-v1
>> Fetch-It-Via: git fetch https://github.com/dscho/msys2-runtime do-link-libsframe-if-available-v1
>>
>> winsup/configure.ac | 5 +++++
>> winsup/utils/Makefile.am | 4 ++++
>> 2 files changed, 9 insertions(+)
>
> LGTM. Jon, what do you think?
Well, the real solution here is for binutils to stop pretending that
no-one links with libbfd and provide a .pc file for it, because we'll
just be in the same situation the next time it grows another dependency.
Until that happens :), this seems fine.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] dumper: avoid linker problem when `libbfd` depends on `libsframe`
2023-02-01 18:04 ` Jon Turney
@ 2023-02-01 19:03 ` Corinna Vinschen
0 siblings, 0 replies; 4+ messages in thread
From: Corinna Vinschen @ 2023-02-01 19:03 UTC (permalink / raw)
To: cygwin-patches
On Feb 1 18:04, Jon Turney wrote:
> On 01/02/2023 17:33, Corinna Vinschen wrote:
> > On Feb 1 15:08, Johannes Schindelin wrote:
> > > 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>
> > > ---
> > > Published-As: https://github.com/dscho/msys2-runtime/releases/tag/do-link-libsframe-if-available-v1
> > > Fetch-It-Via: git fetch https://github.com/dscho/msys2-runtime do-link-libsframe-if-available-v1
> > >
> > > winsup/configure.ac | 5 +++++
> > > winsup/utils/Makefile.am | 4 ++++
> > > 2 files changed, 9 insertions(+)
> >
> > LGTM. Jon, what do you think?
>
> Well, the real solution here is for binutils to stop pretending that no-one
> links with libbfd and provide a .pc file for it, because we'll just be in
> the same situation the next time it grows another dependency.
>
> Until that happens :),
As in "never"? The binutils cygport package could provide it in
a kind of sneaky handcrafted way, couldn't it?
> this seems fine.
I pushed the patch.
Thanks,
Corinna
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-02-01 19:03 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-01 14:08 [PATCH] dumper: avoid linker problem when `libbfd` depends on `libsframe` Johannes Schindelin
2023-02-01 17:33 ` Corinna Vinschen
2023-02-01 18:04 ` Jon Turney
2023-02-01 19:03 ` 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).