[llvm] [LTO] Drop the weak function if there is a non-weak global symbol (PR #76287)

Quentin Dian via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 26 17:27:28 PST 2023


DianQK wrote:

> The new LTO api used by lld, gold plugin, and llvm-lto2 handle this already.

If I understand correctly, the new LTO gives control of symbol resolution to the caller? This way rustc can choose which symbols to use, just like llvm-lto2 or lld.

> Looking at the linked earlier alternative PR, it looks like this is to fix rust LTO linking that uses llvm-link directly? Here though the tests use llvm-lto. Is rust using one of these tools or is it interfacing with the module linking directly via LLVM libraries?

@bjorn3 has provided a detailed explanation. The current behavior is more like the legacy LTO.

> I'm really not sure where in the legacy LTO this handling should go. Note that llvm-lto already creates an LTOModule that contains a ModuleSymbolTable that already has these asm symbols.

So will we continue to maintain the legacy LTO?



https://github.com/llvm/llvm-project/pull/76287


More information about the llvm-commits mailing list