[llvm-commits] [lto][patch] Remove weak attempt of tracking symbols defined in module level assembly

Devang Patel dpatel at apple.com
Mon Feb 21 11:46:15 PST 2011


On Feb 20, 2011, at 10:40 AM, Chris Lattner wrote:

> On Feb 19, 2011, at 6:35 PM, Rafael Ávila de Espíndola wrote:
> 
>>> I agree that the heuristic is a gross hack, but this will break
>>> building llvm itself with LTO, since the JIT defines a symbol (for
>>> the compilation callback) in file scope inline asm.
>> 
>> Why would this break the build? If a symbol is not present in the IL but
>> shows up in the final .o produce by LTO, the linker should still put in
>> in the binary.

If linker runs its own dead code strip pass then it may rip this out unless it is informed about it in advance. Usually, linker keeps track of symbols not to through out and everything else disappears.

This patch may not be the most elegant, but if a linker queries about symbols defined in a llvm::Module then that query should appropriately include module asm symbols such that the linker can make sense of their names.
-
Devang

> I don't know.  Devang, you added this code to get llvm to build with LTO, do you remember?  Can we just rip it out?





More information about the llvm-commits mailing list