尝试编译一个简单的 Ada 程序,在 M2 MBP 上的 OS 14.1 (23B73) 中出现 GNAT 编译错误

问题描述 投票:0回答:1
❯ alr build
ⓘ Building myproj/myproj.gpr...
Link
   [link]         myproj.adb
0  0x10034af43  __assert_rtn + 64
1  0x10024cf43  ld::AtomPlacement::findAtom(unsigned char, unsigned long long, ld::AtomPlacement::AtomLoc const*&, long long&) const + 1411
2  0x100269431  ld::InputFiles::SliceParser::parseObjectFile(mach_o::Header const*) const + 19745
3  0x100279e44  ld::InputFiles::parseAllFiles(void (ld::AtomFile const*) block_pointer)::$_7::operator()(unsigned long, ld::FileInfo const&) const + 1380
4  0x7ff8051315cd  _dispatch_client_callout2 + 8
5  0x7ff805141e3e  _dispatch_apply_invoke + 214
6  0x7ff80513159a  _dispatch_client_callout + 8
7  0x7ff80514099d  _dispatch_root_queue_drain + 879
8  0x7ff805140f22  _dispatch_worker_thread2 + 152
9  0x7ff8052d5c06  _pthread_wqthread + 262
ld: Assertion failed: (resultIndex < sectData.atoms.size()), function findAtom, file Relocations.cpp, line 1336.
collect2: error: ld returned 1 exit status
gprbuild: link of myproj.adb failed
gprbuild: failed command was: /users/sdey02/.config/alire/cache/dependencies/gnat_native_13.2.1_c21501ad/bin/gcc myproj.o b__myproj.o -L/Users/sdey02/myproj/obj/development/ -L/Users/sdey02/myproj/obj/development/ -L/users/sdey02/.config/alire/cache/dependencies/gnat_native_13.2.1_c21501ad/lib/gcc/x86_64-apple-darwin21.6.0/13.2.0/adalib/ /users/sdey02/.config/alire/cache/dependencies/gnat_native_13.2.1_c21501ad/lib/gcc/x86_64-apple-darwin21.6.0/13.2.0/adalib/libgnat.a -Wl,-rpath,@executable_path/..//obj/development -Wl,-rpath,@executable_path/../..//.config/alire/cache/dependencies/gnat_native_13.2.1_c21501ad/lib/gcc/x86_64-apple-darwin21.6.0/13.2.0/adalib -o /Users/sdey02/myproj/bin//myproj
error: Command ["gprbuild", "-s", "-j0", "-p", "-P", "/Users/sdey02/myproj/myproj.gpr"] exited with code 4
error: Compilation failed.

错误似乎是这样的:

ld: Assertion failed: (resultIndex < sectData.atoms.size()), function findAtom, file Relocations.cpp, line 1336.

我运行了 alr build 命令并期望构建板条箱,但结果却退出并出现代码 4 错误。

我检查了其他线程,这似乎是最新版本的命令行工具的问题。我有什么选择来解决这个问题?

macos ada
1个回答
0
投票

尝试将

-Wl,-ld_classic
添加到链接器开关:

alr build -- -largs -Wl,-ld_classic

更多详情:

© www.soinside.com 2019 - 2024. All rights reserved.