From: Thomas Monjalon <thomas@monjalon.net>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH] mk: add EXTRA_CFLAGS to link step for shared library
Date: Mon, 25 Nov 2019 23:56:00 +0100 [thread overview]
Message-ID: <2247185.beDHgelkcT@xps> (raw)
In-Reply-To: <20191105015642.17385-1-stephen@networkplumber.org>
05/11/2019 02:56, Stephen Hemminger:
> When doing a cross compiling it is common to use EXTRA_CFLAGS with
> --sysroot option to point to alternate root filesystem. This already
> works as expected for objects and executables, it just doesn't work
> correctly for shared libraries.
>
> When a shared library is linked using CC this flag needs to
> be passed in order for libraries to be found.
>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
> --- a/mk/rte.shared.mk
> +++ b/mk/rte.shared.mk
> -O_TO_SO = $(CC) $(call linkerprefix,$(LDFLAGS)) $(LDFLAGS_$(@)) $(EXTRA_LDFLAGS) \
> +O_TO_SO = $(CC) $(EXTRA_CFLAGS) $(call linkerprefix,$(LDFLAGS)) $(LDFLAGS_$(@)) $(EXTRA_LDFLAGS) \
> -shared -o $@ $(OBJS-y) $(call linkerprefix,$(LDLIBS))
After several thoughts, I am afraid of the possible side effects
of such a change.
I think only LDFLAGS should be used when linking.
If you need the same parameters at compilation and linking,
you should pass the same parameters to CFLAGS and LDFLAGS.
next prev parent reply other threads:[~2019-11-25 22:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-05 1:56 Stephen Hemminger
2019-11-25 22:56 ` Thomas Monjalon [this message]
2019-11-26 1:44 ` Stephen Hemminger
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=2247185.beDHgelkcT@xps \
--to=thomas@monjalon.net \
--cc=dev@dpdk.org \
--cc=stephen@networkplumber.org \
/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).