[dpdk-dev] mk: fix LDFLAGS for shared lib

Message ID 7F861DC0615E0C47A872E6F3C5FCDDBD05DCB8C6@BPXM14GP.gisp.nec.co.jp (mailing list archive)
State Accepted, archived
Headers

Commit Message

Hiroshi Shimamoto Dec. 3, 2014, 11:33 p.m. UTC
  From: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>

Only CPU_LDFLAGS is used in mk/rte.sharelib.mk.
It should be LDFLAGS to build the library with correct linkage options.

Signed-off-by: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
Reviewed-by: Hayato Momma <h-momma@ce.jp.nec.com>
---
 mk/rte.sharelib.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Neil Horman Dec. 8, 2014, 3:01 p.m. UTC | #1
On Wed, Dec 03, 2014 at 11:33:54PM +0000, Hiroshi Shimamoto wrote:
> From: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
> 
> Only CPU_LDFLAGS is used in mk/rte.sharelib.mk.
> It should be LDFLAGS to build the library with correct linkage options.
> 
> Signed-off-by: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
> Reviewed-by: Hayato Momma <h-momma@ce.jp.nec.com>
> 
> ---
> mk/rte.sharelib.mk | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mk/rte.sharelib.mk b/mk/rte.sharelib.mk
> index c0a811a..df6c268 100644
> --- a/mk/rte.sharelib.mk
> +++ b/mk/rte.sharelib.mk
> @@ -45,7 +45,7 @@ sharelib: $(LIB_ONE) FORCE
>  
>  OBJS = $(wildcard $(RTE_OUTPUT)/build/lib/*.o)
>  
> -O_TO_S = $(LD) $(CPU_LDFLAGS) -shared $(OBJS) -o $(RTE_OUTPUT)/lib/$(LIB_ONE)
> +O_TO_S = $(LD) $(LDFLAGS) -shared $(OBJS) -o $(RTE_OUTPUT)/lib/$(LIB_ONE)
>  O_TO_S_STR = $(subst ','\'',$(O_TO_S)) #'# fix syntax highlight
>  O_TO_S_DISP = $(if $(V),"$(O_TO_S_STR)","  LD $(@)")
>  O_TO_S_CMD = "cmd_$@ = $(O_TO_S_STR)"

Does this continue to work on cross compiled arches (32 bit on 64 bit systems
and vice versa)?  I have this recollection that something in CPU_LDFLAGS was
needed
Neil
  
Hiroshi Shimamoto Dec. 8, 2014, 11:44 p.m. UTC | #2
> Subject: Re: [dpdk-dev] mk: fix LDFLAGS for shared lib
> 
> On Wed, Dec 03, 2014 at 11:33:54PM +0000, Hiroshi Shimamoto wrote:
> > From: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
> >
> > Only CPU_LDFLAGS is used in mk/rte.sharelib.mk.
> > It should be LDFLAGS to build the library with correct linkage options.
> >
> > Signed-off-by: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
> > Reviewed-by: Hayato Momma <h-momma@ce.jp.nec.com>
> >
> > ---
> > mk/rte.sharelib.mk | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/mk/rte.sharelib.mk b/mk/rte.sharelib.mk
> > index c0a811a..df6c268 100644
> > --- a/mk/rte.sharelib.mk
> > +++ b/mk/rte.sharelib.mk
> > @@ -45,7 +45,7 @@ sharelib: $(LIB_ONE) FORCE
> >
> >  OBJS = $(wildcard $(RTE_OUTPUT)/build/lib/*.o)
> >
> > -O_TO_S = $(LD) $(CPU_LDFLAGS) -shared $(OBJS) -o $(RTE_OUTPUT)/lib/$(LIB_ONE)
> > +O_TO_S = $(LD) $(LDFLAGS) -shared $(OBJS) -o $(RTE_OUTPUT)/lib/$(LIB_ONE)
> >  O_TO_S_STR = $(subst ','\'',$(O_TO_S)) #'# fix syntax highlight
> >  O_TO_S_DISP = $(if $(V),"$(O_TO_S_STR)","  LD $(@)")
> >  O_TO_S_CMD = "cmd_$@ = $(O_TO_S_STR)"
> 
> Does this continue to work on cross compiled arches (32 bit on 64 bit systems
> and vice versa)?  I have this recollection that something in CPU_LDFLAGS was
> needed

yes, LDFLAGS must contain CPU_LDFLAGS.

mk/target/generic/rte.vars.mk:# merge all LDFLAGS
mk/target/generic/rte.vars.mk:LDFLAGS := $(CPU_LDFLAGS) $(EXECENV_LDFLAGS) $(TOOLCHAIN_LDFLAGS) $(MACHINE_LDFLAGS)
mk/target/generic/rte.vars.mk:LDFLAGS += $(TARGET_LDFLAGS)

thanks,
Hiroshi

> Neil
  
Thomas Monjalon Dec. 11, 2014, 12:46 a.m. UTC | #3
2014-12-08 23:44, Hiroshi Shimamoto:
> > On Wed, Dec 03, 2014 at 11:33:54PM +0000, Hiroshi Shimamoto wrote:
> > > From: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
> > >
> > > Only CPU_LDFLAGS is used in mk/rte.sharelib.mk.
> > > It should be LDFLAGS to build the library with correct linkage options.
> > >
> > > Signed-off-by: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
> > > Reviewed-by: Hayato Momma <h-momma@ce.jp.nec.com>
> > >
> > > ---
> > > mk/rte.sharelib.mk | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/mk/rte.sharelib.mk b/mk/rte.sharelib.mk
> > > index c0a811a..df6c268 100644
> > > --- a/mk/rte.sharelib.mk
> > > +++ b/mk/rte.sharelib.mk
> > > @@ -45,7 +45,7 @@ sharelib: $(LIB_ONE) FORCE
> > >
> > >  OBJS = $(wildcard $(RTE_OUTPUT)/build/lib/*.o)
> > >
> > > -O_TO_S = $(LD) $(CPU_LDFLAGS) -shared $(OBJS) -o $(RTE_OUTPUT)/lib/$(LIB_ONE)
> > > +O_TO_S = $(LD) $(LDFLAGS) -shared $(OBJS) -o $(RTE_OUTPUT)/lib/$(LIB_ONE)
> > >  O_TO_S_STR = $(subst ','\'',$(O_TO_S)) #'# fix syntax highlight
> > >  O_TO_S_DISP = $(if $(V),"$(O_TO_S_STR)","  LD $(@)")
> > >  O_TO_S_CMD = "cmd_$@ = $(O_TO_S_STR)"
> > 
> > Does this continue to work on cross compiled arches (32 bit on 64 bit systems
> > and vice versa)?  I have this recollection that something in CPU_LDFLAGS was
> > needed
> 
> yes, LDFLAGS must contain CPU_LDFLAGS.
> 
> mk/target/generic/rte.vars.mk:# merge all LDFLAGS
> mk/target/generic/rte.vars.mk:LDFLAGS := $(CPU_LDFLAGS) $(EXECENV_LDFLAGS) $(TOOLCHAIN_LDFLAGS) $(MACHINE_LDFLAGS)
> mk/target/generic/rte.vars.mk:LDFLAGS += $(TARGET_LDFLAGS)

Applied

Thanks
  

Patch

diff --git a/mk/rte.sharelib.mk b/mk/rte.sharelib.mk
index c0a811a..df6c268 100644
--- a/mk/rte.sharelib.mk
+++ b/mk/rte.sharelib.mk
@@ -45,7 +45,7 @@  sharelib: $(LIB_ONE) FORCE
 
 OBJS = $(wildcard $(RTE_OUTPUT)/build/lib/*.o)
 
-O_TO_S = $(LD) $(CPU_LDFLAGS) -shared $(OBJS) -o $(RTE_OUTPUT)/lib/$(LIB_ONE)
+O_TO_S = $(LD) $(LDFLAGS) -shared $(OBJS) -o $(RTE_OUTPUT)/lib/$(LIB_ONE)
 O_TO_S_STR = $(subst ','\'',$(O_TO_S)) #'# fix syntax highlight
 O_TO_S_DISP = $(if $(V),"$(O_TO_S_STR)","  LD $(@)")
 O_TO_S_CMD = "cmd_$@ = $(O_TO_S_STR)"