[LLVMdev] Your commit 103140
Rafael Espíndola
rafael.espindola at gmail.com
Tue Mar 13 11:06:02 PDT 2012
On 13 March 2012 12:26, Duncan Sands <baldrick at free.fr> wrote:
> Hi Chris, your commit 103140 broke PR397 for llvm-gcc (in LLVM 2.9) and
> dragonegg. In the PR, asm renaming creates two linkonce functions with
> the same asm name (in the IR they are @"\01lstat64" and "@lstat64". What
> used to happen is that they were both output to the assembler file, both
> with the name lstat64, exactly like GCC does. The assembler and linker
> are perfectly happy about this, presumably because the functions have weak
> linkage. What happens now is that compilation fails with "label emitted
> multiple times to assembly file".
>
> Do you agree that it is reasonable to support outputting multiple functions
> with the same name, as long as they have weak linkage?
>
> Ciao, Duncan.
>
> PS: The alternative is to follow clang and have the front-end take care of
> dropping one of the functions, rather than leaving it to the linker.
If you can implement this I think it is better. Having two functions
with the same name can cause problems to libLTO for example. Which
function should it use?
Cheers,
Rafael
More information about the llvm-dev
mailing list