[dpdk-dev] mk: fix extra options when linking lib through compiler

Message ID 1448028175-22022-1-git-send-email-thomas.monjalon@6wind.com (mailing list archive)
State Accepted, archived
Headers

Commit Message

Thomas Monjalon Nov. 20, 2015, 2:02 p.m. UTC
  When using a linker option not known by the compiler like -rpath,
the library linkage was failing.
It is fixed by prefixing the option with -Wl, as it is done in other
makefiles.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
---
 mk/rte.lib.mk | 1 +
 1 file changed, 1 insertion(+)
  

Comments

Olivier Matz Nov. 20, 2015, 3:40 p.m. UTC | #1
Hi,

On 11/20/2015 03:02 PM, Thomas Monjalon wrote:
> When using a linker option not known by the compiler like -rpath,
> the library linkage was failing.
> It is fixed by prefixing the option with -Wl, as it is done in other
> makefiles.
> 
> Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
> ---
>  mk/rte.lib.mk | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/mk/rte.lib.mk b/mk/rte.lib.mk
> index fcc8e20..06a1519 100644
> --- a/mk/rte.lib.mk
> +++ b/mk/rte.lib.mk
> @@ -68,6 +68,7 @@ ifeq ($(LINK_USING_CC),1)
>  # Override the definition of LD here, since we're linking with CC
>  LD := $(CC) $(CPU_CFLAGS)
>  _CPU_LDFLAGS := $(call linkerprefix,$(CPU_LDFLAGS))
> +override EXTRA_LDFLAGS := $(call linkerprefix,$(EXTRA_LDFLAGS))
>  else
>  _CPU_LDFLAGS := $(CPU_LDFLAGS)
>  endif
> 

Acked-by: Olivier Matz <olivier.matz@6wind.com>
  
Thomas Monjalon Nov. 20, 2015, 4:17 p.m. UTC | #2
2015-11-20 16:40, Olivier MATZ:
> On 11/20/2015 03:02 PM, Thomas Monjalon wrote:
> > When using a linker option not known by the compiler like -rpath,
> > the library linkage was failing.
> > It is fixed by prefixing the option with -Wl, as it is done in other
> > makefiles.
> > 
> > Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
> 
> Acked-by: Olivier Matz <olivier.matz@6wind.com>

Applied
  

Patch

diff --git a/mk/rte.lib.mk b/mk/rte.lib.mk
index fcc8e20..06a1519 100644
--- a/mk/rte.lib.mk
+++ b/mk/rte.lib.mk
@@ -68,6 +68,7 @@  ifeq ($(LINK_USING_CC),1)
 # Override the definition of LD here, since we're linking with CC
 LD := $(CC) $(CPU_CFLAGS)
 _CPU_LDFLAGS := $(call linkerprefix,$(CPU_LDFLAGS))
+override EXTRA_LDFLAGS := $(call linkerprefix,$(EXTRA_LDFLAGS))
 else
 _CPU_LDFLAGS := $(CPU_LDFLAGS)
 endif