Opened 16 months ago

Last modified 16 months ago

#67577 new defect

gcc12 12.3.0 fails (?) to build with gcc10-bootstrap (only in Rosetta, native PPC is fine)

Reported by: barracuda156 Owned by:
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: catap (Kirill A. Korinsky), mascguy (Christopher Nielsen)
Port: gcc12

Description

Something got badly broken: gcc12 12.3.0 does not build with gcc10-bootstrap now:

/opt/local/libexec/gcc10-bootstrap/bin/gcc -arch ppc -c -DHAVE_CONFIG_H -pipe -Os -I/opt/local/include -I. -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc12/libgcc12/work/gcc-12.3.0/libiberty/../include  -W -Wall -Wwrite-strings -Wc++-compat -Wstrict-prototypes -Wshadow=local -pedantic  -D_GNU_SOURCE  /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc12/libgcc12/work/gcc-12.3.0/libiberty/pex-one.c -o pex-one.o
yes
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc12/libgcc12/work/gcc-12.3.0/libiberty/pex-unix.c: In function 'pex_unix_open_read':
checking for mbstowcs... /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc12/libgcc12/work/gcc-12.3.0/libiberty/pex-unix.c:344:10: warning: implicit declaration of function 'open'; did you mean 'zopen'? [-Wimplicit-function-declaration]
  344 |   return open (name, O_RDONLY);
      |          ^~~~
      |          zopen
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc12/libgcc12/work/gcc-12.3.0/libiberty/pex-unix.c:344:22: error: 'O_RDONLY' undeclared (first use in this function)
  344 |   return open (name, O_RDONLY);
      |                      ^~~~~~~~
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc12/libgcc12/work/gcc-12.3.0/libiberty/pex-unix.c:344:22: note: each undeclared identifier is reported only once for each function it appears in
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc12/libgcc12/work/gcc-12.3.0/libiberty/pex-unix.c: In function 'pex_unix_open_write':
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc12/libgcc12/work/gcc-12.3.0/libiberty/pex-unix.c:355:22: error: 'O_WRONLY' undeclared (first use in this function)
  355 |   return open (name, O_WRONLY | O_CREAT
      |                      ^~~~~~~~
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc12/libgcc12/work/gcc-12.3.0/libiberty/pex-unix.c:355:33: error: 'O_CREAT' undeclared (first use in this function)
  355 |   return open (name, O_WRONLY | O_CREAT
      |                                 ^~~~~~~
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc12/libgcc12/work/gcc-12.3.0/libiberty/pex-unix.c:356:20: error: 'O_APPEND' undeclared (first use in this function); did you mean 'SF_APPEND'?
  356 |        | (append ? O_APPEND : O_TRUNC), PUBLIC_MODE);
      |                    ^~~~~~~~
      |                    SF_APPEND
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc12/libgcc12/work/gcc-12.3.0/libiberty/pex-unix.c:356:31: error: 'O_TRUNC' undeclared (first use in this function)
  356 |        | (append ? O_APPEND : O_TRUNC), PUBLIC_MODE);
      |                               ^~~~~~~
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc12/libgcc12/work/gcc-12.3.0/libiberty/pex-unix.c: In function 'pex_unix_exec_child':
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc12/libgcc12/work/gcc-12.3.0/libiberty/pex-unix.c:595:8: warning: implicit declaration of function 'fcntl' [-Wimplicit-function-declaration]
  595 |    if (fcntl (pipes[1], F_SETFD, FD_CLOEXEC) == -1)
      |        ^~~~~
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc12/libgcc12/work/gcc-12.3.0/libiberty/pex-unix.c:595:25: error: 'F_SETFD' undeclared (first use in this function)
  595 |    if (fcntl (pipes[1], F_SETFD, FD_CLOEXEC) == -1)
      |                         ^~~~~~~
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc12/libgcc12/work/gcc-12.3.0/libiberty/pex-unix.c:595:34: error: 'FD_CLOEXEC' undeclared (first use in this function)
  595 |    if (fcntl (pipes[1], F_SETFD, FD_CLOEXEC) == -1)
      |                                  ^~~~~~~~~~
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc12/libgcc12/work/gcc-12.3.0/libiberty/pex-unix.c: In function 'pex_unix_fdopenw':
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc12/libgcc12/work/gcc-12.3.0/libiberty/pex-unix.c:811:18: error: 'F_SETFD' undeclared (first use in this function)
  811 |   if (fcntl (fd, F_SETFD, FD_CLOEXEC) < 0)
      |                  ^~~~~~~
yes
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc12/libgcc12/work/gcc-12.3.0/libiberty/pex-unix.c:811:27: error: 'FD_CLOEXEC' undeclared (first use in this function)
  811 |   if (fcntl (fd, F_SETFD, FD_CLOEXEC) < 0)
      |                           ^~~~~~~~~~
checking whether /opt/local/libexec/gcc10-bootstrap/bin/gcc -arch ppc supports -pedantic -Wlong-long... /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc12/libgcc12/work/gcc-12.3.0/libiberty/pex-unix.c: In function 'pex_unix_cleanup':
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc12/libgcc12/work/gcc-12.3.0/libiberty/pex-unix.c:822:27: warning: identifier 'this' conflicts with C++ keyword [-Wc++-compat]
  822 |       struct status_list *this;
      |                           ^~~~
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc12/libgcc12/work/gcc-12.3.0/libiberty/pex-unix.c:825:7: warning: identifier 'this' conflicts with C++ keyword [-Wc++-compat]
  825 |       this = (struct status_list *) obj->sysdep;
      |       ^~~~
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc12/libgcc12/work/gcc-12.3.0/libiberty/pex-unix.c:826:14: warning: identifier 'this' conflicts with C++ keyword [-Wc++-compat]
  826 |       next = this->next;
      |              ^~~~
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc12/libgcc12/work/gcc-12.3.0/libiberty/pex-unix.c:827:13: warning: identifier 'this' conflicts with C++ keyword [-Wc++-compat]
  827 |       free (this);
      |             ^~~~
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc12/libgcc12/work/gcc-12.3.0/libiberty/pex-unix.c: In function 'pex_unix_open_write':
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc12/libgcc12/work/gcc-12.3.0/libiberty/pex-unix.c:357:1: warning: control reaches end of non-void function [-Wreturn-type]
  357 | }
      | ^
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc12/libgcc12/work/gcc-12.3.0/libiberty/pex-unix.c: In function 'pex_unix_open_read':
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc12/libgcc12/work/gcc-12.3.0/libiberty/pex-unix.c:345:1: warning: control reaches end of non-void function [-Wreturn-type]
  345 | }
      | ^
make[3]: *** [pex-unix.o] Error 1
make[3]: *** Waiting for unfinished jobs....

This is Rosetta (not 10A190), and no extra patches to gcc12.

There is no failure if gcc12 itself is used to build it. At the same time, gcc10-bootstrap worked fine earlier, but now both 10.3.0 and 10.4.0 fail. Not sure yet what happened.

Attachments (1)

libgcc12_rosetta_fail.txt (418.3 KB) - added by barracuda156 16 months ago.

Download all attachments as: .zip

Change History (6)

Changed 16 months ago by barracuda156

Attachment: libgcc12_rosetta_fail.txt added

comment:1 Changed 16 months ago by barracuda156

Even more weirdly, 12.2.0 also fails now, so we can rule out both upstream breaking something in 12.3.0 and ourselves breaking something during update of gcc12 port.

Either something global in Macports is breaking the build or something got screwed on a specific machine (another Rosetta installation is at home, I cannot verify right now).

comment:2 Changed 16 months ago by barracuda156

Another quick update:

  1. On 10A190 (10.6 PPC) everything is fine: libgcc12 12.3.0 build is running normally with gcc10-bootstrap 10.4.0. No weird failures.
  1. Before anyone asked (I did ask myself too, and checked this): on Rosetta both cctools and ld64 are standard ones (not darwin-xtools-based; those are not even installed).

So I clueless what has broken :( Either the error is Rosetta-specific or machine-specific.

comment:3 Changed 16 months ago by barracuda156

Summary: gcc12 12.3.0 fails to build with gcc10-bootstrapgcc12 12.3.0 fails (?) to build with gcc10-bootstrap (only in Rosetta, native PPC is fine)

comment:4 Changed 16 months ago by kencu (Ken)

it is behaving as though <sys/fcntl.h> is not being included.

I think all of the missing definitions are in that one file...

why, I am not sure at this moment.

comment:5 in reply to:  4 Changed 16 months ago by barracuda156

Replying to kencu:

it is behaving as though <sys/fcntl.h> is not being included.

I think all of the missing definitions are in that one file...

why, I am not sure at this moment.

Thank you!

Checked just in case, the header is in place in /usr/include/sys/, and not modified on my end. So still a mystery what goes wrong.

Note: See TracTickets for help on using tickets.