Opened 18 months ago

Closed 18 months ago

Last modified 18 months ago

#67416 closed defect (fixed)

libgcc12 @12.3.0: build failure on Monterey

Reported by: hululud Owned by: mascguy (Christopher Nielsen)
Priority: Normal Milestone:
Component: ports Version: 2.8.1
Keywords: monterey Cc: Schamschula (Marius Schamschula)
Port: gcc12 libgcc12

Description


Change History (18)

comment:1 Changed 18 months ago by ryandesign (Ryan Carsten Schmidt)

Keywords: monterey added
Summary: (12.3.0) the binary package on macos monterey is not availablelibgcc12 @12.3.0: build failure on Monterey
Type: enhancementdefect

Binary packages are not available because the port does not build on Monterey due to a linker crash:

0  0x1045bc1a0  __assert_rtn + 140
1  0x104443a8c  mach_o::relocatable::Parser<arm64>::parse(mach_o::relocatable::ParserOptions const&) + 4536
2  0x104415d38  mach_o::relocatable::Parser<arm64>::parse(unsigned char const*, unsigned long long, char const*, long, ld::File::Ordinal, mach_o::relocatable::ParserOptions const&) + 148
3  0x10447e4ac  ld::tool::InputFiles::makeFile(Options::FileInfo const&, bool) + 1468
4  0x104481360  ___ZN2ld4tool10InputFilesC2ER7Options_block_invoke + 56
5  0x19dbc01f4  _dispatch_client_callout2 + 20
6  0x19dbd3954  _dispatch_apply_invoke + 224
7  0x19dbc01b4  _dispatch_client_callout + 20
8  0x19dbd1a04  _dispatch_root_queue_drain + 680
9  0x19dbd2104  _dispatch_worker_thread2 + 164
10  0x19dd80324  _pthread_wqthread + 228
A linker snapshot was created at:
	/tmp/libstdc++.6.dylib-2023-05-16-151615.ld-snapshot
ld: Assertion failed: (_file->_atomsArrayCount == computedAtomCount && "more atoms allocated than expected"), function parse, file macho_relocatable_file.cpp, line 2061.
collect2: error: ld returned 1 exit status

Latest build logs:

comment:2 Changed 18 months ago by Schamschula (Marius Schamschula)

Cc: Schamschula added

comment:3 Changed 18 months ago by ryandesign (Ryan Carsten Schmidt)

According to this, it is a bug in Xcode 14.0, fixed in 14.1 beta 3 and later. The solutions presented there are to upgrade to Xcode 14.1 or downgrade to 13.4. We have 14.0.1 on the macOS 12 buildbot worker and I don't intend to upgrade because 14.0.1 is the last version that contains the macOS 12 SDK and we want the SDK version to match the OS version because of the problems that not doing that typically causes.

Sounds like this should be added to the port to work around the problem for anyone using Xcode 14.0 or 14.0.1:

PortGroup compiler_blacklist_versions 1.0
compiler.blacklist-append {clang >= 1400 < 1400.0.29.202}

I could downgrade Xcode to 13.4 on the buildbot if that is strongly desired.

Last edited 18 months ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:4 Changed 18 months ago by mascguy (Christopher Nielsen)

Owner: set to mascguy
Status: newassigned

comment:5 in reply to:  3 ; Changed 18 months ago by mascguy (Christopher Nielsen)

Replying to ryandesign:

We have 14.0.1 on the macOS 12 buildbot worker and I don't intend to upgrade because 14.0.1 is the last version that contains the macOS 12 SDK and we want the SDK version to match the OS version because of the problems that not doing that typically causes.

Sounds like this should be added to the port to work around the problem for anyone using Xcode 14.0 or 14.0.1:

PortGroup compiler_blacklist_versions 1.0
compiler.blacklist-append {clang >= 1400 < 1400.0.29.202}

Sounds good, I'll fix this afternoon, unless someone beats me to it.

I could downgrade Xcode to 13.4 on the buildbot if that is strongly desired.

My vote would be to leave it 14.0.1. Anyone else?

comment:6 Changed 18 months ago by Christopher Nielsen <mascguy@…>

Resolution: fixed
Status: assignedclosed

In 8100a19efb3a70afb4110280f2d5d815fccf920d/macports-ports (master):

gcc12: fix build for monterey
Fixes: #67416

comment:7 in reply to:  5 ; Changed 18 months ago by mascguy (Christopher Nielsen)

Resolution: fixed
Status: closedreopened

Replying to mascguy:

Replying to ryandesign:

Sounds like this should be added to the port to work around the problem for anyone using Xcode 14.0 or 14.0.1:

compiler.blacklist-append {clang >= 1400 < 1400.0.29.202}

Sounds good, I'll fix this afternoon, unless someone beats me to it.

Unfortunately building with macports-clang-15 doesn't cut the mustard, either:

https://build.macports.org/builders/ports-12_x86_64-builder/builds/70257/steps/install-port/logs/stdio

Does anyone have any other thoughts or ideas...?

comment:8 in reply to:  7 Changed 18 months ago by mascguy (Christopher Nielsen)

Replying to mascguy:

Unfortunately building with macports-clang-15 doesn't cut the mustard, either:

https://build.macports.org/builders/ports-12_x86_64-builder/builds/70257/steps/install-port/logs/stdio

Does anyone have any other thoughts or ideas...?

Ah, finally downloaded the 48MB logfile, and it's our old friend... a link crash:

0  0x100e08ffa  __assert_rtn + 139
1  0x100c3c28d  mach_o::relocatable::Parser<x86_64>::parse(mach_o::relocatable::ParserOptions const&) + 4989
2  0x100c2cf8f  mach_o::relocatable::Parser<x86_64>::parse(unsigned char const*, unsigned long long, char const*, long, ld::File::Ordinal, mach_o::relocatable::ParserOptions const&) + 207
3  0x100ca39d4  ld::tool::InputFiles::makeFile(Options::FileInfo const&, bool) + 2036
4  0x100ca6fa0  ___ZN2ld4tool10InputFilesC2ER7Options_block_invoke + 48
5  0x7ff816f4a34a  _dispatch_client_callout2 + 8
6  0x7ff816f5b8f5  _dispatch_apply_invoke + 213
7  0x7ff816f4a317  _dispatch_client_callout + 8
8  0x7ff816f59c0c  _dispatch_root_queue_drain + 673
9  0x7ff816f5a25c  _dispatch_worker_thread2 + 160
10  0x7ff8170fdf8a  _pthread_wqthread + 256
A linker snapshot was created at:
        /tmp/libstdc++.6.dylib-2023-05-21-225250.ld-snapshot
ld: Assertion failed: (_file->_atomsArrayCount == computedAtomCount && "more atoms allocated than expected"), function parse, file macho_relocatable_file.cpp, line 2061.
collect2: error: ld returned 1 exit status

So I suppose we should do the usual thing we now have to do with other ports, and blacklist MacPorts Clang 14 and later. Sigh...

Will commit the fix momentarily.

comment:9 Changed 18 months ago by Christopher Nielsen <mascguy@…>

In ee97206841c18bfd6bf054b8fa2c6706b193e0e4/macports-ports (master):

gcc12: blacklist macports-clang-14 and later, to fix link crash
See: #67416

comment:10 in reply to:  9 Changed 18 months ago by mascguy (Christopher Nielsen)

Replying to Christopher Nielsen <mascguy@…>:

In ee97206841c18bfd6bf054b8fa2c6706b193e0e4/macports-ports (master):

gcc12: blacklist macports-clang-14 and later, to fix link crash
See: #67416

Still seeing a link crash, even with MacPorts-Clang-13:

https://build.macports.org/builders/ports-12_x86_64-builder/builds/70260/steps/install-port/logs/stdio

Are we sure that we don't have an unresolved issue/interaction within our toolchain, that's causing these to become more and more common...?

Otherwise, I'm out of ideas for this evening. Anyone else...

comment:11 Changed 18 months ago by kencu (Ken)

looks like a linker bug. blacklisting a clang range doesn’t affect thr linker.

See https://github.com/macports/macports-ports/pull/18530/commits/01472131fcb77828cd63a08ff8b86399deecb338

comment:12 Changed 18 months ago by ryandesign (Ryan Carsten Schmidt)

If we have no new linker in MacPorts that we can tell the port to use, then I declare Xcode 14.0 and 14.0.1 unusable and will downgrade the macOS 12 buildbot workers to Xcode 13.4.

comment:13 in reply to:  12 ; Changed 18 months ago by mascguy (Christopher Nielsen)

Replying to ryandesign:

If we have no new linker in MacPorts that we can tell the port to use, then I declare Xcode 14.0 and 14.0.1 unusable and will downgrade the macOS 12 buildbot workers to Xcode 13.4.

Ryan, you might want to consider installing 13.4.1 specifically. Though perhaps that's what you're intending already, in which case, never mind...

comment:14 Changed 18 months ago by mascguy (Christopher Nielsen)

Update: I've tested on my macOS 12 VM, with Xcode 13.3 and 13.4.1. And libgcc12 builds successfully with both.

comment:15 Changed 18 months ago by neverpanic (Clemens Lang)

Port: libgcc12 added

comment:16 in reply to:  13 Changed 18 months ago by ryandesign (Ryan Carsten Schmidt)

Xcode 13.4.1 and the Xcode 13.4 command line tools are now installed on the macOS 12 builders and builds of gcc12 will be happening soon. I'll also run builds of all the R modules since R depends on gcc12. That should keep things busy for awhile.

Should still fix the code in the gcc12 Portfile so that users who have Xcode 14.0 or 14.0.1 get a proper early error message such as what Ken suggested.

comment:17 Changed 18 months ago by Christopher Nielsen <mascguy@…>

Resolution: fixed
Status: reopenedclosed

In 6e342409bd81541f947f54f7c61fb3305de01f2b/macports-ports (master):

gcc12: set known_fail for xcode 14.0.x

  • Also revert previous blacklisting, which doesn't help

Fixes: #67416

comment:18 Changed 18 months ago by ryandesign (Ryan Carsten Schmidt)

Thanks, and I see you've also scheduled builds of ports that depend on gcc12.

Note: See TracTickets for help on using tickets.