[dpdk-dev] [PATCH] Don't combine '-r' and '--export-dynamic' linker options

Ray Kinsella mdr at ashroe.eu
Fri Dec 13 11:07:44 CET 2019



On 12/12/2019 16:05, Thomas Monjalon wrote:
> 25/10/2019 03:20, Rafael Ávila de Espíndola:
>> Running ld with '-r' switches the linker to a very special mode where
>> some other linker options don't make sense.
>>
>> In particular, '--export-dynamic' normally requires that all global
>> symbols be included in the dynamic symbol table, but a .o file doesn't
>> even have a dynamic symbol table.
>>
>> When given both options it looks like the gnu linker just ignores
>> '--export-dynamic'.
>>
>> Unfortunately some versions of lld (https://lld.llvm.org/) have a bug
>> that causes it to try to create a dynamic symbol table in the output
>> .o file and ends up corrupting it
>> (https://bugs.llvm.org/show_bug.cgi?id=43552). Current (git) version
>> of lld now issues an error.
>>
>> This patch drops $(LDFLAGS) when using -r. With this patch I can build
>> dpdk with lld.
> [...]
>> -PMDINFO_LD = $(CROSS)ld $(LDFLAGS) -r -o $@.o $@.pmd.o $@
>> +PMDINFO_LD = $(CROSS)ld -r -o $@.o $@.pmd.o $@
> 
> Dealing with compiler bugs is really annoying.
> I'm afraid removing LDFLAGS may break in some environments.
> Could you just filter-out some incompatible options?

Right, detect that LLD is the linker and change LDFLAGS accordingly.
Painful, but the right approach.

> 
> And what about meson? Is there some similar issue?
> 
> 
> 


More information about the dev mailing list