On Feb 12 11:10, Christian Franke via Cygwin wrote:
> This is not a binutils regression: A build from cygwin 3.5.0-1 src package
> or current newlib-cygwin git main (bfb68a9) with new binutils-2.42-1 fails
> with:
> 
> "
> In file included from ../../../../winsup/utils/dumper.cc:23:
> /usr/include/bfd.h:2748:1: error: expected initializer before
> ‘ATTRIBUTE_WARN_UNUSED_RESULT’
> "
> 
> Downgrading to binutils 2.41-3 fixes the problem.
> 
> A diff of /usr/include/bsd.h shows that ATTRIBUTE_WARN_UNUSED_RESULT is a
> new addition in 2.42-1. This requires /usr/include/ansidecl.h. It is
> included by /usr/include/bsd.h but this has no effect because Cygwin source
> tree provides its own ansidecl.h which lacks ATTRIBUTE_WARN_UNUSED_RESULT:
> 
> $ g++ ....MANY_OPTIONS... -E ../../../../winsup/utils/dumper.cc
> ...
> # 1 "../../../../winsup/utils/dumper.cc"
> ...
> # 1 "../../../../winsup/../include/ansidecl.h" 1  <== #define _ANSIDECL_H
> ...
> # 1 "/usr/include/bfd.h" 1 3 4
> ...
> # 1 "/usr/include/ansidecl.h" 1 3 4  <== #ifndef _ANSIDECL_H

Did you try to copy over include/ansidecl.h from binutils master
to newlib-cygwin's include/ansidecl.h?

It looks like this does the trick, together with changing
dumper.cc, because of:

winsup/utils/dumper.cc:145:48: error: ‘PTR’ has not been declared
  145 | print_section_name (bfd* abfd, asection* sect, PTR obj)
      |                                                ^~~

Changing this to "void*" fixes the build for binutils 2.40 on Linux.


Corinna

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

Reply via email to