After I update xcode to new version in M1 Mac and then compile c++ by using make. the following problem occurs:
0 0x1010c81a0 __assert_rtn + 140
1 0x100f4fa8c mach_o::relocatable::Parser<arm64>::parse(mach_o::relocatable::ParserOptions const&) + 4536
2 0x100f21d38 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 0x100f8a4ac ld::tool::InputFiles::makeFile(Options::FileInfo const&, bool) + 1468
4 0x100f8d360 ___ZN2ld4tool10InputFilesC2ER7Options_block_invoke + 56
5 0x1893941f4 _dispatch_client_callout2 + 20
6 0x1893a7954 _dispatch_apply_invoke + 224
7 0x1893941b4 _dispatch_client_callout + 20
8 0x1893a5a04 _dispatch_root_queue_drain + 680
9 0x1893a6104 _dispatch_worker_thread2 + 164
10 0x189554324 _pthread_wqthread + 228
A linker snapshot was created at:
/tmp/smr_dense_SL-2022-09-14-165143.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: *** [smr_dense_SL] Error 1
Update: Download 14.1 beta 3 or higher to resolve the issue. Otherwise, read below.
The issue is with XCode 14.0 version, which I have tested and confirmed.
Downgrade your command line tools version to 13.4 and it will be resolved.
First download command line tools from the apple developers site and install it: https://download.developer.apple.com/Developer_Tools/Command_Line_Tools_for_Xcode_13.4/Command_Line_Tools_for_Xcode_13.4.dmg
You can change the version using the following command:
sudo xcode-select --switch /Library/Developer/CommandLineTools
To check the version of currently selected xcode command line tools, use the following command:
pkgutil --pkg-info=com.apple.pkg.CLTools_Executables
Make sure it is 13.4.
There are multiple GitHub discussions around this:
https://github.com/iains/gcc-12-branch/issues/6 https://github.com/Homebrew/discussions/discussions/3659
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With