#68255 closed defect (fixed)
libgcc12 @12.3.0: ld: Assertion failed: (resultIndex < sectData.atoms.size())
Reported by: | AP1010 | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | 2.8.1 |
Keywords: | sonoma arm64 | Cc: | Knapoc, platipodium (Carsten Lemmen), tthoma24 (Teddy Thomas), cjones051073 (Chris Jones) |
Port: | libgcc12 gcc12 |
Description
ld: warning: ignoring duplicate libraries: '-lgcc' 0 0x1044b7648 __assert_rtn + 72 1 0x1043ebfac ld::AtomPlacement::findAtom(unsigned char, unsigned long long, ld::AtomPlacement::AtomLoc const*&, long long&) const + 1204 2 0x104401924 ld::InputFiles::SliceParser::parseObjectFile(mach_o::Header const*) const + 15164 3 0x10440ee30 ld::InputFiles::parseAllFiles(void (ld::AtomFile const*) block_pointer)::$_7::operator()(unsigned long, ld::FileInfo const&) const + 420 4 0x184971950 _dispatch_client_callout2 + 20 5 0x1849861a4 _dispatch_apply_invoke_and_wait + 176 6 0x184985464 _dispatch_apply_with_attr_f + 1176 7 0x184985650 dispatch_apply + 96 8 0x1044893b8 ld::AtomFileConsolidator::parseFiles(bool) + 292 9 0x10442a170 main + 9048 ld: Assertion failed: (resultIndex < sectData.atoms.size()), function findAtom, file Relocations.cpp, line 1336. collect2: error: ld returned 1 exit status make[6]: *** [libstdc++.la] Error 1
Attachments (2)
Change History (19)
Changed 8 months ago by AP1010
Attachment: | main.log.zip added |
---|
comment:1 Changed 8 months ago by ryandesign (Ryan Carsten Schmidt)
Keywords: | sonoma added; Sonoma removed |
---|---|
Port: | libgcc12 gcc12 → libgcc12 gcc12 |
Summary: | libgcc12@12.3.0 fails to build on MacOS 14.0 Sonoma arm64 → libgcc12 @12.3.0: ld: Assertion failed: (resultIndex < sectData.atoms.size()) |
comment:2 Changed 8 months ago by Knapoc
Cc: | Knapoc added |
---|
comment:3 Changed 8 months ago by platipodium (Carsten Lemmen)
Cc: | platipodium added |
---|
comment:4 Changed 8 months ago by tthoma24 (Teddy Thomas)
I'm seeing this assertion failure on an Intel Mac as well, macOS 14 Sonoma.
Changed 8 months ago by tthoma24 (Teddy Thomas)
Attachment: | main.log.intel.zip added |
---|
main.log Intel Mac (compressed)
comment:5 Changed 8 months ago by tthoma24 (Teddy Thomas)
Cc: | tthoma24 added |
---|
comment:6 follow-up: 10 Changed 8 months ago by freedomtan ("freedom" Koan-Sin Tan)
This is a bug of new ld shipped with Xcode 15. A simple workaround is to use previous ld. I changed the --with-ld=${prefix}/bin/ld in lang/gcc12/Portfile to --with-ld= /Library/Developer/CommandLineTools/usr/bin/ld-classic then I can build libgcc12 and gcc12 without problem.
comment:7 Changed 8 months ago by cjones051073 (Chris Jones)
comment:8 Changed 8 months ago by cjones051073 (Chris Jones)
Cc: | cjones051073 added |
---|
comment:9 follow-up: 11 Changed 8 months ago by cjones051073 (Chris Jones)
Please can someone on macOS14 test the above commit and report back here.
comment:10 Changed 8 months ago by AP1010
Replying to freedomtan:This workaround is working for me as well.
This is a bug of new ld shipped with Xcode 15. A simple workaround is to use previous ld. I changed the --with-ld=${prefix}/bin/ld in lang/gcc12/Portfile to --with-ld= /Library/Developer/CommandLineTools/usr/bin/ld-classic then I can build libgcc12 and gcc12 without problem.
comment:11 Changed 8 months ago by Knapoc
Replying to cjones051073:
Please can someone on macOS14 test the above commit and report back here.
macOS 14.0 23A344 arm64 Xcode 15.0 15A240d
Building was successful.
comment:12 Changed 8 months ago by cjones051073 (Chris Jones)
Resolution: | → fixed |
---|---|
Status: | new → closed |
Thanks!
comment:13 Changed 8 months ago by szhorvat (Szabolcs Horvát)
I still see this issue. My system is:
macOS 13.6 22G120 arm64 Xcode 15.0 15A240d
comment:14 Changed 8 months ago by cjones051073 (Chris Jones)
Please ensure your ports are up to date and then try again. I have exactly the same system and the current version built fine for me.
comment:15 Changed 7 months ago by szhorvat (Szabolcs Horvát)
Sorry, I should have been more specific. Trying to build just about anything with GCC, including GCC13, triggers this linker crash. It was not clear to me whether this was fixed only in the context of building libgcc12, or more generally when using GCC. I am referring not to building ports, but using GCC in general to build any project.
My ports are up to date.
comment:16 Changed 7 months ago by cjones051073 (Chris Jones)
The fixes in the GCC port only fix building the port. When you use it yourself you will also need to revert to the using the classic linker as required. Basically, make sure you use -Wl,-ld_classic
comment:17 Changed 7 months ago by kencu (Ken)
It is reported that the Xcode 15.1 beta fixes this issue, so should disappear soon enough
main.log (compressed)