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

Devang Patel dpatel at apple.com
Mon Feb 21 16:01:17 PST 2011


On Feb 21, 2011, at 3:54 PM, Rafael Ávila de Espíndola wrote:

> On 2011-02-21 14:46, Devang Patel wrote:
>> 
>> 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.
> 
> OK, so it is a limitation of the Apple linker.

I may have missed some context here, but why is it a bug anywhere to include asm global in symbols list ? The symbols list is the list of the symbols linker would normally find in .o file if LTO is not used.
-
Devang

> 
> Given that this produces wrong (and more confusing) results in the
> example I posted, would it be OK for this to be conditional on a Mach-O
> target until we switch libLTO to use MC?
> 
>> - Devang
>> 
> 
> Cheers,
> Rafael





More information about the llvm-commits mailing list