public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug bootstrap/98590] New: [11 regression] Bootstrap failure with Ada on Cygwin since switch to C++11
@ 2021-01-07 20:07 mikpelinux at gmail dot com
  2021-01-07 20:10 ` [Bug bootstrap/98590] " mikpelinux at gmail dot com
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: mikpelinux at gmail dot com @ 2021-01-07 20:07 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98590

            Bug ID: 98590
           Summary: [11 regression] Bootstrap failure with Ada on Cygwin
                    since switch to C++11
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: bootstrap
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mikpelinux at gmail dot com
  Target Milestone: ---

Attempting to bootstrap gcc-11-20210103 with Ada on x86_64-pc-cygwin fails
with:

g++ -std=c++11  -fno-PIE -c  -DIN_GCC_FRONTEND -g -DIN_GCC     -fno-exceptions
-fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings
-Wcast-qual -Wno-error=format-diag -Wno-format  -Wmissing-format-attribute
-Woverloaded-virtual -Wno-long-long -Wno-variadic-macros
-Wno-overlength-strings   -DHAVE_CONFIG_H -I. -Iada -I/tmp/gcc-11-20210103/gcc
-I/tmp/gcc-11-20210103/gcc/ada -I/tmp/gcc-11-20210103/gcc/../include
-I/tmp/gcc-11-20210103/gcc/../libcpp/include
-I/tmp/gcc-11-20210103/gcc/../libcody
-I/home/mikpe/pkgs/cygwin-x86_64/gmp-6.2.1/include
-I/home/mikpe/pkgs/cygwin-x86_64/mpfr-4.1.0/include
-I/home/mikpe/pkgs/cygwin-x86_64/mpc-1.2.1/include 
-I/tmp/gcc-11-20210103/gcc/../libdecnumber
-I/tmp/gcc-11-20210103/gcc/../libdecnumber/bid -I../libdecnumber
-I/tmp/gcc-11-20210103/gcc/../libbacktrace   -o ada/cstreams.o -MT
ada/cstreams.o -MMD -MP -MF ada/.deps/cstreams.TPo
/tmp/gcc-11-20210103/gcc/ada/cstreams.c
In file included from /tmp/gcc-11-20210103/gcc/ada/cstreams.c:59:
/tmp/gcc-11-20210103/gcc/ada/cstreams.c: In function 'int
__gnat_fileno(FILE*)':
/tmp/gcc-11-20210103/gcc/system.h:122:26: error: 'fileno_unlocked' was not
declared in this scope; did you mean 'fopen_unlocked'?
  122 | #  define fileno(Stream) fileno_unlocked (Stream)
      |                          ^~~~~~~~~~~~~~~
/tmp/gcc-11-20210103/gcc/ada/cstreams.c:117:12: note: in expansion of macro
'fileno'
  117 |    return (fileno (stream));
      |            ^~~~~~
make[3]: *** [Makefile:1131: ada/cstreams.o] Error 1
make[3]: Leaving directory '/tmp/objdir/gcc'
make[2]: *** [Makefile:4778: all-stage1-gcc] Error 2
make[2]: Leaving directory '/tmp/objdir'
make[1]: *** [Makefile:22181: stage1-bubble] Error 2
make[1]: Leaving directory '/tmp/objdir'
make: *** [Makefile:22518: bootstrap] Error 2

GCC 7/8/9/10 all bootstrap fine with Ada (if a pending patch for PR94918 is
applied). A git bisect identified that this error started when GCC 11 switched
to requiring C++11 during bootstrap:
# first bad commit: [5329b59a2e13dabbe2038af0fe2e3cf5fc7f98ed] bootstrap:
Update requirement to C++11.

Cygwin's <stdio.h> only declares fileno_unlocked() if _GNU_SOURCE or similar is
defined. With g++ -std=c++11 or gcc -std=c11 the function is _not_ declared,
but if the -std= option is omitted or changed to a GNU dialect then the
function is declared.

For some reason however the configure checks for fileno_unlocked all succeeded:

> fgrep fileno_unlocked build.log
checking for fileno_unlocked... yes
checking whether fileno_unlocked is declared... yes
checking for fileno_unlocked... yes
checking whether fileno_unlocked is declared... yes
checking for fileno_unlocked... yes
checking whether fileno_unlocked is declared... yes
checking for fileno_unlocked... yes
checking whether fileno_unlocked is declared... yes

and left the generated config.h and auto-host.h files declaring it:

> grep -F -r HAVE_FILENO_UNLOCKED --include="*.h" .
./build-x86_64-pc-cygwin/fixincludes/config.h:#define HAVE_FILENO_UNLOCKED 1
./build-x86_64-pc-cygwin/libcpp/config.h:#define HAVE_FILENO_UNLOCKED 1
./gcc/auto-host.h:#define HAVE_FILENO_UNLOCKED 1
./libcpp/config.h:#define HAVE_FILENO_UNLOCKED 1

Seems there's a discrepancy between the configure tests and what GCC proper
does, leading to a reference to an undefined symbol.

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

end of thread, other threads:[~2021-03-07 17:02 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-07 20:07 [Bug bootstrap/98590] New: [11 regression] Bootstrap failure with Ada on Cygwin since switch to C++11 mikpelinux at gmail dot com
2021-01-07 20:10 ` [Bug bootstrap/98590] " mikpelinux at gmail dot com
2021-01-07 20:12 ` mikpelinux at gmail dot com
2021-01-07 20:25 ` ebotcazou at gcc dot gnu.org
2021-01-08  8:32 ` rguenth at gcc dot gnu.org
2021-01-08 10:03 ` ebotcazou at gcc dot gnu.org
2021-01-08 10:23 ` jakub at gcc dot gnu.org
2021-01-08 10:42 ` ebotcazou at gcc dot gnu.org
2021-01-08 10:47 ` jakub at gcc dot gnu.org
2021-01-09 14:05 ` mikpelinux at gmail dot com
2021-02-01 11:32 ` ebotcazou at gcc dot gnu.org
2021-02-03 16:45 ` mikpelinux at gmail dot com
2021-02-26 12:30 ` rguenth at gcc dot gnu.org
2021-03-02 22:20 ` cvs-commit at gcc dot gnu.org
2021-03-07 17:02 ` mikpelinux at gmail dot com

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