skip to Main Content

My Mac updated Xcode to version 14.0. After installing the new command line tools I started running into issues with the version of ld that it ships with. More specifically I have a project I compile with the g++-12 compiler (installed via homebrew) and the linker bombs when I try to compile anything with the following output:

[  0%] Linking CXX shared library ../../lib/libeckit.dylib
0  0x10675fffa  __assert_rtn + 139
1  0x10659328d  mach_o::relocatable::Parser<x86_64>::parse(mach_o::relocatable::ParserOptions const&) + 4989
2  0x106583f8f  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  0x1065fa9d4  ld::tool::InputFiles::makeFile(Options::FileInfo const&, bool) + 2036
4  0x1065fdfa0  ___ZN2ld4tool10InputFilesC2ER7Options_block_invoke + 48
5  0x7ff80248534a  _dispatch_client_callout2 + 8
6  0x7ff8024968f5  _dispatch_apply_invoke + 213
7  0x7ff802485317  _dispatch_client_callout + 8
8  0x7ff802494c0c  _dispatch_root_queue_drain + 673
9  0x7ff80249525c  _dispatch_worker_thread2 + 160
10  0x7ff802638f8a  _pthread_wqthread + 256
A linker snapshot was created at:
        /tmp/libeckit.dylib-2022-09-15-112741.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[2]: *** [lib/libeckit.dylib] Error 1

I’ve tried reinstalling all the home-brew packages but this didn’t seem to affect anything.

3

Answers


  1. I do not have an answer but I’m seeing a similar problem with GCC-11.

    0  0x1024dcffa  __assert_rtn + 139
    1  0x10231028d  mach_o::relocatable::Parser<x86_64>::parse(mach_o::relocatable::ParserOptions const&) + 4989
    2  0x102300f8f  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  0x10234e404  archive::File<x86_64>::makeObjectFileForMember(archive::File<x86_64>::Entry const*) const + 1268
    4  0x10234da8b  archive::File<x86_64>::File(unsigned char const*, unsigned long long, char const*, long, ld::File::Ordinal, archive::ParserOptions const&) + 1035
    5  0x10234cc72  archive::parse(unsigned char const*, unsigned long long, char const*, long, ld::File::Ordinal, archive::ParserOptions const&) + 146
    6  0x102377c8e  ld::tool::InputFiles::makeFile(Options::FileInfo const&, bool) + 2734
    7  0x10237afa0  ___ZN2ld4tool10InputFilesC2ER7Options_block_invoke + 48
    8  0x7ff80418134a  _dispatch_client_callout2 + 8
    9  0x7ff8041928f5  _dispatch_apply_invoke + 213
    10  0x7ff804181317  _dispatch_client_callout + 8
    11  0x7ff804190c0c  _dispatch_root_queue_drain + 673
    12  0x7ff80419125c  _dispatch_worker_thread2 + 160
    13  0x7ff804334f8a  _pthread_wqthread + 256
    A linker snapshot was created at:
            /tmp/SendData-2022-09-17-202519.ld-snapshot
    ld: Assertion failed: (_file->_atomsArrayCount == computedAtomCount && "more atoms allocated than expected"), function parse, file macho_relocatable_file.cpp, line 2061
    
    Details of my OS:
    nd Mac OS with following details.
    System Version: macOS 12.6 (21G115)
          Kernel Version: Darwin 21.6.0
     Model Name: MacBook Pro
          Model Identifier: MacBookPro15,1
          Processor Name: 8-Core Intel Core i9
          Processor Speed: 2.4 GHz
          Number of Processors: 1
          Total Number of Cores: 8
          L2 Cache (per Core): 256 KB
          L3 Cache: 16 MB
          Hyper-Threading Technology: Enabled
          Memory: 32 GB
          System Firmware Version: 1731.140.2.0.0 (iBridge: 19.16.16067.0.0,0)
          OS Loader Version: 540.120.3~22
    
    Login or Signup to reply.
  2. I also had the same problem with GCC-11, but upgraded via brew to GCC-12 in hopes that it would solve the problem. No joy.

    Login or Signup to reply.
  3. This seems to be a recent linker bug, I have found a few references, and I think this SO thread describes a downgrade of xcode/command line tools to work around it until the bug is fixed in xcode 14.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search