DPDK patches and discussions
 help / color / mirror / Atom feed
From: Rafael Avila de Espindola <espindola@scylladb.com>
To: Thomas Monjalon <thomas@monjalon.net>
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH] Don't combine '-r' and '--export-dynamic' linker options
Date: Thu, 12 Dec 2019 09:44:18 -0800	[thread overview]
Message-ID: <87a77xcubx.fsf@espindo.la> (raw)
In-Reply-To: <10040104.KzNOl4Vb3s@xps>

Thomas Monjalon <thomas@monjalon.net> writes:

> 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?

Sure, that works. I will send a v2.

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

As far as I can tell meson produces a .a file instead. In the
build.ninja file I see

build drivers/librte_pmd_dpaa_event.a: STATIC_LINKER drivers/a715181@@rte_pmd_dpaa_event@sta/meson-generated_.._rte_pmd_dpaa_event.pmd.c.o drivers/a715181@@tmp_rte_pmd_dpaa_event@sta/event_dpaa_dpaa_eventdev.c.o

and

rule STATIC_LINKER
 command = rm -f $out && gcc-ar $LINK_ARGS $out $in

Cheers,
Rafael

  reply	other threads:[~2019-12-13 14:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-25  1:20 Rafael Ávila de Espíndola
2019-12-06 22:51 ` Rafael Avila de Espindola
2019-12-12 16:05 ` Thomas Monjalon
2019-12-12 17:44   ` Rafael Avila de Espindola [this message]
2019-12-13 10:07   ` Ray Kinsella

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87a77xcubx.fsf@espindo.la \
    --to=espindola@scylladb.com \
    --cc=dev@dpdk.org \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).