[llvm-commits] [lto][patch] Remove weak attempt of tracking symbols defined in module level assembly
Rafael Ávila de Espíndola
rafael.espindola at gmail.com
Mon Feb 21 15:54:53 PST 2011
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.
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