[PATCH] dumper: allow compiling with binutils 2.47

"Johannes Schindelin via GitGitGadget" <[email protected]> Tue, 28 Jul 2026 10:39:34 +0000
Newsgroups gmane.os.cygwin.patches
Message-ID <[email protected]>
From: Johannes Schindelin <[email protected]>

In the latest version, binutils' BFD no longer declares a `bfd_boolean`,
and the `bfd_record_phdr()` function accepts plain `bool` parameters
instead.

Let's accommodate for that to avoid these build failures:

  .../winsup/utils/dumper.cc: In member function 'int dumper::prepare_core_dump()':
  .../winsup/utils/dumper.cc:830:7: error: 'bfd_boolean' was not declared in this scope; did you mean 'boolean'?
    830 |       bfd_boolean filehdr = 0;
        |       ^~~~~~~~~~~
        |       boolean
  .../winsup/utils/dumper.cc:831:18: error: expected ';' before 'phdrs'
    831 |       bfd_boolean phdrs = 0;
        |                  ^~~~~~
        |                  ;
  [...]

Signed-off-by: Johannes Schindelin <[email protected]>
---
    dumper: allow compiling with binutils 2.47
    
    MSYS2 just updated to this version, and I tried to deploy a new MSYS2
    runtime... oops ;-)

Published-As: https://github.com/cygwingitgadget/cygwin/releases/tag/pr-9%2Fdscho%2Faccommodate-for-binutils-2.47-v1
Fetch-It-Via: git fetch https://github.com/cygwingitgadget/cygwin pr-9/dscho/accommodate-for-binutils-2.47-v1
Pull-Request: https://github.com/cygwingitgadget/cygwin/pull/9

 winsup/utils/dumper.cc | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/winsup/utils/dumper.cc b/winsup/utils/dumper.cc
index 994f9b683..ac261d03c 100644
--- a/winsup/utils/dumper.cc
+++ b/winsup/utils/dumper.cc
@@ -827,14 +827,14 @@ dumper::prepare_core_dump ()
       p->section = new_section;
       int section_count = 1;
 
-      bfd_boolean filehdr = 0;
-      bfd_boolean phdrs = 0;
+      bool filehdr = false;
+      bool phdrs = false;
 
       bfd_vma at = 0;
-      bfd_boolean valid_at = 0;
+      bool valid_at = false;
 
       flagword flags = 0;
-      bfd_boolean valid_flags = 1;
+      bool valid_flags = true;
 
       if (p->type == pr_ent_memory)
 	{

base-commit: 273e66172494aa276f08155c12e6934f80abb10b
-- 
cygwingitgadget