From: "Ananyev, Konstantin" <konstantin.ananyev@intel.com>
To: Thomas Monjalon <thomas.monjalon@6wind.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] eal: fix c++ compilation issue with rte_delay_us()
Date: Wed, 5 Oct 2016 10:17:40 +0000 [thread overview]
Message-ID: <2601191342CEEE43887BDE71AB9772583F0BE68F@irsmsx105.ger.corp.intel.com> (raw)
In-Reply-To: <1492896.7EzNbMBhFc@xps13>
Hi Thomas,
>
> 2016-10-03 18:27, Konstantin Ananyev:
> > When compiling with C++, it treats
> > void (*rte_delay_us)(unsigned int us);
> > as definition of the global variable.
> > So further linking with librte_eal fails.
> >
> > Fixes: b4d63fb62240 ("eal: customize delay function")
>
> Applied, thanks
>
> I don't understand why it was not failing with C compilation?
Don't know off hand.
Yes, I would expect gcc to fail with same symptoms too.
But by some reason it puts it makes it a 'common' symbol:
$ cat rttm1.c
#include <stdio.h>
#include <rte_eal.h>
#include <rte_cycles.h>
int main(int argc, char *argv[])
{
int ret = rte_eal_init(argc, argv);
rte_delay_us(1);
printf("return code: %d\n", ret);
return ret;
}
$ gcc -m64 -pthread -o rttm1 rttm1.o -ldl -L/${RTE_SDK}/${RTE_TARGET}/lib -Wl,-lrte_eal
$ nm rttm1.o | grep rte_delay_us
0000000000000008 C rte_delay_us
Konstantin
prev parent reply other threads:[~2016-10-05 10:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-03 17:27 Konstantin Ananyev
2016-10-05 9:23 ` Thomas Monjalon
2016-10-05 10:17 ` Ananyev, Konstantin [this message]
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=2601191342CEEE43887BDE71AB9772583F0BE68F@irsmsx105.ger.corp.intel.com \
--to=konstantin.ananyev@intel.com \
--cc=dev@dpdk.org \
--cc=thomas.monjalon@6wind.com \
/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).