We are also having this problem on Scala Native with LTO thin as detailed in this ticket.
https://github.com/scala-native/scala-native/issues/2779
This also happens with brew installed toolchain.
% clang --version
Homebrew clang version 14.0.6
Target: arm64-apple-darwin21.6.0
Thread model: posix
InstalledDir: /opt/homebrew/opt/llvm/bin
I could probably create a small reproduction if needed.
Post
Replies
Boosts
Views
Activity
Yes, using the Apple tools I get the following:
Here is my tools version and I am on OS version 12.6.3
% clang --version
Apple clang version 14.0.0 (clang-1400.0.29.202)
Target: arm64-apple-darwin21.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
Here is the command issued:
clang++
-rdynamic
-flto=thin
-o
<omited>/scala-native/sandbox/.3/target/scala-3.1.3/native/Test
-Wno-override-module
<omited> all .o file
-L/usr/local/lib
-L/opt/homebrew/lib
-lpthread
-ldl
-lpthread
Here is the output:
[info] Compiling to native code (1967 ms)
[error] 0 0x104efc0c0 __assert_rtn + 140
[error] 1 0x104f05038 ld::tool::SymbolTableAtom<arm64>::addImport(ld::Atom const*, ld::tool::StringPoolAtom*) (.cold.1) + 0
[error] 2 0x104e0ef90 ld::tool::SymbolTableAtom<arm64>::addGlobal(ld::Atom const*, ld::tool::StringPoolAtom*) + 1176
[error] 3 0x104e0e640 ld::tool::SymbolTableAtom<arm64>::encode() + 216
[error] 4 0x104dfb23c ___ZN2ld4tool10OutputFile20buildLINKEDITContentERNS_8InternalE_block_invoke_3 + 36
[error] 5 0x18687a5f0 _dispatch_call_block_and_release + 32
[error] 6 0x18687c1b4 _dispatch_client_callout + 20
[error] 7 0x18688db14 _dispatch_root_queue_drain + 952
[error] 8 0x18688e104 _dispatch_worker_thread2 + 164
[error] 9 0x186a3c324 _pthread_wqthread + 228
[error] A linker snapshot was created at:
[error] /tmp/Test-2023-03-20-085021.ld-snapshot
[error] ld: Assertion failed: (_machoSection != 0), function machoSection, file ld.hpp, line 1311.
[error] clang: error: linker command failed with exit code 1 (use -v to see invocation)