[dpdk-dev] app/testpmd: fix static build link ordering

Message ID 1484207214-13638-1-git-send-email-jerin.jacob@caviumnetworks.com (mailing list archive)
State Accepted, archived
Headers

Checks

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

Commit Message

Jerin Jacob Jan. 12, 2017, 7:46 a.m. UTC
  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(+)
  

Comments

Thomas Monjalon Jan. 12, 2017, 9:26 a.m. UTC | #1
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
  
Thomas Monjalon Jan. 13, 2017, 4:31 p.m. UTC | #2
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
  

Patch

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