Believe_it0215 wrote:
What if I don't have Xcode installed in my Mac ventura 13.6 but facing
the same issue?
macOS doesn’t ship with a linker, so you must have installed one. If you don’t have Xcode, it’s likely that you installed the Command Line Tools package. There’s a separate Command Line Tools package associated with each Xcode version. So, for example, Xcode 15 is associated with Command Line Tools for Xcode 15.
The Command Line Tools for Xcode 15 package has the same linker as Xcode 15, and thus everything I say about Xcode 15 applies to it as well.
peterisledins1 you wrote:
I think I am seeing couple of other issues as well with this new linker:
OK. My advice is that you:
-
Reproduce the problem with Xcode 15, or its associated Command Line Tools.
-
Use the option documented in the release notes to switch to the old linker implementation.
-
If that resolves your issues, it’s very likely that they’re tied to the new linker implementation. You can then file a bug on that basis.
-
And using the old linker implementation is a reasonable temporary solution.
If you do file a bug, please post the number here, just for the record.
Oh, I wanna stress that not all of these problems are caused by bugs in the new linker implementation. The one that started this thread most definitely is, because the linker shouldn’t crash in the face of bad input. However, it’s quite possible that these failures are caused by other tools generating bad input that the linker now detects.
However, unless you’re a linker expert it’s hard to know what’s really going on, which is why I’m recommending that folks file bugs. Your bug may well come back as ‘behaves correctly’, with an explanation of what’s causing the problem. Or, in the case of the crash that started this thread, the fix might be for the linker to emit a diagnostic rather than crash, and then you need to talk to vendor of the tool that generate the bug input.
One universal truth about linkers is that no one cares about them until things go wrong (-:
If you file a bug against the linker, there are two things you can do to speed up the investigation. The first is to include a small set of steps to reproduce the problem. Ideally your steps shouldn’t rely on installing complex third-party tooling.
If that’s not feasible, attach a linker snapshot to your bug report. To generate this, pass the -debug_snapshot
flag to the linker. That’ll create a directory with a name like /tmp/NNN-DDD-TTT.ld-snapshot
, where NNN
is the linked name and DDD-TTT
is the time and day. Zip that up and attach it to your bug.
If you’re using a wrapper around the linker, you’ll need to arrange to pass the -debug_snapshot
flag through to the linker:
-
In Xcode, add -Wl,-debug_snapshot
to the Other Linker Flags build setting.
-
For the clang
tool, pass in the options -Xlinker -debug_snapshot
.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"
-lstdc++
if you use cmake, you can add "set(CMAKE_CXX_FLAGS "-no-pie")", and it works.
I am using VS Code for programming in c++, and I am using gcc/g++ 13.2.0 installed via homebrew. It was working perfectly fine. After update I am unable to compile or run any program.
What should I do to solve this issue?