我的Mac将Xcode更新为14.0版。在安装了新的命令行工具之后,我开始遇到它附带的ld版本的问题。更具体地说,我有一个用g++-12编译器(通过自制安装)和链接器炸弹编译的项目,当我试图编译具有以下输出的任何内容时:
[ 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我试过重新安装所有的家庭酿造包,但这似乎没有任何影响。
发布于 2022-09-28 14:41:38
这似乎是最近的链接器错误,我发现了一些引用,我认为this SO thread描述了xcode /命令行工具的降级,直到在xcode 14中修复了bug为止。
发布于 2022-09-18 00:30:56
我没有答案,但我发现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发布于 2022-09-19 13:57:55
我对GCC-11也有同样的问题,但通过brew升级到GCC-12,希望它能解决这个问题。不是joy。
https://stackoverflow.com/questions/73734125
复制相似问题