Opened 2 months ago

Last modified 9 days ago

#65573 new defect

libgcc12: build fails for macOS 12.6 and 13 Beta

Reported by: adamgao1996 Owned by:
Priority: Normal Milestone:
Component: ports Version: 2.7.2
Keywords: monterey Cc: matteocorti (Matteo Corti), markemer (Mark Anderson), mascguy (Christopher Nielsen)
Port: libgcc12

Description (last modified by kencu (Ken))

0  0x1010a01a0  __assert_rtn + 140
1  0x100f27a8c  mach_o::relocatable::Parser<arm64>::parse(mach_o::relocatable::ParserOptions const&) + 4536
2  0x100ef9d38  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  0x100f624ac  ld::tool::InputFiles::makeFile(Options::FileInfo const&, bool) + 1468
4  0x100f65360  ___ZN2ld4tool10InputFilesC2ER7Options_block_invoke + 56
5  0x193537674  _dispatch_client_callout2 + 20
6  0x19354b0e8  _dispatch_apply_invoke + 224
7  0x193537634  _dispatch_client_callout + 20
8  0x193549184  _dispatch_root_queue_drain + 684
9  0x193549884  _dispatch_worker_thread2 + 164
10  0x1936ba0c4  _pthread_wqthread + 228
A linker snapshot was created at:
	/tmp/libstdc++.6.dylib-2022-07-29-182559.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
make[6]: *** [libstdc++.la] Error 1
make[6]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc12/libgcc12/work/build/arm64-apple-darwin22/libstdc++-v3/src'
make[5]: *** [all-recursive] Error 1
make[5]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc12/libgcc12/work/build/arm64-apple-darwin22/libstdc++-v3/src'
make[4]: *** [all-recursive] Error 1
make[4]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc12/libgcc12/work/build/arm64-apple-darwin22/libstdc++-v3'
make[3]: *** [all] Error 2
make[3]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc12/libgcc12/work/build/arm64-apple-darwin22/libstdc++-v3'
make[2]: *** [all-stage1-target-libstdc++-v3] Error 2
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc12/libgcc12/work/build'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc12/libgcc12/work/build'
make: *** [bootstrap-lean] Error 2
make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc12/libgcc12/work/build'
Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc12/libgcc12/work/build" && /usr/bin/make -j10 -w bootstrap-lean 
Exit code: 2
Error: Failed to build libgcc12: command execution failed
DEBUG: Error code: CHILDSTATUS 93705 2
DEBUG: Backtrace: command execution failed
    while executing
"system {*}$notty {*}$callback {*}$nice $fullcmdstring"
    invoked from within
"command_exec -callback portprogress::target_progress_callback build"
    (procedure "portbuild::build_main" line 8)
    invoked from within
"$procedure $targetname"
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc12/libgcc12/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets if you believe there is a bug.
Error: Processing of port libgcc12 failed

Attachments (1)

libgcc12-12.2.0_0-macOS12-Xcode14-main.log.gz (1.4 MB) - added by mopihopi 10 days ago.
libgcc12 @12.2.0_0 build from source on macOS 12.6 x86_64 with Xcode 14.0

Download all attachments as: .zip

Change History (16)

comment:1 Changed 2 months ago by kencu (Ken)

Description: modified (diff)
Keywords: uhd libgcc removed
Priority: HighNormal

comment:2 Changed 2 months ago by kencu (Ken)

strange error...

any idea why you are not getting the prebuilt libgcc12 binary?

https://packages.macports.org/libgcc12/libgcc12-12.1.0_6+stdlib_flag.darwin_21.arm64.tbz2

comment:3 Changed 2 months ago by adamgao1996

Thanks for the fast reply.

where should i put the prebuild file?

Just for documentation purpose:

My mac system is version 13.0 Beta (22A5311f)

I installed macport from source code in folder /opt

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

OK, that's why you didn't get the binary for darwin 21 -- you're on darwin 22 :>

If you can, please zip up and attach the log.

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

Summary: Error: Failed to build libgcc12: command execution failedError: Failed to build libgcc12 on mac system is version 13.0 Beta (22A5311f)

comment:6 Changed 2 months ago by kencu (Ken)

Summary: Error: Failed to build libgcc12 on mac system is version 13.0 Beta (22A5311f)Error: Failed to build libgcc12 on mac system version 13.0 Beta (22A5311f)

comment:7 Changed 2 months ago by kencu (Ken)

I'm not sure if gcc12 builds on darwin 22 yet. You could check with the darwin maintainer directly:

https://github.com/iains

and open an issue with him there in his gcc12 repo -- you'll get a much faster and probably accurate response directly from Iain.

comment:8 Changed 8 weeks ago by adamgao1996

thanks.

comment:9 Changed 4 weeks ago by matteocorti (Matteo Corti)

Cc: matteocorti added

comment:10 Changed 3 weeks ago by markemer (Mark Anderson)

Cc: markemer added

comment:11 Changed 13 days ago by mascguy (Christopher Nielsen)

Cc: mascguy added

comment:12 Changed 10 days ago by mopihopi

The same ld assertion failure is seen on macOS 12.6 x86_64 when building libgcc12 (or libgcc-devel, ticket:65850) from source with Xcode 14.0, so this is not specific to macOS 13 or arm64.

Last edited 10 days ago by mopihopi (previous) (diff)

Changed 10 days ago by mopihopi

libgcc12 @12.2.0_0 build from source on macOS 12.6 x86_64 with Xcode 14.0

comment:13 Changed 10 days ago by mascguy (Christopher Nielsen)

Keywords: monterey added
Summary: Error: Failed to build libgcc12 on mac system version 13.0 Beta (22A5311f)libgcc12: build fails for macOS 12.6 and 13 Beta
Version: 2.7.2

Related ticket, for libgcc-devel: issue:65850

comment:14 Changed 10 days ago by michaelld (Michael Dickens)

I've seen this and #65850 for a while ... I did a little code poking ... my best guess is that GCC's build system needs to be tweaked for Darwin 22 ... just a guess. I have not yet contacted Iain yet ... maybe @kencu can do that? Lack of GCC is holding back critical ports when using Xcode 14 or (so I understand) macOS 13-beta + Xcode 14-beta ... like OpenBLAS, NumPy, SciPy, etc. ...

Note: See TracTickets for help on using tickets.