public inbox for
help / color / mirror / Atom feed
From: Jon Turney <>
Subject: [newlib-cygwin/cygwin-3_4-branch] Cygwin: dumper: also link with libzstd, as libbfd may require it
Date: Tue, 14 Feb 2023 22:05:26 +0000 (GMT)	[thread overview]
Message-ID: <> (raw);h=2fd459c3b180def80b0db4b6c91e4f088e779cc1

commit 2fd459c3b180def80b0db4b6c91e4f088e779cc1
Author: Jon Turney <>
Date:   Tue Feb 14 13:52:39 2023 +0000

    Cygwin: dumper: also link with libzstd, as libbfd may require it
    Also allow that linkage to be dynamic, as libzstd-devel doesn't
    currently provide a static library.

 .appveyor.yml                  | 1 +
 .github/workflows/cygwin.yml   | 1 +
 winsup/            | 7 +++++++
 winsup/doc/faq-programming.xml | 2 +-
 winsup/utils/       | 3 ++-
 5 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/.appveyor.yml b/.appveyor.yml
index 50a9101b7..9f20f6d83 100644
--- a/.appveyor.yml
+++ b/.appveyor.yml
@@ -35,6 +35,7 @@ patch,\
diff --git a/.github/workflows/cygwin.yml b/.github/workflows/cygwin.yml
index 7ad5ccf5f..8f7b888e3 100644
--- a/.github/workflows/cygwin.yml
+++ b/.github/workflows/cygwin.yml
@@ -80,6 +80,7 @@ jobs:
+          libzstd-devel,
           mingw64-${{ matrix.pkgarch }}-gcc-g++,
           mingw64-${{ matrix.pkgarch }}-zlib,
diff --git a/winsup/ b/winsup/
index 9205a8886..49a8346fa 100644
--- a/winsup/
+++ b/winsup/
@@ -116,6 +116,13 @@ AC_CHECK_LIB([bfd], [bfd_init], [true],
 AM_CONDITIONAL(BUILD_DUMPER, [test "x$ac_cv_lib_bfd_bfd_init" = "xyes"])
+# libbfd.a doesn't have a pkgconfig file, so we guess what it's dependencies
+# are, based on what's present in the build environment
+BFD_LIBS="-lintl -liconv -liberty -lz"
+AC_CHECK_LIB([sframe], [sframe_decode], [BFD_LIBS="${BFD_LIBS} -lsframe"])
+AC_CHECK_LIB([zstd], [ZSTD_isError], [BFD_LIBS="${BFD_LIBS} -lzstd"])
diff --git a/winsup/doc/faq-programming.xml b/winsup/doc/faq-programming.xml
index 632d1a173..d23f32c3a 100644
--- a/winsup/doc/faq-programming.xml
+++ b/winsup/doc/faq-programming.xml
@@ -679,7 +679,7 @@ rewriting the runtime library in question from specs...
 installed; you at least need <literal>gcc-g++</literal>,
 <literal>make</literal>, <literal>automake</literal>,
 <literal>autoconf</literal>, <literal>git</literal>, <literal>perl</literal>,
-<literal>gettext-devel</literal>, <literal>libiconv-devel</literal>
+<literal>gettext-devel</literal>, <literal>libiconv-devel</literal>, <literal>libzstd-devel</literal>,
 <literal>zlib-devel</literal>, <literal>cocom</literal> and <literal>patch</literal>.
diff --git a/winsup/utils/ b/winsup/utils/
index 6be5b12c2..fa6499dfe 100644
--- a/winsup/utils/
+++ b/winsup/utils/
@@ -78,7 +78,8 @@ LDADD = -lnetapi32
 cygpath_CXXFLAGS = -fno-threadsafe-statics $(AM_CXXFLAGS)
 cygpath_LDADD = $(LDADD) -luserenv -lntdll
 dumper_CXXFLAGS = -I$(top_srcdir)/../include $(AM_CXXFLAGS)
-dumper_LDADD = $(LDADD) -lpsapi -lbfd -lintl -liconv -liberty -lz -lntdll
+dumper_LDADD = $(LDADD) -lpsapi -lntdll -lbfd @BFD_LIBS@
+dumper_LDFLAGS =
 ldd_LDADD = $(LDADD) -lpsapi -lntdll
 minidumper_LDADD = $(LDADD) -ldbghelp

                 reply	other threads:[~2023-02-14 22:05 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).