Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#58776 closed defect (worksforme)

macOS 10.15 libgcc9 fails to build with Xcode 11

Reported by: vdoublie Owned by:
Priority: Normal Milestone:
Component: ports Version:
Keywords: catalina Cc: quentinmit (Quentin Smith), trainman75, ra1nb0w, saagarjha (Saagar Jha), cjones051073 (Chris Jones), rieder (Steven Rieder), hapaguy (Brian Kurt Fujikawa)
Port: libgcc9

Description (last modified by vdoublie)

libgcc9 build using Xcode 11 fails to build

1- MacPorts installed from git source using Xcode 11 2- System: macOS 10.15 --- 2 errors:

1-

info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc9/libgcc9/work/b
uild/./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/ -xc -nostdinc /dev/null -S -o /dev/null -fself-test=/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.or
g_macports_release_tarballs_ports_lang_gcc9/libgcc9/work/gcc-9.1.0/gcc/testsuite/selftests
:info:build <built-in>: internal compiler error: Segmentation fault: 11
:info:build libbacktrace could not find executable to open

2-

:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc9/libgcc9/work/b
uild/./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.s
dk -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/b
uild/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc9/libgcc9/work/gcc-9.1.0/libgcc -I/opt/local/var/macp
orts/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc9/libgcc9/work/gcc-9.1.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.1.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.1.0/l
ibgcc/../include    -o _multc3_s.o -MT _multc3_s.o -MD -MP -MF _multc3_s.dep -DSHARED -DL_multc3 -c /opt/local/var/macports/build/_opt_local_var_macp
orts_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc9/libgcc9/work/gcc-9.1.0/libgcc/libgcc2.c
:info:build during RTL pass: expand
:info:build In file included from types:56:
:info:build types: 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.1.0/libgcc/libgcc2.h:256:16: internal compiler error: Segmentation fault: 11
:info:build   256 | #define __N(a) __ ## a
:info:build       |                ^~
: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.1.0/libgcc/libgcc2.h:357:19: note: in expansion of macro '__N'
:info:build   357 | #define __mulxc3  __N(mulxc3)
:info:build       |                   ^~~
:info:build types:1937:25: note: in expansion of macro '__mulxc3'
:info:build  1937 | #define _CONCAT3(A,B,C) A##B##C
:info:build       |                         ^
:info:build types:1936:24: note: in expansion of macro '_CONCAT3'
:info:build  1967 | CONCAT3(__mul,MODE,3) (MTYPE a, MTYPE b, MTYPE c, MTYPE d)
:info:build       | ^~~~~~~
:info:build libbacktrace could not find executable to open

included: -1 main.log

it also fails under macOS 10.14 Xcode 11 but at a different place will create new tickets to 10.14

Attachments (1)

main.log.tgz (1.8 MB) - added by vdoublie 5 years ago.

Download all attachments as: .zip

Change History (27)

Changed 5 years ago by vdoublie

Attachment: main.log.tgz added

comment:1 Changed 5 years ago by vdoublie

Description: modified (diff)
Summary: libgcc9 fails to build with Xcode 11macOS 10.15 libgcc9 fails to build with Xcode 11

comment:2 Changed 5 years ago by ryandesign (Ryan Carsten Schmidt)

Keywords: catalina added; segmentation fault removed

Remember not to discuss issues with prerelease macOS versions publicly; see wiki:FAQ#prerelease.

comment:3 Changed 5 years ago by vdoublie

I won't forget. Just hoping that ports get modified to allow the much tighter rules of Xcode coming up. I see from FAQ that Chris Jones is Catalina Beta... is there anyone for Xcode beta? Then I can send the reports directly. Cheers

comment:4 Changed 5 years ago by quentinmit (Quentin Smith)

Cc: quentinmit added

comment:5 Changed 5 years ago by trainman75

Cc: trainman75 added

comment:6 Changed 5 years ago by ra1nb0w

Cc: ra1nb0w added

comment:7 Changed 5 years ago by vdoublie

Xcode 11 is not in beta anymore.

comment:8 Changed 5 years ago by saagarjha (Saagar Jha)

Cc: saagarjha added

comment:9 Changed 5 years ago by rex4539 (Dimitris Apostolou)

Now that everything is public, perhaps it's time to have a look at this one?

comment:10 Changed 5 years ago by pmetzger (Perry E. Metzger)

Has this been fixed now?

comment:11 Changed 5 years ago by vdoublie

funnily enough it did not build stand alone but as part of the fresh install of py37-numpy. was there any internal change?

comment:12 Changed 5 years ago by saagarjha (Saagar Jha)

I can still reproduce this, so it doesn't look like it's been fixed.

comment:13 Changed 5 years ago by bmarcote (Marcote)

Working (at least for me) since today. They may have fixed it now.

comment:14 in reply to:  13 Changed 5 years ago by ra1nb0w

Replying to bmarcote:

Working (at least for me) since today. They may have fixed it now.

can you provide more information about your installation? This is the patch "present" on macports (commit sent by jonesc - Oct 8)

Last edited 5 years ago by ra1nb0w (previous) (diff)

comment:15 Changed 5 years ago by kprussing (Keith)

FYI, I just managed to build this port. I opened Xcode and clicked to install the additional tools (along with running xcode-select and installing the command line tools) and it worked. This could be a red herring…

comment:16 Changed 5 years ago by vdoublie

When I reported the issue: Xcode was up to date with the additional tools AND the CLT (dmg) installed

comment:17 Changed 5 years ago by AP1010

This doesn't seem to make too much sense, but in my case the following happened: I had Catalina + Xcode 11.1 + command line tools installed. The CLT were installed by using xcode-xelect --install. The port would not build.

I downloaded the stand-alone CLT package from Apple. Installed it on top of what I already had, and.... The port built successfully.

Last edited 5 years ago by AP1010 (previous) (diff)

comment:18 Changed 5 years ago by saagarjha (Saagar Jha)

It seems like cc1 is dying inside of libgmp.10.dylib`gmpn_copyi:

* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x7ffeefc00010)
    frame #0: 0x00000001441444aa libgmp.10.dylib`__gmpn_copyi + 234
libgmp.10.dylib`__gmpn_copyi:
->  0x1441444aa <+234>: movdqa xmmword ptr [rdi + 0x70], xmm7
    0x1441444af <+239>: palignr xmm6, xmm5, 0x8           ; xmm6 = xmm5[8,9,10,11,12,13,14,15],xmm6[0,1,2,3,4,5,6,7]
    0x1441444b5 <+245>: movaps xmm7, xmmword ptr [rsi + 0x78]
    0x1441444b9 <+249>: movdqa xmmword ptr [rdi + 0x60], xmm6
Target 0: (cc1) stopped.

This might be related to the stack alignment issues that Xcode 11 has (https://lists.macports.org/pipermail/macports-dev/2019-October/041324.html)? I'll try building with -fno-stack-check to see if it helps.

Last edited 5 years ago by saagarjha (Saagar Jha) (previous) (diff)

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

Cc: cjones051073 added

comment:20 Changed 5 years ago by saagarjha (Saagar Jha)

I can confirm that gcc builds if I force gmp to build with -fno-stack-check, using Xcode Version 11.2 (11B41) on macOS Catalina 10.15.1 (19B68f). (As a side note, it seems like Xcode 11.2 does not fix the stack alignment issue for gmp, at least not yet. Perhaps the check we have on whether to apply the workaround is a bit too optimistic?)

comment:21 Changed 5 years ago by ra1nb0w

I confirm that XCode 11.2 Beta 2 (11B44) doesn't fix stack_not_16_byte_aligned_error

Last edited 5 years ago by ra1nb0w (previous) (diff)

comment:22 Changed 5 years ago by rieder (Steven Rieder)

Cc: rieder added

comment:23 Changed 5 years ago by ra1nb0w

I removed both xcode and commandlinetools.
Re-installed XCode 11.1.
Re-built all gcc9 dependencies and then libgcc9 and gcc9 build fine.

comment:24 Changed 5 years ago by hapaguy (Brian Kurt Fujikawa)

Cc: hapaguy added

comment:25 Changed 5 years ago by hapaguy (Brian Kurt Fujikawa)

I confirm that gcc9 builds with Xcode 11.1 on macOS 10.15.1 after a post-macOS-upgrade clean MacPorts re-install.

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

Resolution: worksforme
Status: newclosed

OK thanks. I am going to close this as I believe there is indeed no issue with the latest Xcode/CLT and a clean MacPorts installation. Please reopen if anyone still has issues after ensuring they have the latest versions etc.

Note: See TracTickets for help on using tickets.