[newlib-cygwin/main] Cygwin: configure: Only compute BFD_LIBS if building dumper

Jon Turney jturney@sourceware.org
Thu Jun 4 19:26:49 GMT 2026


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

commit c703cfea7292258ac61022591dae7023e9e1d992
Author: Jon Turney <jon.turney@dronecode.org.uk>
Date:   Mon May 25 18:57:35 2026 +0100

    Cygwin: configure: Only compute BFD_LIBS if building dumper
    
    Don't bother trying to determine the flags needed to link the BFD
    library if we're not even building dumper.
    
    (AC_NO_EXECUTABLES doesn't do what the name would simply suggest: It
    silently checks if a trivial program can link, and turns itself off if
    that suceeds.
    
    Tests which rely on linking are only made to fail by AC_NO_EXECUTABLES
    if that trivial link has failed (which OK, were probably going to fail
    anyway, but now you get the error 'link tests are not allowed after
    AC_NO_EXECUTABLES', which is perhaps slightly more informative when you
    are cross-compiling with a bootstrap compiler).)
    
    Anyhow, if we're using a compiler which can't link executables, these
    instances of AC_CHECK_LIB will definitely fail.  But we can't possibly
    build dumper in that situation, so we'll be configuring with
    --disable-dumper, and doing those checks serves no purpose.
    
    Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>

Diff:
---
 winsup/configure.ac | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/winsup/configure.ac b/winsup/configure.ac
index ac96968e4..ad63cbf95 100644
--- a/winsup/configure.ac
+++ b/winsup/configure.ac
@@ -153,12 +153,14 @@ AC_ARG_ENABLE([dumper],
 
 AM_CONDITIONAL(BUILD_DUMPER, [test "x$build_dumper" = "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"])
-AC_SUBST([BFD_LIBS])
+if test "x$build_dumper" != "xno"; then
+  # 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"])
+  AC_SUBST([BFD_LIBS])
+fi
 
 AC_CONFIG_FILES([
     Makefile


More information about the Cygwin-cvs mailing list