Opened 5 years ago

Closed 4 years ago

#59133 closed defect (fixed)

libgcc9 fails to build with Mojave and Xcode 11 latestrelease

Reported by: vdoublie Owned by:
Priority: Normal Milestone:
Component: ports Version: 2.6.0
Keywords: Cc: ogourgue (Olivier Gourgue), stromnov (Andrey Stromnov), cooljeanius (Eric Gallager)
Port: libgcc9

Description

sudo port -s build libggc9
fils to build with following errors

:info:build libtool: compile:  /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc9/libgcc9/work/build/./gcc/xgcc -B/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports
_lang_gcc9/libgcc9/work/build/./gcc/ -B/opt/local/x86_64-apple-darwin18/bin/ -B/opt/local/x86_64-apple-darwin18/lib/ -isystem /opt/local/x86_64-apple-darwin18/include -isystem /opt/local/x86_64-apple-darwin18/sys-include -fno-checking -DHAVE_CONFIG_H -I. -I/opt/local/var/macports/build/_opt_local_
var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc9/libgcc9/work/gcc-9.2.0/libgomp -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc9/libgcc9/work/gcc-9.2.0/libgomp/config/bsd -I/opt/local/var/m
acports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc9/libgcc9/work/gcc-9.2.0/libgomp/config/darwin -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc9/libgcc9/work/gcc-9.2.
0/libgomp/config/posix -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc9/libgcc9/work/gcc-9.2.0/libgomp -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang
_gcc9/libgcc9/work/gcc-9.2.0/libgomp/../include -Wall -pthread -Werror -g -O2 -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk -MT fortran.lo -MD -MP -MF .deps/fortran.Tpo -c /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_releas
e_tarballs_ports_lang_gcc9/libgcc9/work/gcc-9.2.0/libgomp/fortran.c -o fortran.o >/dev/null 2>&1
:info:build In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/sys/wait.h:110,
:info:build                  from /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/stdlib.h:66,
:info:build                  from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc9/libgcc9/work/gcc-9.2.0/libgomp/libgomp-plugin.c:29:
:info:build /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/sys/resource.h: In function 'getiopolicy_np':
:info:build /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/sys/resource.h:443:34: error: expected declaration specifiers before '__OSX_AVAILABLE_STARTING'
:info:build   443 | int     getiopolicy_np(int, int) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
:info:build       |                                  ^~~~~~~~~~~~~~~~~~~~~~~~
:info:build /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/sys/resource.h:449:39: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__OSX_AVAILABLE_STARTING'
info:build   449 | int     setiopolicy_np(int, int, int) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
:info:build       |                                       ^~~~~~~~~~~~~~~~~~~~~~~~
:info:build In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/libkern/_OSByteOrder.h:66,
:info:build                  from /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/sys/_endian.h:130,
:info:build                  from /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/i386/endian.h:99,
:info:build                  from /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/machine/endian.h:35,
:info:build                  from /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/sys/wait.h:186,
:info:build                  from /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/stdlib.h:66,
:info:build                  from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc9/libgcc9/work/gcc-9.2.0/libgomp/libgomp-plugin.c:29:
:info:build /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/libkern/i386/_OSByteOrder.h:49:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
:info:build    49 | {
:info:build       | ^
:info:build /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/libkern/i386/_OSByteOrder.h:58:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
:info:build    58 | {
:info:build       | ^
:info:build /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/libkern/i386/_OSByteOrder.h:96:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
:info:build    96 | {
:info:build       | ^
:info:build In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/stdlib.h:77,
:info:build                  from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc9/libgcc9/work/gcc-9.2.0/libgomp/libgomp-plugin.c:29:
:info:build /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/sys/_types/_ct_rune_t.h:32:28: error: storage class specified for parameter 'ct_rune_t'
   32 | typedef __darwin_ct_rune_t ct_rune_t;
:info:build       |                            ^~~~~~~~~
:info:build In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/stdlib.h:78,
:info:build                  from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc9/libgcc9/work/gcc-9.2.0/libgomp/libgomp-plugin.c:29:
:info:build /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/sys/_types/_rune_t.h:31:25: error: storage class specified for parameter 'rune_t'
:info:build    31 | typedef __darwin_rune_t rune_t;
:info:build       |                         ^~~~~~
:info:build In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/stdlib.h:81,
:info:build                  from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc9/libgcc9/work/gcc-9.2.0/libgomp/libgomp-plugin.c:29:
:info:build /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/sys/_types/_wchar_t.h:34:26: error: storage class specified for parameter 'wchar_t'
:info:build    34 | typedef __darwin_wchar_t wchar_t;
:info:build       |                          ^~~~~~~
:info:build In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc9/libgcc9/work/gcc-9.2.0/libgomp/libgomp-plugin.c:29:
:info:build /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/stdlib.h:86:3: error: storage class specified for parameter 'div_t'
:info:build    86 | } div_t;
:info:build       |   ^~~~~
:info:build /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/stdlib.h:91:3: error: storage class specified for parameter 'ldiv_t'
:info:build    91 | } ldiv_t;
[...]

so many that probably are a cascade of issues
I include the man.log
this is trying to build with latest Xcode 11 (not. a beta) on Mojave (so no NDA issues)

No maintainer listed

Attachments (3)

main.log.gz (1.8 MB) - added by vdoublie 5 years ago.
gzipped main.log
main_cat_20191010.log.gz (2.0 MB) - added by vdoublie 5 years ago.
Catalina build failing with very same error as prior Mojave + Xcode beta builds
main.log.tar.gz (1.7 MB) - added by rex4539 (Dimitris Apostolou) 4 years ago.
Dimitris log file from Catalina

Change History (27)

Changed 5 years ago by vdoublie

Attachment: main.log.gz added

gzipped main.log

comment:1 Changed 5 years ago by vdoublie

the errors listed after the "liine 449" are caused by this first problem.
disabling "use_parallel" in the Portfile allows to disentangle to problem.

comment:2 Changed 5 years ago by kencu (Ken)

nothing related to gcc can presently build against the xcode11 10.15 headers.

see many other open tickets. gcc is working on it. Only reliable option is to go back to Xcode10 until it gets sorted out.

comment:3 Changed 5 years ago by mf2k (Frank Schima)

Keywords: libgcc9 removed

comment:4 Changed 5 years ago by ogourgue (Olivier Gourgue)

Cc: ogourgue added

comment:5 Changed 5 years ago by stromnov (Andrey Stromnov)

Cc: stromnov added

comment:6 Changed 5 years ago by vdoublie

it finally got to build on a Mojave Xcode 11.0 and Xcode 11.1

comment:7 Changed 5 years ago by mouse07410 (Mouse)

It would be awfully nice if in addition to "I (finally) got 'it' working" (whatever 'it' might be) people would spare a few words on how.

E.g., following one of the advices given where? Another MacPorts ticket? Which one?

comment:8 Changed 5 years ago by kencu (Ken)

Chris added a patch that should fix building gcc9 against the 10.15 SDK. So it should "just work" now.

All other gcc versions remain broken, however, building against that SDK.

comment:9 Changed 5 years ago by ogourgue (Olivier Gourgue)

I don't see any upgrade of gcc9 when doing a selfupdate. What is this patch you are talking about?

comment:10 Changed 5 years ago by kencu (Ken)

[368383b4263282656853b68965c3db455333c5bd/macports-ports]

You won't see a version update. But failing builds against the 10.15 SDK should now work.

comment:11 Changed 5 years ago by vdoublie

uh tried ti install gcc9 on macOS 10.15 Xcode 11.1 (user release) and I get a series of errors will join the log file. This errors I saw on 10.14 + Xcode 11 Betas. Now gcc9 builds on 10.14+Xcode 11.1 but still not on Catalina Xcode 11.1 see main.log

Changed 5 years ago by vdoublie

Attachment: main_cat_20191010.log.gz added

Catalina build failing with very same error as prior Mojave + Xcode beta builds

comment:12 Changed 5 years ago by kencu (Ken)

that must be frustrating! I upgraded one of my systems to Catalina today, somI'll run a build myself shortly.

comment:13 Changed 5 years ago by vdoublie

Yup very. there are only. a few major port that I need to run and it is the first time I am stomped by libgcc. Most of the port sI found not building had an easy "hack" like removing the use_parallel=yes or adding use_parallel=no in the Portfile, or forcing a OSX_TARGET ... but I am not expert enough to figure out the behaviour of libgcc errors (at least it stopped fault segmenting ;) )

comment:14 in reply to:  13 Changed 5 years ago by seanngpack (sean ng pack)

Replying to vdoublie:

Yup very. there are only. a few major port that I need to run and it is the first time I am stomped by libgcc. Most of the port sI found not building had an easy "hack" like removing the use_parallel=yes or adding use_parallel=no in the Portfile, or forcing a OSX_TARGET ... but I am not expert enough to figure out the behaviour of libgcc errors (at least it stopped fault segmenting ;) )

Have you resolved your issue yet? My log file looks exactly the same when trying to install gcc9

Version 0, edited 5 years ago by seanngpack (sean ng pack) (next)

comment:15 Changed 5 years ago by cjones051073 (Chris Jones)

The latest log attached to this still has

:info:build /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/resource.h: In function 'getiopolicy_np':
:info:build /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/resource.h:443:34: error: expected declaration specifiers before '__OSX_AVAILABLE_STARTING'
:info:build   443 | int     getiopolicy_np(int, int) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
:info:build       |                                  ^~~~~~~~~~~~~~~~~~~~~~~~
:info:build /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/resource.h:449:39: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__OSX_AVAILABLE_STARTING'
:info:build   449 | int     setiopolicy_np(int, int, int) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
:info:build       |                                       ^~~~~~~~~~~~~~~~~~~~~~~~

which leads me to suspect you in fact have not updated to get the patch that fixes this. Please run

sudo port sync
sudo port upgrade outdated

and then try again with a clean build attempt.

comment:16 Changed 5 years ago by cjones051073 (Chris Jones)

one other comment. The build log is for gcc9, which means libgcc9 must have built OK. Both share the same build, so if libgcc9 worked gcc9 has to as well, unless you have not cleaned you build before trying. so also do

sudo port clean gcc9 libgcc9

then try again.

comment:17 Changed 5 years ago by thesamirsim

Trying to install inkscape on catalina, the installation process stops on libgcc and can not be installed:

The following dependencies will be installed: 
 OpenBLAS
 gcc9
 libgcc
 libgcc9
 py27-numpy
Continue? [Y/n]: y

Failed to build libgcc9: command execution failed

comment:18 Changed 5 years ago by thesamirsim

:info:build compilation terminated.
:info:build ld: warning: could not create compact unwind for __Unwind_RaiseException: non-standard register 0 being saved in prolog
:info:build ld: warning: could not create compact unwind for __Unwind_ForcedUnwind: non-standard register 0 being saved in prolog
:info:build ld: warning: could not create compact unwind for __Unwind_Resume: does not use RBP or RSP based frame
:info:build ld: warning: could not create compact unwind for __Unwind_Resume_or_Rethrow: does not use RBP or RSP based frame
:info:build ld: unexpected token: !tapi-tbd-v3 file '/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/lib/libc.tbd' for architecture x86_64
:info:build make[3]: *** [libgcc_s.dylib] Error 1
:info:build make[3]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc9/libgcc9/work/build/x86_64-apple-darwin19/libgcc'
:info:build make[2]: *** [all-stage1-target-libgcc] Error 2
:info:build make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc9/libgcc9/work/build'
:info:build make[1]: *** [stage1-bubble] Error 2
:info:build make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc9/libgcc9/work/build'
:info:build make: *** [bootstrap-lean] Error 2
:info:build make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc9/libgcc9/work/build'
:info:build Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc9/libgcc9/work/build" && /usr/bin/make -j8 -w bootstrap-lean 
:info:build Exit code: 2
:error:build Failed to build libgcc9: command execution failed
:debug:build Error code: CHILDSTATUS 35082 2
:debug:build Backtrace: command execution failed
:debug:build     while executing
:debug:build "system {*}$notty {*}$nice $fullcmdstring"
:debug:build     invoked from within
:debug:build "command_exec build"
:debug:build     (procedure "portbuild::build_main" line 8)
:debug:build     invoked from within
:debug:build "$procedure $targetname"
:error:build See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc9/libgcc9/main.log for details.

comment:19 Changed 5 years ago by kencu (Ken)

Usually I get past that error with -Wl,-no_compact_unwind, but I'm not sure why you're seeing it whereas others don't seem to be seeing it.

Do you have the wrong ld64 installed? The only version that works correctly is ld64 +ld64_xcode (ie "no MacPorts ld64" but that's another tale...).

comment:20 in reply to:  19 Changed 5 years ago by cjones051073 (Chris Jones)

Replying to kencu:

Usually I get past that error with -Wl,-no_compact_unwind, but I'm not sure why you're seeing it whereas others don't seem to be seeing it.

Do you have the wrong ld64 installed? The only version that works correctly is ld64 +ld64_xcode (ie "no MacPorts ld64" but that's another tale...).

I agree with ken. Check the toolkit you have installed.i.e.

sudo port sync
sudo port -f uninstall ld64 
sudo port -f uninstall cctools
sudo port install cctools

then you should have the current defaults, which should work OK. (removing cctools might not really be needed, but does no harm...)

comment:21 Changed 5 years ago by thesamirsim

Thank you. That's right, the problem was actually at the ld64. the following commands have solved the problem

sudo port sync
sudo port -f uninstall ld64 
sudo port -f uninstall cctools
sudo port install cctools

comment:22 Changed 4 years ago by rex4539 (Dimitris Apostolou)

I followed the various remedies above but still no joy in Catalina.

:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc9/libgcc9/work/build/./gcc/xgcc -B/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc9/libgcc9/work/build/./gcc/ -B/opt/local/x86_64-apple-darwin19/bin/ -B/opt/local/x86_64-apple-darwin19/lib/ -isystem /opt/local/x86_64-apple-darwin19/include -isystem /opt/local/x86_64-apple-darwin19/sys-include   -fno-checking -g -O2 -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -O2  -g -O2 -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -DIN_GCC    -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-format -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include   -mmacosx-version-min=10.5 -pipe -fno-common -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector   -mmacosx-version-min=10.5 -pipe -fno-common -I. -I. -I../.././gcc -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc9/libgcc9/work/gcc-9.2.0/libgcc -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc9/libgcc9/work/gcc-9.2.0/libgcc/. -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc9/libgcc9/work/gcc-9.2.0/libgcc/../gcc -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc9/libgcc9/work/gcc-9.2.0/libgcc/../include    -o _bswapdi2_s.o -MT _bswapdi2_s.o -MD -MP -MF _bswapdi2_s.dep -DSHARED -DL_bswapdi2 -c /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc9/libgcc9/work/gcc-9.2.0/libgcc/libgcc2.c
:info:build during RTL pass: expand
:info:build In file included from ÿÄL‰ïè)£:56:
:info:build ÿÄL‰ïè)£: In function '__mulxc3':
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc9/libgcc9/work/gcc-9.2.0/libgcc/libgcc2.h:256:16: internal compiler error: Segmentation fault: 11
Last edited 4 years ago by rex4539 (Dimitris Apostolou) (previous) (diff)

Changed 4 years ago by rex4539 (Dimitris Apostolou)

Attachment: main.log.tar.gz added

Dimitris log file from Catalina

comment:23 Changed 4 years ago by cooljeanius (Eric Gallager)

Cc: cooljeanius added

comment:24 Changed 4 years ago by cjones051073 (Chris Jones)

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.