DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev]  [PATCH] app/testpmd: fix static build link ordering
@ 2017-01-12  7:46 Jerin Jacob
  2017-01-12  9:26 ` Thomas Monjalon
  2017-01-13 16:31 ` Thomas Monjalon
  0 siblings, 2 replies; 12+ messages in thread
From: Jerin Jacob @ 2017-01-12  7:46 UTC (permalink / raw)
  To: dev; +Cc: thomas.monjalon, ferruh.yigit, Jerin Jacob, stable

By introducing explicit -lrte_pmd_ixgbe link request in
testpmd Makefile,"-Wl,-lrte_pmd_ixgbe" provided twice, and linker
removes the duplication by keeping only first occurrence.
This moves "-Wl,-lrte_pmd_ixgbe" out of "-Wl,--whole-archive" flag
and makes symbol generation totally different than previous version
in case of static build.
This patch fixes the static build linking order by introducing
-lrte_pmd_ixgbe under the shared library config
(CONFIG_RTE_BUILD_SHARED_LIB).

Fixes: 425781ff5afe ("app/testpmd: add ixgbe VF management")

CC: stable@dpdk.org
Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
---
 app/test-pmd/Makefile | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/app/test-pmd/Makefile b/app/test-pmd/Makefile
index 5988c3e..050663a 100644
--- a/app/test-pmd/Makefile
+++ b/app/test-pmd/Makefile
@@ -59,7 +59,9 @@ SRCS-y += csumonly.c
 SRCS-y += icmpecho.c
 SRCS-$(CONFIG_RTE_LIBRTE_IEEE1588) += ieee1588fwd.c
 
+ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y)
 _LDLIBS-$(CONFIG_RTE_LIBRTE_IXGBE_PMD) += -lrte_pmd_ixgbe
+endif
 
 CFLAGS_cmdline.o := -D_GNU_SOURCE
 
-- 
2.5.5

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [dpdk-dev] [PATCH] app/testpmd: fix static build link ordering
  2017-01-12  7:46 [dpdk-dev] [PATCH] app/testpmd: fix static build link ordering Jerin Jacob
@ 2017-01-12  9:26 ` Thomas Monjalon
  2017-01-12 13:58   ` Jerin Jacob
  2017-01-13 16:31 ` Thomas Monjalon
  1 sibling, 1 reply; 12+ messages in thread
From: Thomas Monjalon @ 2017-01-12  9:26 UTC (permalink / raw)
  To: Jerin Jacob; +Cc: dev, ferruh.yigit, stable

2017-01-12 13:16, Jerin Jacob:
> +ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y)
>  _LDLIBS-$(CONFIG_RTE_LIBRTE_IXGBE_PMD) += -lrte_pmd_ixgbe
> +endif

_LDLIBS is an internal variable of rte.app.mk.
Please could you check that there is no issue when using LDLIBS instead
of _LDLIBS?
Thanks

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [dpdk-dev] [PATCH] app/testpmd: fix static build link ordering
  2017-01-12  9:26 ` Thomas Monjalon
@ 2017-01-12 13:58   ` Jerin Jacob
  2017-01-12 15:27     ` Ferruh Yigit
  0 siblings, 1 reply; 12+ messages in thread
From: Jerin Jacob @ 2017-01-12 13:58 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev, ferruh.yigit, stable

On Thu, Jan 12, 2017 at 10:26:08AM +0100, Thomas Monjalon wrote:
> 2017-01-12 13:16, Jerin Jacob:
> > +ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y)
> >  _LDLIBS-$(CONFIG_RTE_LIBRTE_IXGBE_PMD) += -lrte_pmd_ixgbe
> > +endif
> 
> _LDLIBS is an internal variable of rte.app.mk.
> Please could you check that there is no issue when using LDLIBS instead
> of _LDLIBS?

Tested it. Suggested change has issue in shared lib configuration.

[dpdk-master] $ git diff
diff --git a/app/test-pmd/Makefile b/app/test-pmd/Makefile
index 050663a..27cadd5 100644
--- a/app/test-pmd/Makefile
+++ b/app/test-pmd/Makefile
@@ -59,9 +59,7 @@ SRCS-y += csumonly.c
 SRCS-y += icmpecho.c
 SRCS-$(CONFIG_RTE_LIBRTE_IEEE1588) += ieee1588fwd.c
 
-ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y)
-_LDLIBS-$(CONFIG_RTE_LIBRTE_IXGBE_PMD) += -lrte_pmd_ixgbe
-endif
+LDLIBS-$(CONFIG_RTE_LIBRTE_IXGBE_PMD) += -lrte_pmd_ixgbe
 
 CFLAGS_cmdline.o := -D_GNU_SOURCE

[error]


gcc -Wp,-MD,./.iofwd.o.d.tmp  -m64 -pthread -fPIC  -march=native
-DRTE_MACHINE_CPUFLAG_SSE -DRTE_MACHINE_CPUFLAG_SSE2
-DRTE_MACHINE_CPUFLAG_SSE3 -DRTE_MACHINE_CPUFLAG_SSSE3
-DRTE_MACHINE_CPUFLAG_SSE4_1 -DRTE_MACHINE_CPUFLAG_SSE4_2
-DRTE_MACHINE_CPUFLAG_AES -DRTE_MACHINE_CPUFLAG_PCLMULQDQ
-DRTE_MACHINE_CPUFLAG_AVX -DRTE_MACHINE_CPUFLAG_RDRAND
-DRTE_MACHINE_CPUFLAG_FSGSBASE -DRTE_MACHINE_CPUFLAG_F16C
-DRTE_MACHINE_CPUFLAG_AVX2  -I/export/dpdk-master/build/include -include
/export/dpdk-master/build/include/rte_config.h -O3 -W -Wall
-Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations
-Wold-style-definition -Wpointer-arith -Wcast-align -Wnested-externs
-Wcast-qual -Wformat-nonliteral -Wformat-security -Wundef
-Wwrite-strings -Werror    -o iofwd.o -c
/export/dpdk-master/app/test-pmd/iofwd.c 
gcc -o testpmd -m64 -pthread -fPIC  -march=native
-DRTE_MACHINE_CPUFLAG_SSE -DRTE_MACHINE_CPUFLAG_SSE2
-DRTE_MACHINE_CPUFLAG_SSE3 -DRTE_MACHINE_CPUFLAG_SSSE3
-DRTE_MACHINE_CPUFLAG_SSE4_1 -DRTE_MACHINE_CPUFLAG_SSE4_2
-DRTE_MACHINE_CPUFLAG_AES -DRTE_MACHINE_CPUFLAG_PCLMULQDQ
-DRTE_MACHINE_CPUFLAG_AVX -DRTE_MACHINE_CPUFLAG_RDRAND
-DRTE_MACHINE_CPUFLAG_FSGSBASE -DRTE_MACHINE_CPUFLAG_F16C
-DRTE_MACHINE_CPUFLAG_AVX2  -I/export/dpdk-master/build/include -include
/export/dpdk-master/build/include/rte_config.h -O3 -W -Wall
-Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations
-Wold-style-definition -Wpointer-arith -Wcast-align -Wnested-externs
-Wcast-qual -Wformat-nonliteral -Wformat-security -Wundef
-Wwrite-strings -Werror testpmd.o parameters.o cmdline.o cmdline_flow.o
config.o iofwd.o macfwd.o macswap.o flowgen.o rxonly.o txonly.o
csumonly.o icmpecho.o -L/export/dpdk-master/build/lib -Wl,-lrte_kni
-Wl,-lrte_pipeline -Wl,-lrte_table -Wl,-lrte_port -Wl,-lrte_pdump
-Wl,-lrte_distributor -Wl,-lrte_reorder -Wl,-lrte_ip_frag
-Wl,-lrte_meter -Wl,-lrte_sched -Wl,-lrte_lpm -Wl,--whole-archive
-Wl,-lrte_acl -Wl,--no-whole-archive -Wl,-lrte_jobstats -Wl,-lrte_power
-Wl,--whole-archive -Wl,-lrte_timer -Wl,-lrte_hash -Wl,-lrte_vhost
-Wl,-lrte_kvargs -Wl,-lrte_mbuf -Wl,-lrte_net -Wl,-lrte_ethdev
-Wl,-lrte_cryptodev -Wl,-lrte_eventdev -Wl,-lrte_mempool -Wl,-lrte_ring
-Wl,-lrte_eal -Wl,-lrte_cmdline -Wl,-lrte_cfgfile -Wl,-lrte_pmd_bond
-Wl,--no-whole-archive -Wl,-lgcc_s -Wl,-ldl -Wl,-export-dynamic
-Wl,-export-dynamic -Wl,-export-dynamic -L/export/dpdk-master/build/lib
-Wl,--as-needed -Wl,-rpath=/export/dpdk-master/build/lib
-Wl,-Map=testpmd.map -Wl,--cref 
cmdline.o: In function `cmd_set_vf_vlan_anti_spoof_parsed':
cmdline.c:(.text+0x4b3a): undefined reference to
`rte_pmd_ixgbe_set_vf_vlan_anti_spoof'
cmdline.o: In function `cmd_set_vf_mac_anti_spoof_parsed':
cmdline.c:(.text+0x4c02): undefined reference to
`rte_pmd_ixgbe_set_vf_mac_anti_spoof'
cmdline.o: In function `cmd_set_vf_vlan_stripq_parsed':
cmdline.c:(.text+0x4cd2): undefined reference to
`rte_pmd_ixgbe_set_vf_vlan_stripq'
cmdline.o: In function `cmd_set_vf_split_drop_en_parsed':
cmdline.c:(.text+0x4da2): undefined reference to
`rte_pmd_ixgbe_set_vf_split_drop_en'
cmdline.o: In function `cmd_set_vf_vlan_insert_parsed':
cmdline.c:(.text+0x5eda): undefined reference to
`rte_pmd_ixgbe_set_vf_vlan_insert'
cmdline.o: In function `cmd_set_tx_loopback_parsed':
cmdline.c:(.text+0x5f8b): undefined reference to
`rte_pmd_ixgbe_set_tx_loopback'
cmdline.o: In function `cmd_set_all_queues_drop_en_parsed':
cmdline.c:(.text+0x604b): undefined reference to
`rte_pmd_ixgbe_set_all_queues_drop_en'
cmdline.o: In function `cmd_set_vf_mac_addr_parsed':
cmdline.c:(.text+0x60ea): undefined reference to
`rte_pmd_ixgbe_set_vf_mac_addr'
collect2: error: ld returned 1 exit status
/export/dpdk-master/mk/rte.app.mk:236: recipe for target 'testpmd'
failed
make[3]: *** [testpmd] Error 1
/export/dpdk-master/mk/rte.subdir.mk:61: recipe for target 'test-pmd'
failed
make[2]: *** [test-pmd] Error 2
/export/dpdk-master/mk/rte.sdkbuild.mk:78: recipe for target 'app'
failed
make[1]: *** [app] Error 2
/export/dpdk-master/mk/rte.sdkroot.mk:130: recipe for target 'all'
failed
make: *** [all] Error 2

 

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [dpdk-dev] [PATCH] app/testpmd: fix static build link ordering
  2017-01-12 13:58   ` Jerin Jacob
@ 2017-01-12 15:27     ` Ferruh Yigit
  2017-01-13  3:21       ` Jerin Jacob
  0 siblings, 1 reply; 12+ messages in thread
From: Ferruh Yigit @ 2017-01-12 15:27 UTC (permalink / raw)
  To: Jerin Jacob, Thomas Monjalon; +Cc: dev, stable

On 1/12/2017 1:58 PM, Jerin Jacob wrote:
> On Thu, Jan 12, 2017 at 10:26:08AM +0100, Thomas Monjalon wrote:
>> 2017-01-12 13:16, Jerin Jacob:
>>> +ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y)
>>>  _LDLIBS-$(CONFIG_RTE_LIBRTE_IXGBE_PMD) += -lrte_pmd_ixgbe
>>> +endif
>>
>> _LDLIBS is an internal variable of rte.app.mk.
>> Please could you check that there is no issue when using LDLIBS instead
>> of _LDLIBS?
> 
> Tested it. Suggested change has issue in shared lib configuration.
> 
> [dpdk-master] $ git diff
> diff --git a/app/test-pmd/Makefile b/app/test-pmd/Makefile
> index 050663a..27cadd5 100644
> --- a/app/test-pmd/Makefile
> +++ b/app/test-pmd/Makefile
> @@ -59,9 +59,7 @@ SRCS-y += csumonly.c
>  SRCS-y += icmpecho.c
>  SRCS-$(CONFIG_RTE_LIBRTE_IEEE1588) += ieee1588fwd.c
>  
> -ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y)
> -_LDLIBS-$(CONFIG_RTE_LIBRTE_IXGBE_PMD) += -lrte_pmd_ixgbe
> -endif
> +LDLIBS-$(CONFIG_RTE_LIBRTE_IXGBE_PMD) += -lrte_pmd_ixgbe

It is LDLIBS instead of LDLIBS-y, following may work:

-_LDLIBS-$(CONFIG_RTE_LIBRTE_IXGBE_PMD) += -lrte_pmd_ixgbe
+ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y)
+ifeq ($(CONFIG_RTE_LIBRTE_IXGBE_PMD),y)
+LDLIBS += -lrte_pmd_ixgbe
+endif
+endif


Also using EXTRA_LDLIBS instead of LDLIBS may remove the requirement of
the SHARED_LIB check, because of where it is located, but this seems
just coincidental.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [dpdk-dev] [PATCH] app/testpmd: fix static build link ordering
  2017-01-12 15:27     ` Ferruh Yigit
@ 2017-01-13  3:21       ` Jerin Jacob
  2017-01-13 15:53         ` Thomas Monjalon
  0 siblings, 1 reply; 12+ messages in thread
From: Jerin Jacob @ 2017-01-13  3:21 UTC (permalink / raw)
  To: Ferruh Yigit; +Cc: Thomas Monjalon, dev, stable

On Thu, Jan 12, 2017 at 03:27:30PM +0000, Ferruh Yigit wrote:
> On 1/12/2017 1:58 PM, Jerin Jacob wrote:
> > On Thu, Jan 12, 2017 at 10:26:08AM +0100, Thomas Monjalon wrote:
> >> 2017-01-12 13:16, Jerin Jacob:
> >>> +ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y)
> >>>  _LDLIBS-$(CONFIG_RTE_LIBRTE_IXGBE_PMD) += -lrte_pmd_ixgbe
> >>> +endif
> >>
> >> _LDLIBS is an internal variable of rte.app.mk.
> >> Please could you check that there is no issue when using LDLIBS instead
> >> of _LDLIBS?
> > 
> > Tested it. Suggested change has issue in shared lib configuration.
> > 
> > [dpdk-master] $ git diff
> > diff --git a/app/test-pmd/Makefile b/app/test-pmd/Makefile
> > index 050663a..27cadd5 100644
> > --- a/app/test-pmd/Makefile
> > +++ b/app/test-pmd/Makefile
> > @@ -59,9 +59,7 @@ SRCS-y += csumonly.c
> >  SRCS-y += icmpecho.c
> >  SRCS-$(CONFIG_RTE_LIBRTE_IEEE1588) += ieee1588fwd.c
> >  
> > -ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y)
> > -_LDLIBS-$(CONFIG_RTE_LIBRTE_IXGBE_PMD) += -lrte_pmd_ixgbe
> > -endif
> > +LDLIBS-$(CONFIG_RTE_LIBRTE_IXGBE_PMD) += -lrte_pmd_ixgbe
> 
> It is LDLIBS instead of LDLIBS-y, following may work:

LDLIBS is not helping the situation as LDLIBS comes before the _LDLIBS-y
mk/rte.app.mk:LDLIBS += $(_LDLIBS-y) $(CPU_LDLIBS) $(EXTRA_LDLIBS)

But moving to EXTRA_LDLIBS looks OK.But it has to be under CONFIG_RTE_LIBRTE_IXGBE_PMD

Thomas, Ferruh
Let me know if you have any objection on below mentioned diff

[master] $ git diff
app/test-pmd/Makefile 
diff --git a/app/test-pmd/Makefile b/app/test-pmd/Makefile
index 050663a..2be8c50 100644
--- a/app/test-pmd/Makefile
+++ b/app/test-pmd/Makefile
@@ -59,8 +59,8 @@ SRCS-y += csumonly.c
 SRCS-y += icmpecho.c
 SRCS-$(CONFIG_RTE_LIBRTE_IEEE1588) += ieee1588fwd.c
 
-ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y)
-_LDLIBS-$(CONFIG_RTE_LIBRTE_IXGBE_PMD) += -lrte_pmd_ixgbe
+ifeq ($(CONFIG_RTE_LIBRTE_IXGBE_PMD),y)
+EXTRA_LDLIBS += -lrte_pmd_ixgbe
 endif
 
 CFLAGS_cmdline.o := -D_GNU_SOURCE


> 
> -_LDLIBS-$(CONFIG_RTE_LIBRTE_IXGBE_PMD) += -lrte_pmd_ixgbe
> +ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y)
> +ifeq ($(CONFIG_RTE_LIBRTE_IXGBE_PMD),y)
> +LDLIBS += -lrte_pmd_ixgbe
> +endif
> +endif
> 
> 
> Also using EXTRA_LDLIBS instead of LDLIBS may remove the requirement of
> the SHARED_LIB check, because of where it is located, but this seems
> just coincidental.
> 
> 
> 

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [dpdk-dev] [PATCH] app/testpmd: fix static build link ordering
  2017-01-13  3:21       ` Jerin Jacob
@ 2017-01-13 15:53         ` Thomas Monjalon
  2017-01-13 15:57           ` Ferruh Yigit
  2017-01-13 16:02           ` Jerin Jacob
  0 siblings, 2 replies; 12+ messages in thread
From: Thomas Monjalon @ 2017-01-13 15:53 UTC (permalink / raw)
  To: Jerin Jacob; +Cc: Ferruh Yigit, dev, stable

2017-01-13 08:51, Jerin Jacob:
> On Thu, Jan 12, 2017 at 03:27:30PM +0000, Ferruh Yigit wrote:
> > On 1/12/2017 1:58 PM, Jerin Jacob wrote:
> > > On Thu, Jan 12, 2017 at 10:26:08AM +0100, Thomas Monjalon wrote:
> > >> 2017-01-12 13:16, Jerin Jacob:
> > >>> +ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y)
> > >>>  _LDLIBS-$(CONFIG_RTE_LIBRTE_IXGBE_PMD) += -lrte_pmd_ixgbe
> > >>> +endif
> > >>
> > >> _LDLIBS is an internal variable of rte.app.mk.
> > >> Please could you check that there is no issue when using LDLIBS instead
> > >> of _LDLIBS?
> > > 
> LDLIBS is not helping the situation as LDLIBS comes before the _LDLIBS-y
> mk/rte.app.mk:LDLIBS += $(_LDLIBS-y) $(CPU_LDLIBS) $(EXTRA_LDLIBS)
> 
> But moving to EXTRA_LDLIBS looks OK.But it has to be under CONFIG_RTE_LIBRTE_IXGBE_PMD
> 
> Thomas, Ferruh
> Let me know if you have any objection on below mentioned diff
> 
> -ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y)
> -_LDLIBS-$(CONFIG_RTE_LIBRTE_IXGBE_PMD) += -lrte_pmd_ixgbe
> +ifeq ($(CONFIG_RTE_LIBRTE_IXGBE_PMD),y)
> +EXTRA_LDLIBS += -lrte_pmd_ixgbe
>  endif

You need to keep the shared lib check.
Anyway, EXTRA_LDLIBS should be reserved to users and not used in a Makefile.
I prefer your initial patch using _LDLIBS.

Any objection to merge initial proposal?

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [dpdk-dev] [PATCH] app/testpmd: fix static build link ordering
  2017-01-13 15:53         ` Thomas Monjalon
@ 2017-01-13 15:57           ` Ferruh Yigit
  2017-01-13 16:01             ` Jerin Jacob
  2017-01-13 16:02           ` Jerin Jacob
  1 sibling, 1 reply; 12+ messages in thread
From: Ferruh Yigit @ 2017-01-13 15:57 UTC (permalink / raw)
  To: Thomas Monjalon, Jerin Jacob; +Cc: dev, stable

On 1/13/2017 3:53 PM, Thomas Monjalon wrote:
> 2017-01-13 08:51, Jerin Jacob:
>> On Thu, Jan 12, 2017 at 03:27:30PM +0000, Ferruh Yigit wrote:
>>> On 1/12/2017 1:58 PM, Jerin Jacob wrote:
>>>> On Thu, Jan 12, 2017 at 10:26:08AM +0100, Thomas Monjalon wrote:
>>>>> 2017-01-12 13:16, Jerin Jacob:
>>>>>> +ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y)
>>>>>>  _LDLIBS-$(CONFIG_RTE_LIBRTE_IXGBE_PMD) += -lrte_pmd_ixgbe
>>>>>> +endif
>>>>>
>>>>> _LDLIBS is an internal variable of rte.app.mk.
>>>>> Please could you check that there is no issue when using LDLIBS instead
>>>>> of _LDLIBS?
>>>>
>> LDLIBS is not helping the situation as LDLIBS comes before the _LDLIBS-y
>> mk/rte.app.mk:LDLIBS += $(_LDLIBS-y) $(CPU_LDLIBS) $(EXTRA_LDLIBS)
>>
>> But moving to EXTRA_LDLIBS looks OK.But it has to be under CONFIG_RTE_LIBRTE_IXGBE_PMD
>>
>> Thomas, Ferruh
>> Let me know if you have any objection on below mentioned diff
>>
>> -ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y)
>> -_LDLIBS-$(CONFIG_RTE_LIBRTE_IXGBE_PMD) += -lrte_pmd_ixgbe
>> +ifeq ($(CONFIG_RTE_LIBRTE_IXGBE_PMD),y)
>> +EXTRA_LDLIBS += -lrte_pmd_ixgbe
>>  endif
> 
> You need to keep the shared lib check.
> Anyway, EXTRA_LDLIBS should be reserved to users and not used in a Makefile.
> I prefer your initial patch using _LDLIBS.
> 
> Any objection to merge initial proposal?
> 

LDLIBS should be OK, as long as wrapped with SHARED check. Is following
not working:

-_LDLIBS-$(CONFIG_RTE_LIBRTE_IXGBE_PMD) += -lrte_pmd_ixgbe
+ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y)
+ifeq ($(CONFIG_RTE_LIBRTE_IXGBE_PMD),y)
+LDLIBS += -lrte_pmd_ixgbe
+endif
+endif

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [dpdk-dev] [PATCH] app/testpmd: fix static build link ordering
  2017-01-13 15:57           ` Ferruh Yigit
@ 2017-01-13 16:01             ` Jerin Jacob
  2017-01-13 16:12               ` Ferruh Yigit
  0 siblings, 1 reply; 12+ messages in thread
From: Jerin Jacob @ 2017-01-13 16:01 UTC (permalink / raw)
  To: Ferruh Yigit; +Cc: Thomas Monjalon, dev, stable

On Fri, Jan 13, 2017 at 03:57:59PM +0000, Ferruh Yigit wrote:
> On 1/13/2017 3:53 PM, Thomas Monjalon wrote:
> > 2017-01-13 08:51, Jerin Jacob:
> >> On Thu, Jan 12, 2017 at 03:27:30PM +0000, Ferruh Yigit wrote:
> >>> On 1/12/2017 1:58 PM, Jerin Jacob wrote:
> >>>> On Thu, Jan 12, 2017 at 10:26:08AM +0100, Thomas Monjalon wrote:
> >>>>> 2017-01-12 13:16, Jerin Jacob:
> >>>>>> +ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y)
> >>>>>>  _LDLIBS-$(CONFIG_RTE_LIBRTE_IXGBE_PMD) += -lrte_pmd_ixgbe
> >>>>>> +endif
> >>>>>
> >>>>> _LDLIBS is an internal variable of rte.app.mk.
> >>>>> Please could you check that there is no issue when using LDLIBS instead
> >>>>> of _LDLIBS?
> >>>>
> >> LDLIBS is not helping the situation as LDLIBS comes before the _LDLIBS-y
> >> mk/rte.app.mk:LDLIBS += $(_LDLIBS-y) $(CPU_LDLIBS) $(EXTRA_LDLIBS)
> >>
> >> But moving to EXTRA_LDLIBS looks OK.But it has to be under CONFIG_RTE_LIBRTE_IXGBE_PMD
> >>
> >> Thomas, Ferruh
> >> Let me know if you have any objection on below mentioned diff
> >>
> >> -ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y)
> >> -_LDLIBS-$(CONFIG_RTE_LIBRTE_IXGBE_PMD) += -lrte_pmd_ixgbe
> >> +ifeq ($(CONFIG_RTE_LIBRTE_IXGBE_PMD),y)
> >> +EXTRA_LDLIBS += -lrte_pmd_ixgbe
> >>  endif
> > 
> > You need to keep the shared lib check.
> > Anyway, EXTRA_LDLIBS should be reserved to users and not used in a Makefile.
> > I prefer your initial patch using _LDLIBS.
> > 
> > Any objection to merge initial proposal?
> > 
> 
> LDLIBS should be OK, as long as wrapped with SHARED check. Is following
> not working:

No, due to the following line
mk/rte.app.mk:LDLIBS += $(_LDLIBS-y) $(CPU_LDLIBS) $(EXTRA_LDLIBS)

Again -lrte_pmd_ixgbe comes first.

> 
> -_LDLIBS-$(CONFIG_RTE_LIBRTE_IXGBE_PMD) += -lrte_pmd_ixgbe
> +ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y)
> +ifeq ($(CONFIG_RTE_LIBRTE_IXGBE_PMD),y)
> +LDLIBS += -lrte_pmd_ixgbe
> +endif
> +endif

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [dpdk-dev] [PATCH] app/testpmd: fix static build link ordering
  2017-01-13 15:53         ` Thomas Monjalon
  2017-01-13 15:57           ` Ferruh Yigit
@ 2017-01-13 16:02           ` Jerin Jacob
  1 sibling, 0 replies; 12+ messages in thread
From: Jerin Jacob @ 2017-01-13 16:02 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: Ferruh Yigit, dev, stable

On Fri, Jan 13, 2017 at 04:53:46PM +0100, Thomas Monjalon wrote:
> 2017-01-13 08:51, Jerin Jacob:
> > On Thu, Jan 12, 2017 at 03:27:30PM +0000, Ferruh Yigit wrote:
> > > On 1/12/2017 1:58 PM, Jerin Jacob wrote:
> > > > On Thu, Jan 12, 2017 at 10:26:08AM +0100, Thomas Monjalon wrote:
> > > >> 2017-01-12 13:16, Jerin Jacob:
> > > >>> +ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y)
> > > >>>  _LDLIBS-$(CONFIG_RTE_LIBRTE_IXGBE_PMD) += -lrte_pmd_ixgbe
> > > >>> +endif
> > > >>
> > > >> _LDLIBS is an internal variable of rte.app.mk.
> > > >> Please could you check that there is no issue when using LDLIBS instead
> > > >> of _LDLIBS?
> > > > 
> > LDLIBS is not helping the situation as LDLIBS comes before the _LDLIBS-y
> > mk/rte.app.mk:LDLIBS += $(_LDLIBS-y) $(CPU_LDLIBS) $(EXTRA_LDLIBS)
> > 
> > But moving to EXTRA_LDLIBS looks OK.But it has to be under CONFIG_RTE_LIBRTE_IXGBE_PMD
> > 
> > Thomas, Ferruh
> > Let me know if you have any objection on below mentioned diff
> > 
> > -ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y)
> > -_LDLIBS-$(CONFIG_RTE_LIBRTE_IXGBE_PMD) += -lrte_pmd_ixgbe
> > +ifeq ($(CONFIG_RTE_LIBRTE_IXGBE_PMD),y)
> > +EXTRA_LDLIBS += -lrte_pmd_ixgbe
> >  endif
> 
> You need to keep the shared lib check.
> Anyway, EXTRA_LDLIBS should be reserved to users and not used in a Makefile.
> I prefer your initial patch using _LDLIBS.
> 
> Any objection to merge initial proposal?

from my side, No

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [dpdk-dev] [PATCH] app/testpmd: fix static build link ordering
  2017-01-13 16:01             ` Jerin Jacob
@ 2017-01-13 16:12               ` Ferruh Yigit
  2017-01-31 10:58                 ` Ferruh Yigit
  0 siblings, 1 reply; 12+ messages in thread
From: Ferruh Yigit @ 2017-01-13 16:12 UTC (permalink / raw)
  To: Jerin Jacob; +Cc: Thomas Monjalon, dev, stable

On 1/13/2017 4:01 PM, Jerin Jacob wrote:
> On Fri, Jan 13, 2017 at 03:57:59PM +0000, Ferruh Yigit wrote:
>> On 1/13/2017 3:53 PM, Thomas Monjalon wrote:
>>> 2017-01-13 08:51, Jerin Jacob:
>>>> On Thu, Jan 12, 2017 at 03:27:30PM +0000, Ferruh Yigit wrote:
>>>>> On 1/12/2017 1:58 PM, Jerin Jacob wrote:
>>>>>> On Thu, Jan 12, 2017 at 10:26:08AM +0100, Thomas Monjalon wrote:
>>>>>>> 2017-01-12 13:16, Jerin Jacob:
>>>>>>>> +ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y)
>>>>>>>>  _LDLIBS-$(CONFIG_RTE_LIBRTE_IXGBE_PMD) += -lrte_pmd_ixgbe
>>>>>>>> +endif
>>>>>>>
>>>>>>> _LDLIBS is an internal variable of rte.app.mk.
>>>>>>> Please could you check that there is no issue when using LDLIBS instead
>>>>>>> of _LDLIBS?
>>>>>>
>>>> LDLIBS is not helping the situation as LDLIBS comes before the _LDLIBS-y
>>>> mk/rte.app.mk:LDLIBS += $(_LDLIBS-y) $(CPU_LDLIBS) $(EXTRA_LDLIBS)
>>>>
>>>> But moving to EXTRA_LDLIBS looks OK.But it has to be under CONFIG_RTE_LIBRTE_IXGBE_PMD
>>>>
>>>> Thomas, Ferruh
>>>> Let me know if you have any objection on below mentioned diff
>>>>
>>>> -ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y)
>>>> -_LDLIBS-$(CONFIG_RTE_LIBRTE_IXGBE_PMD) += -lrte_pmd_ixgbe
>>>> +ifeq ($(CONFIG_RTE_LIBRTE_IXGBE_PMD),y)
>>>> +EXTRA_LDLIBS += -lrte_pmd_ixgbe
>>>>  endif
>>>
>>> You need to keep the shared lib check.
>>> Anyway, EXTRA_LDLIBS should be reserved to users and not used in a Makefile.
>>> I prefer your initial patch using _LDLIBS.
>>>
>>> Any objection to merge initial proposal?
>>>
>>
>> LDLIBS should be OK, as long as wrapped with SHARED check. Is following
>> not working:
> 
> No, due to the following line
> mk/rte.app.mk:LDLIBS += $(_LDLIBS-y) $(CPU_LDLIBS) $(EXTRA_LDLIBS)
> 
> Again -lrte_pmd_ixgbe comes first.

You are right.

No objection to initial proposal.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [dpdk-dev] [PATCH] app/testpmd: fix static build link ordering
  2017-01-12  7:46 [dpdk-dev] [PATCH] app/testpmd: fix static build link ordering Jerin Jacob
  2017-01-12  9:26 ` Thomas Monjalon
@ 2017-01-13 16:31 ` Thomas Monjalon
  1 sibling, 0 replies; 12+ messages in thread
From: Thomas Monjalon @ 2017-01-13 16:31 UTC (permalink / raw)
  To: Jerin Jacob; +Cc: dev, ferruh.yigit, stable

2017-01-12 13:16, Jerin Jacob:
> By introducing explicit -lrte_pmd_ixgbe link request in
> testpmd Makefile,"-Wl,-lrte_pmd_ixgbe" provided twice, and linker
> removes the duplication by keeping only first occurrence.
> This moves "-Wl,-lrte_pmd_ixgbe" out of "-Wl,--whole-archive" flag
> and makes symbol generation totally different than previous version
> in case of static build.
> This patch fixes the static build linking order by introducing
> -lrte_pmd_ixgbe under the shared library config
> (CONFIG_RTE_BUILD_SHARED_LIB).
> 
> Fixes: 425781ff5afe ("app/testpmd: add ixgbe VF management")
> 
> CC: stable@dpdk.org
> Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>

Applied, thanks

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [dpdk-dev] [PATCH] app/testpmd: fix static build link ordering
  2017-01-13 16:12               ` Ferruh Yigit
@ 2017-01-31 10:58                 ` Ferruh Yigit
  0 siblings, 0 replies; 12+ messages in thread
From: Ferruh Yigit @ 2017-01-31 10:58 UTC (permalink / raw)
  To: Jerin Jacob; +Cc: Thomas Monjalon, dev, stable

On 1/13/2017 4:12 PM, Ferruh Yigit wrote:
> On 1/13/2017 4:01 PM, Jerin Jacob wrote:
>> On Fri, Jan 13, 2017 at 03:57:59PM +0000, Ferruh Yigit wrote:
>>> On 1/13/2017 3:53 PM, Thomas Monjalon wrote:
>>>> 2017-01-13 08:51, Jerin Jacob:
>>>>> On Thu, Jan 12, 2017 at 03:27:30PM +0000, Ferruh Yigit wrote:
>>>>>> On 1/12/2017 1:58 PM, Jerin Jacob wrote:
>>>>>>> On Thu, Jan 12, 2017 at 10:26:08AM +0100, Thomas Monjalon wrote:
>>>>>>>> 2017-01-12 13:16, Jerin Jacob:
>>>>>>>>> +ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y)
>>>>>>>>>  _LDLIBS-$(CONFIG_RTE_LIBRTE_IXGBE_PMD) += -lrte_pmd_ixgbe
>>>>>>>>> +endif
>>>>>>>>
>>>>>>>> _LDLIBS is an internal variable of rte.app.mk.
>>>>>>>> Please could you check that there is no issue when using LDLIBS instead
>>>>>>>> of _LDLIBS?
>>>>>>>
>>>>> LDLIBS is not helping the situation as LDLIBS comes before the _LDLIBS-y
>>>>> mk/rte.app.mk:LDLIBS += $(_LDLIBS-y) $(CPU_LDLIBS) $(EXTRA_LDLIBS)
>>>>>
>>>>> But moving to EXTRA_LDLIBS looks OK.But it has to be under CONFIG_RTE_LIBRTE_IXGBE_PMD
>>>>>
>>>>> Thomas, Ferruh
>>>>> Let me know if you have any objection on below mentioned diff
>>>>>
>>>>> -ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y)
>>>>> -_LDLIBS-$(CONFIG_RTE_LIBRTE_IXGBE_PMD) += -lrte_pmd_ixgbe
>>>>> +ifeq ($(CONFIG_RTE_LIBRTE_IXGBE_PMD),y)
>>>>> +EXTRA_LDLIBS += -lrte_pmd_ixgbe
>>>>>  endif
>>>>
>>>> You need to keep the shared lib check.
>>>> Anyway, EXTRA_LDLIBS should be reserved to users and not used in a Makefile.
>>>> I prefer your initial patch using _LDLIBS.
>>>>
>>>> Any objection to merge initial proposal?
>>>>
>>>
>>> LDLIBS should be OK, as long as wrapped with SHARED check. Is following
>>> not working:
>>
>> No, due to the following line
>> mk/rte.app.mk:LDLIBS += $(_LDLIBS-y) $(CPU_LDLIBS) $(EXTRA_LDLIBS)
>>
>> Again -lrte_pmd_ixgbe comes first.
> 
> You are right.

After second thought.
-lrte_pmd_ixgbe coming first is problem for static compilation, but
these libraries used only for dynamic compilation. And locations
shouldn't matter with dynamic compilation.

Can you please try converting to the following, that should work:

+ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y)
+ifeq ($(CONFIG_RTE_LIBRTE_IXGBE_PMD),y)
+LDLIBS += -lrte_pmd_ixgbe
+endif
+endif

I will send a patch for this.

> 
> No objection to initial proposal.
> 

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2017-01-31 10:58 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-12  7:46 [dpdk-dev] [PATCH] app/testpmd: fix static build link ordering Jerin Jacob
2017-01-12  9:26 ` Thomas Monjalon
2017-01-12 13:58   ` Jerin Jacob
2017-01-12 15:27     ` Ferruh Yigit
2017-01-13  3:21       ` Jerin Jacob
2017-01-13 15:53         ` Thomas Monjalon
2017-01-13 15:57           ` Ferruh Yigit
2017-01-13 16:01             ` Jerin Jacob
2017-01-13 16:12               ` Ferruh Yigit
2017-01-31 10:58                 ` Ferruh Yigit
2017-01-13 16:02           ` Jerin Jacob
2017-01-13 16:31 ` Thomas Monjalon

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).