[dpdk-dev] mk: use extra cflags when linking libs with a compiler

Message ID 1500995026-20707-1-git-send-email-gage.eads@intel.com (mailing list archive)
State Superseded, archived
Headers

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/Intel-compilation success Compilation OK

Commit Message

Eads, Gage July 25, 2017, 3:03 p.m. UTC
  When using the compiler to link libraries, include EXTRA_CFLAGS. This is
needed when cross-compiling to pass --sysroot, for example. GCC
cross-compilers built with Yocto don't use the --with-sysroot option,
making it necessary to pass the --sysroot command-line option.

This is the same solution as in commit e8fbb6d9cfd9 ("mk: use extra cflags
when linking with compiler"), but applied to libs instead of apps.
---
 mk/rte.lib.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Thomas Monjalon July 31, 2017, 9:44 p.m. UTC | #1
25/07/2017 17:03, Gage Eads:
> When using the compiler to link libraries, include EXTRA_CFLAGS. This is
> needed when cross-compiling to pass --sysroot, for example. GCC
> cross-compilers built with Yocto don't use the --with-sysroot option,
> making it necessary to pass the --sysroot command-line option.
> 
> This is the same solution as in commit e8fbb6d9cfd9 ("mk: use extra cflags
> when linking with compiler"), but applied to libs instead of apps.
> ---
>  mk/rte.lib.mk | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

You forgot the Signed-off-by line.
  
Eads, Gage July 31, 2017, 9:46 p.m. UTC | #2
Sure, will fix that now. I was just waiting for any other feedback to include in a v2.

> -----Original Message-----
> From: Thomas Monjalon [mailto:thomas@monjalon.net]
> Sent: Monday, July 31, 2017 4:44 PM
> To: Eads, Gage <gage.eads@intel.com>
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH] mk: use extra cflags when linking libs with a
> compiler
> 
> 25/07/2017 17:03, Gage Eads:
> > When using the compiler to link libraries, include EXTRA_CFLAGS. This
> > is needed when cross-compiling to pass --sysroot, for example. GCC
> > cross-compilers built with Yocto don't use the --with-sysroot option,
> > making it necessary to pass the --sysroot command-line option.
> >
> > This is the same solution as in commit e8fbb6d9cfd9 ("mk: use extra
> > cflags when linking with compiler"), but applied to libs instead of apps.
> > ---
> >  mk/rte.lib.mk | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> You forgot the Signed-off-by line.
  

Patch

diff --git a/mk/rte.lib.mk b/mk/rte.lib.mk
index bc2f2fb..13115d1 100644
--- a/mk/rte.lib.mk
+++ b/mk/rte.lib.mk
@@ -77,7 +77,7 @@  exe2cmd = $(strip $(call dotfile,$(patsubst %,%.cmd,$(1))))
 
 ifeq ($(LINK_USING_CC),1)
 # Override the definition of LD here, since we're linking with CC
-LD := $(CC) $(CPU_CFLAGS)
+LD := $(CC) $(CPU_CFLAGS) $(EXTRA_CFLAGS)
 _CPU_LDFLAGS := $(call linkerprefix,$(CPU_LDFLAGS))
 override EXTRA_LDFLAGS := $(call linkerprefix,$(EXTRA_LDFLAGS))
 else