public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Cygwin build from source is broken since binutils-2.42-1
@ 2024-02-12 10:10 Christian Franke
  2024-02-12 11:12 ` Corinna Vinschen
  0 siblings, 1 reply; 2+ messages in thread
From: Christian Franke @ 2024-02-12 10:10 UTC (permalink / raw)
  To: cygwin

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
...

-- 
Regards,
Christian


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Cygwin build from source is broken since binutils-2.42-1
  2024-02-12 10:10 Cygwin build from source is broken since binutils-2.42-1 Christian Franke
@ 2024-02-12 11:12 ` Corinna Vinschen
  0 siblings, 0 replies; 2+ messages in thread
From: Corinna Vinschen @ 2024-02-12 11:12 UTC (permalink / raw)
  To: Christian Franke; +Cc: cygwin

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-02-12 11:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-12 10:10 Cygwin build from source is broken since binutils-2.42-1 Christian Franke
2024-02-12 11:12 ` 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).