[llvm] [ORC] Use __unw_add_dynamic_eh_frame_section/__unw_remove_dynamic_eh_ frame_section in RegisterEHFrames.cpp (PR #212260)
Martin Storsjö via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 2 00:59:11 PDT 2026
mstorsjo wrote:
> I think the Darwin failure might have been caused by using `weak` instead of `weak_import` -- I need to investigate that.
I think the thing is that Darwin / MachO does support weak symbols, but with slightly different semantics. If you reference a symbol as weak, it's ok if it's not found at runtime. But the symbol must exist at link time - it doesn't work for a symbol which can't be found at all. So it works if you link with a newer library interface definition but may run on an older version.
(I think one reason for this is that MachO by default uses two level namespaces - each symbol which is to be loaded at runtime also is marked to be loaded from one specific dynamic library. If the symbol can't be resolved at link time, the linker doesn't know which library it should be tentatively imported from.)
https://github.com/llvm/llvm-project/pull/212260
More information about the llvm-commits
mailing list