Hi, I wanted to compile a project (For the compilation I used gcc-13 from home-brew) and I got the following error from the linker:
0 0x100e0f648 __assert_rtn + 72
1 0x100d43fac ld::AtomPlacement::findAtom(unsigned char, unsigned long long, ld::AtomPlacement::AtomLoc const*&, long long&) const + 1204
2 0x100d59924 ld::InputFiles::SliceParser::parseObjectFile(mach_o::Header const*) const + 15164
3 0x100d66e30 ld::InputFiles::parseAllFiles(void (ld::AtomFile const*) block_pointer)::$_7::operator()(unsigned long, ld::FileInfo const&) const + 420
4 0x1a95f0440 _dispatch_client_callout2 + 20
5 0x1a9603f1c _dispatch_apply_invoke + 224
6 0x1a95f0400 _dispatch_client_callout + 20
7 0x1a9601fb8 _dispatch_root_queue_drain + 684
8 0x1a96026c0 _dispatch_worker_thread2 + 164
9 0x1a979c038 _pthread_wqthread + 228
ld: Assertion failed: (resultIndex < sectData.atoms.size()), function findAtom, file Relocations.cpp, line 1336.
collect2: error: ld returned 1 exit status
I am using a MacBook Pro M2 (Ventura 13.5.2 (22G91)) and the CommandLineTools version 15.0. I have read through some earlier posts about linker issues, which were solved by downgrading Xcode. After downgrading to 14.3.0 I was able to compile the code. Did anyone run into the same Problem? If so, is there a better solution for this?
Best regards
Xcode 15, and its associated Command Line Tools package, includes a new linker implementation. See here.
I recommend that you temporarily switch to the old linker implementation. I suspect that’ll avoid this crash.
If it does, please file a bug about this. My experience is that problems like this are usually caused by third-party tools generating incorrect Mach-O object files but:
-
The linker team needs to look at this, just to be sure.
-
Even if it is, the linker probably shouldn’t crash (-:
Please post your bug number, just for the record.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"