* [dpdk-dev] [PATCH v2 1/6] mk: sort drivers in static application link list
2016-06-10 13:19 ` [dpdk-dev] [PATCH v2 0/6] reduce " Thomas Monjalon
@ 2016-06-10 13:19 ` Thomas Monjalon
2016-06-10 13:19 ` [dpdk-dev] [PATCH v2 2/6] mk: fix driver dependencies order for static application Thomas Monjalon
` (6 subsequent siblings)
7 siblings, 0 replies; 62+ messages in thread
From: Thomas Monjalon @ 2016-06-10 13:19 UTC (permalink / raw)
To: Ferruh Yigit; +Cc: dev
Just a clean up to prepare next patches.
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
---
mk/rte.app.mk | 45 +++++++++++++++++----------------------------
1 file changed, 17 insertions(+), 28 deletions(-)
diff --git a/mk/rte.app.mk b/mk/rte.app.mk
index b84b56d..07be17c 100644
--- a/mk/rte.app.mk
+++ b/mk/rte.app.mk
@@ -124,57 +124,46 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_EAL) += -lrte_eal
_LDLIBS-$(CONFIG_RTE_LIBRTE_CMDLINE) += -lrte_cmdline
_LDLIBS-$(CONFIG_RTE_LIBRTE_CFGFILE) += -lrte_cfgfile
_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += -lrte_pmd_bond
-
_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_XENVIRT) += -lrte_pmd_xenvirt
ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),n)
# plugins (link only if static libraries)
-_LDLIBS-$(CONFIG_RTE_LIBRTE_VMXNET3_PMD) += -lrte_pmd_vmxnet3_uio
-_LDLIBS-$(CONFIG_RTE_LIBRTE_VIRTIO_PMD) += -lrte_pmd_virtio
+_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AF_PACKET) += -lrte_pmd_af_packet
_LDLIBS-$(CONFIG_RTE_LIBRTE_BNX2X_PMD) += -lrte_pmd_bnx2x
_LDLIBS-$(CONFIG_RTE_LIBRTE_CXGBE_PMD) += -lrte_pmd_cxgbe
+_LDLIBS-$(CONFIG_RTE_LIBRTE_E1000_PMD) += -lrte_pmd_e1000
+_LDLIBS-$(CONFIG_RTE_LIBRTE_ENA_PMD) += -lrte_pmd_ena
_LDLIBS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += -lrte_pmd_enic
-_LDLIBS-$(CONFIG_RTE_LIBRTE_I40E_PMD) += -lrte_pmd_i40e
_LDLIBS-$(CONFIG_RTE_LIBRTE_FM10K_PMD) += -lrte_pmd_fm10k
+_LDLIBS-$(CONFIG_RTE_LIBRTE_I40E_PMD) += -lrte_pmd_i40e
_LDLIBS-$(CONFIG_RTE_LIBRTE_IXGBE_PMD) += -lrte_pmd_ixgbe
-_LDLIBS-$(CONFIG_RTE_LIBRTE_E1000_PMD) += -lrte_pmd_e1000
-_LDLIBS-$(CONFIG_RTE_LIBRTE_ENA_PMD) += -lrte_pmd_ena
_LDLIBS-$(CONFIG_RTE_LIBRTE_MLX4_PMD) += -lrte_pmd_mlx4
_LDLIBS-$(CONFIG_RTE_LIBRTE_MLX5_PMD) += -lrte_pmd_mlx5
-_LDLIBS-$(CONFIG_RTE_LIBRTE_NFP_PMD) += -lrte_pmd_nfp
-_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_SZEDATA2) += -lrte_pmd_szedata2
_LDLIBS-$(CONFIG_RTE_LIBRTE_MPIPE_PMD) += -lrte_pmd_mpipe
-_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_RING) += -lrte_pmd_ring
+_LDLIBS-$(CONFIG_RTE_LIBRTE_NFP_PMD) += -lrte_pmd_nfp
+_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_NULL) += -lrte_pmd_null
_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_PCAP) += -lrte_pmd_pcap
-_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AF_PACKET) += -lrte_pmd_af_packet
_LDLIBS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += -lrte_pmd_qede
-_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_NULL) += -lrte_pmd_null
+_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_RING) += -lrte_pmd_ring
+_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_SZEDATA2) += -lrte_pmd_szedata2
+_LDLIBS-$(CONFIG_RTE_LIBRTE_VIRTIO_PMD) += -lrte_pmd_virtio
+ifeq ($(CONFIG_RTE_LIBRTE_VHOST),y)
+_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_VHOST) += -lrte_pmd_vhost
+endif # $(CONFIG_RTE_LIBRTE_VHOST)
+_LDLIBS-$(CONFIG_RTE_LIBRTE_VMXNET3_PMD) += -lrte_pmd_vmxnet3_uio
ifeq ($(CONFIG_RTE_LIBRTE_CRYPTODEV),y)
-_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_QAT) += -lrte_pmd_qat
_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_MB) += -lrte_pmd_aesni_mb
-_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_GCM) += -lrte_pmd_aesni_gcm
+_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_MB) += -L$(AESNI_MULTI_BUFFER_LIB_PATH) -lIPSec_MB
+_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_GCM) += -lrte_pmd_aesni_gcm
+_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_GCM) += -L$(AESNI_MULTI_BUFFER_LIB_PATH) -lIPSec_MB
_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_NULL_CRYPTO) += -lrte_pmd_null_crypto
-
-# AESNI MULTI BUFFER / GCM PMDs are dependent on the IPSec_MB library
-ifeq ($(CONFIG_RTE_LIBRTE_PMD_AESNI_MB),y)
-_LDLIBS-y += -L$(AESNI_MULTI_BUFFER_LIB_PATH) -lIPSec_MB
-else ifeq ($(CONFIG_RTE_LIBRTE_PMD_AESNI_GCM),y)
-_LDLIBS-y += -L$(AESNI_MULTI_BUFFER_LIB_PATH) -lIPSec_MB
-endif
-
-# SNOW3G PMD is dependent on the LIBSSO library
+_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_QAT) += -lrte_pmd_qat
_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_SNOW3G) += -lrte_pmd_snow3g
_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_SNOW3G) += -L$(LIBSSO_PATH)/build -lsso
endif # CONFIG_RTE_LIBRTE_CRYPTODEV
-ifeq ($(CONFIG_RTE_LIBRTE_VHOST),y)
-
-_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_VHOST) += -lrte_pmd_vhost
-
-endif # $(CONFIG_RTE_LIBRTE_VHOST)
-
endif # ! $(CONFIG_RTE_BUILD_SHARED_LIB)
_LDLIBS-y += $(EXECENV_LDLIBS)
--
2.7.0
^ permalink raw reply [flat|nested] 62+ messages in thread
* [dpdk-dev] [PATCH v2 2/6] mk: fix driver dependencies order for static application
2016-06-10 13:19 ` [dpdk-dev] [PATCH v2 0/6] reduce " Thomas Monjalon
2016-06-10 13:19 ` [dpdk-dev] [PATCH v2 1/6] mk: sort drivers in static application link list Thomas Monjalon
@ 2016-06-10 13:19 ` Thomas Monjalon
2016-06-10 14:49 ` Ferruh Yigit
2016-06-10 13:19 ` [dpdk-dev] [PATCH v2 3/6] mk: remove library grouping during application linking Thomas Monjalon
` (5 subsequent siblings)
7 siblings, 1 reply; 62+ messages in thread
From: Thomas Monjalon @ 2016-06-10 13:19 UTC (permalink / raw)
To: Ferruh Yigit; +Cc: dev
On a linker command line, the dependencies must be declared after
the libraries using them.
It will avoid some issues when building an application with static
libraries and --as-needed option.
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
---
mk/rte.app.mk | 38 +++++++++++---------------------------
1 file changed, 11 insertions(+), 27 deletions(-)
diff --git a/mk/rte.app.mk b/mk/rte.app.mk
index 07be17c..8068e66 100644
--- a/mk/rte.app.mk
+++ b/mk/rte.app.mk
@@ -93,22 +93,6 @@ ifeq ($(CONFIG_RTE_LIBRTE_VHOST_USER),n)
_LDLIBS-$(CONFIG_RTE_LIBRTE_VHOST) += -lfuse
endif
_LDLIBS-$(CONFIG_RTE_PORT_PCAP) += -lpcap
-_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_PCAP) += -lpcap
-_LDLIBS-$(CONFIG_RTE_LIBRTE_BNX2X_PMD) += -lz
-_LDLIBS-$(CONFIG_RTE_LIBRTE_MLX4_PMD) += -libverbs
-_LDLIBS-$(CONFIG_RTE_LIBRTE_MLX5_PMD) += -libverbs
-_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_SZEDATA2) += -lsze2
-_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_XENVIRT) += -lxenstore
-_LDLIBS-$(CONFIG_RTE_LIBRTE_MPIPE_PMD) += -lgxio
-_LDLIBS-$(CONFIG_RTE_LIBRTE_NFP_PMD) += -lm
-_LDLIBS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += -lz
-# QAT / AESNI GCM PMDs are dependent on libcrypto (from openssl)
-# for calculating HMAC precomputes
-ifeq ($(CONFIG_RTE_LIBRTE_PMD_QAT),y)
-_LDLIBS-y += -lcrypto
-else ifeq ($(CONFIG_RTE_LIBRTE_PMD_AESNI_GCM),y)
-_LDLIBS-y += -lcrypto
-endif
endif # !CONFIG_RTE_BUILD_SHARED_LIBS
_LDLIBS-y += --start-group
@@ -124,13 +108,13 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_EAL) += -lrte_eal
_LDLIBS-$(CONFIG_RTE_LIBRTE_CMDLINE) += -lrte_cmdline
_LDLIBS-$(CONFIG_RTE_LIBRTE_CFGFILE) += -lrte_cfgfile
_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += -lrte_pmd_bond
-_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_XENVIRT) += -lrte_pmd_xenvirt
+_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_XENVIRT) += -lrte_pmd_xenvirt -lxenstore
ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),n)
# plugins (link only if static libraries)
_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AF_PACKET) += -lrte_pmd_af_packet
-_LDLIBS-$(CONFIG_RTE_LIBRTE_BNX2X_PMD) += -lrte_pmd_bnx2x
+_LDLIBS-$(CONFIG_RTE_LIBRTE_BNX2X_PMD) += -lrte_pmd_bnx2x -lz
_LDLIBS-$(CONFIG_RTE_LIBRTE_CXGBE_PMD) += -lrte_pmd_cxgbe
_LDLIBS-$(CONFIG_RTE_LIBRTE_E1000_PMD) += -lrte_pmd_e1000
_LDLIBS-$(CONFIG_RTE_LIBRTE_ENA_PMD) += -lrte_pmd_ena
@@ -138,15 +122,15 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += -lrte_pmd_enic
_LDLIBS-$(CONFIG_RTE_LIBRTE_FM10K_PMD) += -lrte_pmd_fm10k
_LDLIBS-$(CONFIG_RTE_LIBRTE_I40E_PMD) += -lrte_pmd_i40e
_LDLIBS-$(CONFIG_RTE_LIBRTE_IXGBE_PMD) += -lrte_pmd_ixgbe
-_LDLIBS-$(CONFIG_RTE_LIBRTE_MLX4_PMD) += -lrte_pmd_mlx4
-_LDLIBS-$(CONFIG_RTE_LIBRTE_MLX5_PMD) += -lrte_pmd_mlx5
-_LDLIBS-$(CONFIG_RTE_LIBRTE_MPIPE_PMD) += -lrte_pmd_mpipe
-_LDLIBS-$(CONFIG_RTE_LIBRTE_NFP_PMD) += -lrte_pmd_nfp
+_LDLIBS-$(CONFIG_RTE_LIBRTE_MLX4_PMD) += -lrte_pmd_mlx4 -libverbs
+_LDLIBS-$(CONFIG_RTE_LIBRTE_MLX5_PMD) += -lrte_pmd_mlx5 -libverbs
+_LDLIBS-$(CONFIG_RTE_LIBRTE_MPIPE_PMD) += -lrte_pmd_mpipe -lgxio
+_LDLIBS-$(CONFIG_RTE_LIBRTE_NFP_PMD) += -lrte_pmd_nfp -lm
_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_NULL) += -lrte_pmd_null
-_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_PCAP) += -lrte_pmd_pcap
-_LDLIBS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += -lrte_pmd_qede
+_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_PCAP) += -lrte_pmd_pcap -lpcap
+_LDLIBS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += -lrte_pmd_qede -lz
_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_RING) += -lrte_pmd_ring
-_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_SZEDATA2) += -lrte_pmd_szedata2
+_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_SZEDATA2) += -lrte_pmd_szedata2 -lsze2
_LDLIBS-$(CONFIG_RTE_LIBRTE_VIRTIO_PMD) += -lrte_pmd_virtio
ifeq ($(CONFIG_RTE_LIBRTE_VHOST),y)
_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_VHOST) += -lrte_pmd_vhost
@@ -156,10 +140,10 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_VMXNET3_PMD) += -lrte_pmd_vmxnet3_uio
ifeq ($(CONFIG_RTE_LIBRTE_CRYPTODEV),y)
_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_MB) += -lrte_pmd_aesni_mb
_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_MB) += -L$(AESNI_MULTI_BUFFER_LIB_PATH) -lIPSec_MB
-_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_GCM) += -lrte_pmd_aesni_gcm
+_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_GCM) += -lrte_pmd_aesni_gcm -lcrypto
_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_GCM) += -L$(AESNI_MULTI_BUFFER_LIB_PATH) -lIPSec_MB
_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_NULL_CRYPTO) += -lrte_pmd_null_crypto
-_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_QAT) += -lrte_pmd_qat
+_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_QAT) += -lrte_pmd_qat -lcrypto
_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_SNOW3G) += -lrte_pmd_snow3g
_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_SNOW3G) += -L$(LIBSSO_PATH)/build -lsso
endif # CONFIG_RTE_LIBRTE_CRYPTODEV
--
2.7.0
^ permalink raw reply [flat|nested] 62+ messages in thread
* Re: [dpdk-dev] [PATCH v2 2/6] mk: fix driver dependencies order for static application
2016-06-10 13:19 ` [dpdk-dev] [PATCH v2 2/6] mk: fix driver dependencies order for static application Thomas Monjalon
@ 2016-06-10 14:49 ` Ferruh Yigit
2016-06-10 14:54 ` Thomas Monjalon
0 siblings, 1 reply; 62+ messages in thread
From: Ferruh Yigit @ 2016-06-10 14:49 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: dev
On 6/10/2016 2:19 PM, Thomas Monjalon wrote:
> On a linker command line, the dependencies must be declared after
> the libraries using them.
> It will avoid some issues when building an application with static
> libraries and --as-needed option.
>
> Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
> ---
Do we need this which driver used which library detail?
I think it is enough to move all external library dependencies to the
last in command line, without paying attention who use it, Linker will
handle the rest, if that library is not required it won't be linked against.
^ permalink raw reply [flat|nested] 62+ messages in thread
* Re: [dpdk-dev] [PATCH v2 2/6] mk: fix driver dependencies order for static application
2016-06-10 14:49 ` Ferruh Yigit
@ 2016-06-10 14:54 ` Thomas Monjalon
0 siblings, 0 replies; 62+ messages in thread
From: Thomas Monjalon @ 2016-06-10 14:54 UTC (permalink / raw)
To: Ferruh Yigit; +Cc: dev
2016-06-10 15:49, Ferruh Yigit:
> On 6/10/2016 2:19 PM, Thomas Monjalon wrote:
> > On a linker command line, the dependencies must be declared after
> > the libraries using them.
> > It will avoid some issues when building an application with static
> > libraries and --as-needed option.
> >
> > Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
> > ---
>
> Do we need this which driver used which library detail?
>
> I think it is enough to move all external library dependencies to the
> last in command line, without paying attention who use it, Linker will
> handle the rest, if that library is not required it won't be linked against.
I prefer avoiding garbage and have a justification for dependencies.
^ permalink raw reply [flat|nested] 62+ messages in thread
* [dpdk-dev] [PATCH v2 3/6] mk: remove library grouping during application linking
2016-06-10 13:19 ` [dpdk-dev] [PATCH v2 0/6] reduce " Thomas Monjalon
2016-06-10 13:19 ` [dpdk-dev] [PATCH v2 1/6] mk: sort drivers in static application link list Thomas Monjalon
2016-06-10 13:19 ` [dpdk-dev] [PATCH v2 2/6] mk: fix driver dependencies order for static application Thomas Monjalon
@ 2016-06-10 13:19 ` Thomas Monjalon
2016-06-10 14:54 ` Ferruh Yigit
2016-06-10 13:19 ` [dpdk-dev] [PATCH v2 4/6] mk: prevent overlinking in applications Thomas Monjalon
` (4 subsequent siblings)
7 siblings, 1 reply; 62+ messages in thread
From: Thomas Monjalon @ 2016-06-10 13:19 UTC (permalink / raw)
To: Ferruh Yigit; +Cc: dev
>From "man ld":
Using this option has a significant performance cost.
It is best to use it only when there are unavoidable
circular references between two or more archives.
Remove the option since it does not seem necessary.
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
---
mk/rte.app.mk | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/mk/rte.app.mk b/mk/rte.app.mk
index 8068e66..9306b30 100644
--- a/mk/rte.app.mk
+++ b/mk/rte.app.mk
@@ -95,8 +95,6 @@ endif
_LDLIBS-$(CONFIG_RTE_PORT_PCAP) += -lpcap
endif # !CONFIG_RTE_BUILD_SHARED_LIBS
-_LDLIBS-y += --start-group
-
_LDLIBS-$(CONFIG_RTE_LIBRTE_KVARGS) += -lrte_kvargs
_LDLIBS-$(CONFIG_RTE_LIBRTE_MBUF) += -lrte_mbuf
_LDLIBS-$(CONFIG_RTE_LIBRTE_IP_FRAG) += -lrte_ip_frag
@@ -151,7 +149,7 @@ endif # CONFIG_RTE_LIBRTE_CRYPTODEV
endif # ! $(CONFIG_RTE_BUILD_SHARED_LIB)
_LDLIBS-y += $(EXECENV_LDLIBS)
-_LDLIBS-y += --end-group
+
_LDLIBS-y += --no-whole-archive
LDLIBS += $(_LDLIBS-y) $(CPU_LDLIBS) $(EXTRA_LDLIBS)
--
2.7.0
^ permalink raw reply [flat|nested] 62+ messages in thread
* Re: [dpdk-dev] [PATCH v2 3/6] mk: remove library grouping during application linking
2016-06-10 13:19 ` [dpdk-dev] [PATCH v2 3/6] mk: remove library grouping during application linking Thomas Monjalon
@ 2016-06-10 14:54 ` Ferruh Yigit
2016-06-10 15:14 ` Thomas Monjalon
0 siblings, 1 reply; 62+ messages in thread
From: Ferruh Yigit @ 2016-06-10 14:54 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: dev
On 6/10/2016 2:19 PM, Thomas Monjalon wrote:
> From "man ld":
> Using this option has a significant performance cost.
> It is best to use it only when there are unavoidable
> circular references between two or more archives.
>
> Remove the option since it does not seem necessary.
>
> Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
To remove this, I think we should order libraries in a way:
pmd -> librte -> external libraries.
Than we can remove --whole-archive too.
And perhaps keep it still to wrap around librte_eal and librte_mempool,
which still has cyclic dependencies.
^ permalink raw reply [flat|nested] 62+ messages in thread
* Re: [dpdk-dev] [PATCH v2 3/6] mk: remove library grouping during application linking
2016-06-10 14:54 ` Ferruh Yigit
@ 2016-06-10 15:14 ` Thomas Monjalon
0 siblings, 0 replies; 62+ messages in thread
From: Thomas Monjalon @ 2016-06-10 15:14 UTC (permalink / raw)
To: Ferruh Yigit; +Cc: dev
2016-06-10 15:54, Ferruh Yigit:
> On 6/10/2016 2:19 PM, Thomas Monjalon wrote:
> > From "man ld":
> > Using this option has a significant performance cost.
> > It is best to use it only when there are unavoidable
> > circular references between two or more archives.
> >
> > Remove the option since it does not seem necessary.
> >
> > Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
>
> To remove this, I think we should order libraries in a way:
>
> pmd -> librte -> external libraries.
> Than we can remove --whole-archive too.
>
> And perhaps keep it still to wrap around librte_eal and librte_mempool,
> which still has cyclic dependencies.
OK looks good
I let you do a v3
^ permalink raw reply [flat|nested] 62+ messages in thread
* [dpdk-dev] [PATCH v2 4/6] mk: prevent overlinking in applications
2016-06-10 13:19 ` [dpdk-dev] [PATCH v2 0/6] reduce " Thomas Monjalon
` (2 preceding siblings ...)
2016-06-10 13:19 ` [dpdk-dev] [PATCH v2 3/6] mk: remove library grouping during application linking Thomas Monjalon
@ 2016-06-10 13:19 ` Thomas Monjalon
2016-06-10 14:56 ` Ferruh Yigit
2016-06-10 13:19 ` [dpdk-dev] [PATCH v2 5/6] mk: sort libraries in level order when linking Thomas Monjalon
` (3 subsequent siblings)
7 siblings, 1 reply; 62+ messages in thread
From: Thomas Monjalon @ 2016-06-10 13:19 UTC (permalink / raw)
To: Ferruh Yigit; +Cc: dev
From: Ferruh Yigit <ferruh.yigit@intel.com>
Replace --no-as-needed linker flag with --as-needed flag, which will
only link libraries directly called by application.
It can be achieved now that the libraries dependencies are handled
properly.
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
---
v2: remove workarounds and workaround comment
---
mk/exec-env/linuxapp/rte.vars.mk | 3 ---
mk/rte.app.mk | 3 +++
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/mk/exec-env/linuxapp/rte.vars.mk b/mk/exec-env/linuxapp/rte.vars.mk
index d51bd17..a8a1ee4 100644
--- a/mk/exec-env/linuxapp/rte.vars.mk
+++ b/mk/exec-env/linuxapp/rte.vars.mk
@@ -45,9 +45,6 @@ else
EXECENV_CFLAGS = -pthread
endif
-# Workaround lack of DT_NEEDED entry
-EXECENV_LDFLAGS = --no-as-needed
-
EXECENV_LDLIBS =
EXECENV_ASFLAGS =
diff --git a/mk/rte.app.mk b/mk/rte.app.mk
index 9306b30..d01a79f 100644
--- a/mk/rte.app.mk
+++ b/mk/rte.app.mk
@@ -50,6 +50,9 @@ ifeq ($(NO_LDSCRIPT),)
LDSCRIPT = $(RTE_LDSCRIPT)
endif
+# Link only the libraries used in the application
+LDFLAGS += --as-needed
+
# default path for libs
_LDLIBS-y += -L$(RTE_SDK_BIN)/lib
--
2.7.0
^ permalink raw reply [flat|nested] 62+ messages in thread
* Re: [dpdk-dev] [PATCH v2 4/6] mk: prevent overlinking in applications
2016-06-10 13:19 ` [dpdk-dev] [PATCH v2 4/6] mk: prevent overlinking in applications Thomas Monjalon
@ 2016-06-10 14:56 ` Ferruh Yigit
2016-06-10 15:15 ` Thomas Monjalon
0 siblings, 1 reply; 62+ messages in thread
From: Ferruh Yigit @ 2016-06-10 14:56 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: dev
On 6/10/2016 2:19 PM, Thomas Monjalon wrote:
> From: Ferruh Yigit <ferruh.yigit@intel.com>
>
> Replace --no-as-needed linker flag with --as-needed flag, which will
> only link libraries directly called by application.
> It can be achieved now that the libraries dependencies are handled
> properly.
>
> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
> ---
...
> endif
>
> +# Link only the libraries used in the application
> +LDFLAGS += --as-needed
For the case we need to have workaround for application, this doesn't
let because last argument wins.
Can we say as following :
LDFLAGS = --as-needed $(LDFLAGS)
> +
> # default path for libs
> _LDLIBS-y += -L$(RTE_SDK_BIN)/lib
>
>
^ permalink raw reply [flat|nested] 62+ messages in thread
* Re: [dpdk-dev] [PATCH v2 4/6] mk: prevent overlinking in applications
2016-06-10 14:56 ` Ferruh Yigit
@ 2016-06-10 15:15 ` Thomas Monjalon
0 siblings, 0 replies; 62+ messages in thread
From: Thomas Monjalon @ 2016-06-10 15:15 UTC (permalink / raw)
To: Ferruh Yigit; +Cc: dev
2016-06-10 15:56, Ferruh Yigit:
> On 6/10/2016 2:19 PM, Thomas Monjalon wrote:
> > From: Ferruh Yigit <ferruh.yigit@intel.com>
> >
> > Replace --no-as-needed linker flag with --as-needed flag, which will
> > only link libraries directly called by application.
> > It can be achieved now that the libraries dependencies are handled
> > properly.
[...]
> > +# Link only the libraries used in the application
> > +LDFLAGS += --as-needed
>
> For the case we need to have workaround for application, this doesn't
> let because last argument wins.
>
> Can we say as following :
> LDFLAGS = --as-needed $(LDFLAGS)
It should be LDFLAGS := --as-needed $(LDFLAGS)
But I would prefer we avoid workarounds.
^ permalink raw reply [flat|nested] 62+ messages in thread
* [dpdk-dev] [PATCH v2 5/6] mk: sort libraries in level order when linking
2016-06-10 13:19 ` [dpdk-dev] [PATCH v2 0/6] reduce " Thomas Monjalon
` (3 preceding siblings ...)
2016-06-10 13:19 ` [dpdk-dev] [PATCH v2 4/6] mk: prevent overlinking in applications Thomas Monjalon
@ 2016-06-10 13:19 ` Thomas Monjalon
2016-06-10 13:19 ` [dpdk-dev] [PATCH v2 6/6] mk: reduce scope of whole-archive static linking Thomas Monjalon
` (2 subsequent siblings)
7 siblings, 0 replies; 62+ messages in thread
From: Thomas Monjalon @ 2016-06-10 13:19 UTC (permalink / raw)
To: Ferruh Yigit; +Cc: dev
As stated in the comment:
Order is important: from higher level to lower level
This is an attempt to make the layering order better respected.
It will help to restrict the --whole-archive scope for plugins.
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
---
mk/rte.app.mk | 54 ++++++++++++++++++++++++++++--------------------------
1 file changed, 28 insertions(+), 26 deletions(-)
diff --git a/mk/rte.app.mk b/mk/rte.app.mk
index d01a79f..99a7047 100644
--- a/mk/rte.app.mk
+++ b/mk/rte.app.mk
@@ -62,9 +62,6 @@ _LDLIBS-y += -L$(RTE_SDK_BIN)/lib
_LDLIBS-y += --whole-archive
-_LDLIBS-$(CONFIG_RTE_LIBRTE_DISTRIBUTOR) += -lrte_distributor
-_LDLIBS-$(CONFIG_RTE_LIBRTE_REORDER) += -lrte_reorder
-
ifeq ($(CONFIG_RTE_EXEC_ENV_LINUXAPP),y)
_LDLIBS-$(CONFIG_RTE_LIBRTE_KNI) += -lrte_kni
_LDLIBS-$(CONFIG_RTE_LIBRTE_IVSHMEM) += -lrte_ivshmem
@@ -73,34 +70,23 @@ endif
_LDLIBS-$(CONFIG_RTE_LIBRTE_PIPELINE) += -lrte_pipeline
_LDLIBS-$(CONFIG_RTE_LIBRTE_TABLE) += -lrte_table
_LDLIBS-$(CONFIG_RTE_LIBRTE_PORT) += -lrte_port
-_LDLIBS-$(CONFIG_RTE_LIBRTE_TIMER) += -lrte_timer
-_LDLIBS-$(CONFIG_RTE_LIBRTE_HASH) += -lrte_hash
-_LDLIBS-$(CONFIG_RTE_LIBRTE_JOBSTATS) += -lrte_jobstats
-_LDLIBS-$(CONFIG_RTE_LIBRTE_LPM) += -lrte_lpm
-_LDLIBS-$(CONFIG_RTE_LIBRTE_POWER) += -lrte_power
-_LDLIBS-$(CONFIG_RTE_LIBRTE_ACL) += -lrte_acl
+
+_LDLIBS-$(CONFIG_RTE_LIBRTE_DISTRIBUTOR) += -lrte_distributor
+_LDLIBS-$(CONFIG_RTE_LIBRTE_REORDER) += -lrte_reorder
+_LDLIBS-$(CONFIG_RTE_LIBRTE_IP_FRAG) += -lrte_ip_frag
_LDLIBS-$(CONFIG_RTE_LIBRTE_METER) += -lrte_meter
_LDLIBS-$(CONFIG_RTE_LIBRTE_SCHED) += -lrte_sched
-_LDLIBS-$(CONFIG_RTE_LIBRTE_VHOST) += -lrte_vhost
+_LDLIBS-$(CONFIG_RTE_LIBRTE_LPM) += -lrte_lpm
+_LDLIBS-$(CONFIG_RTE_LIBRTE_ACL) += -lrte_acl
+_LDLIBS-$(CONFIG_RTE_LIBRTE_JOBSTATS) += -lrte_jobstats
+_LDLIBS-$(CONFIG_RTE_LIBRTE_POWER) += -lrte_power
-# The static libraries do not know their dependencies.
-# So linking with static library requires explicit dependencies.
-ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),n)
-_LDLIBS-$(CONFIG_RTE_LIBRTE_SCHED) += -lm
-_LDLIBS-$(CONFIG_RTE_LIBRTE_SCHED) += -lrt
-_LDLIBS-$(CONFIG_RTE_LIBRTE_METER) += -lm
-ifeq ($(CONFIG_RTE_LIBRTE_VHOST_NUMA),y)
-_LDLIBS-$(CONFIG_RTE_LIBRTE_VHOST) += -lnuma
-endif
-ifeq ($(CONFIG_RTE_LIBRTE_VHOST_USER),n)
-_LDLIBS-$(CONFIG_RTE_LIBRTE_VHOST) += -lfuse
-endif
-_LDLIBS-$(CONFIG_RTE_PORT_PCAP) += -lpcap
-endif # !CONFIG_RTE_BUILD_SHARED_LIBS
+_LDLIBS-$(CONFIG_RTE_LIBRTE_TIMER) += -lrte_timer
+_LDLIBS-$(CONFIG_RTE_LIBRTE_HASH) += -lrte_hash
+_LDLIBS-$(CONFIG_RTE_LIBRTE_VHOST) += -lrte_vhost
_LDLIBS-$(CONFIG_RTE_LIBRTE_KVARGS) += -lrte_kvargs
_LDLIBS-$(CONFIG_RTE_LIBRTE_MBUF) += -lrte_mbuf
-_LDLIBS-$(CONFIG_RTE_LIBRTE_IP_FRAG) += -lrte_ip_frag
_LDLIBS-$(CONFIG_RTE_LIBRTE_ETHER) += -lethdev
_LDLIBS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += -lrte_cryptodev
_LDLIBS-$(CONFIG_RTE_LIBRTE_MEMPOOL) += -lrte_mempool
@@ -108,6 +94,7 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_RING) += -lrte_ring
_LDLIBS-$(CONFIG_RTE_LIBRTE_EAL) += -lrte_eal
_LDLIBS-$(CONFIG_RTE_LIBRTE_CMDLINE) += -lrte_cmdline
_LDLIBS-$(CONFIG_RTE_LIBRTE_CFGFILE) += -lrte_cfgfile
+
_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += -lrte_pmd_bond
_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_XENVIRT) += -lrte_pmd_xenvirt -lxenstore
@@ -149,7 +136,22 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_SNOW3G) += -lrte_pmd_snow3g
_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_SNOW3G) += -L$(LIBSSO_PATH)/build -lsso
endif # CONFIG_RTE_LIBRTE_CRYPTODEV
-endif # ! $(CONFIG_RTE_BUILD_SHARED_LIB)
+endif # !CONFIG_RTE_BUILD_SHARED_LIBS
+
+ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),n)
+# The static libraries do not know their dependencies.
+# So linking with static library requires explicit dependencies.
+_LDLIBS-$(CONFIG_RTE_LIBRTE_SCHED) += -lm
+_LDLIBS-$(CONFIG_RTE_LIBRTE_SCHED) += -lrt
+_LDLIBS-$(CONFIG_RTE_LIBRTE_METER) += -lm
+ifeq ($(CONFIG_RTE_LIBRTE_VHOST_NUMA),y)
+_LDLIBS-$(CONFIG_RTE_LIBRTE_VHOST) += -lnuma
+endif
+ifeq ($(CONFIG_RTE_LIBRTE_VHOST_USER),n)
+_LDLIBS-$(CONFIG_RTE_LIBRTE_VHOST) += -lfuse
+endif
+_LDLIBS-$(CONFIG_RTE_PORT_PCAP) += -lpcap
+endif # !CONFIG_RTE_BUILD_SHARED_LIBS
_LDLIBS-y += $(EXECENV_LDLIBS)
--
2.7.0
^ permalink raw reply [flat|nested] 62+ messages in thread
* [dpdk-dev] [PATCH v2 6/6] mk: reduce scope of whole-archive static linking
2016-06-10 13:19 ` [dpdk-dev] [PATCH v2 0/6] reduce " Thomas Monjalon
` (4 preceding siblings ...)
2016-06-10 13:19 ` [dpdk-dev] [PATCH v2 5/6] mk: sort libraries in level order when linking Thomas Monjalon
@ 2016-06-10 13:19 ` Thomas Monjalon
2016-06-10 15:03 ` Ferruh Yigit
2016-06-10 18:32 ` [dpdk-dev] [PATCH v3 0/6] reduce overlinking in applications Ferruh Yigit
2016-06-13 14:14 ` [dpdk-dev] [PATCH v2 0/6] reduce overlinking in applications Thomas Monjalon
7 siblings, 1 reply; 62+ messages in thread
From: Thomas Monjalon @ 2016-06-10 13:19 UTC (permalink / raw)
To: Ferruh Yigit; +Cc: dev
From: Ferruh Yigit <ferruh.yigit@intel.com>
The --whole-archive argument is only required for plugins (drivers)
and libraries used by these plugins.
Currently it covers all libraries.
Reducing the scope of this argument slightly reduce final application size
when statically linked.
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
---
v2: keep some basic libs in the whole-archive scope
---
mk/rte.app.mk | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/mk/rte.app.mk b/mk/rte.app.mk
index 99a7047..e9969fc 100644
--- a/mk/rte.app.mk
+++ b/mk/rte.app.mk
@@ -60,8 +60,6 @@ _LDLIBS-y += -L$(RTE_SDK_BIN)/lib
# Order is important: from higher level to lower level
#
-_LDLIBS-y += --whole-archive
-
ifeq ($(CONFIG_RTE_EXEC_ENV_LINUXAPP),y)
_LDLIBS-$(CONFIG_RTE_LIBRTE_KNI) += -lrte_kni
_LDLIBS-$(CONFIG_RTE_LIBRTE_IVSHMEM) += -lrte_ivshmem
@@ -81,6 +79,8 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_ACL) += -lrte_acl
_LDLIBS-$(CONFIG_RTE_LIBRTE_JOBSTATS) += -lrte_jobstats
_LDLIBS-$(CONFIG_RTE_LIBRTE_POWER) += -lrte_power
+_LDLIBS-y += --whole-archive
+
_LDLIBS-$(CONFIG_RTE_LIBRTE_TIMER) += -lrte_timer
_LDLIBS-$(CONFIG_RTE_LIBRTE_HASH) += -lrte_hash
_LDLIBS-$(CONFIG_RTE_LIBRTE_VHOST) += -lrte_vhost
@@ -138,6 +138,8 @@ endif # CONFIG_RTE_LIBRTE_CRYPTODEV
endif # !CONFIG_RTE_BUILD_SHARED_LIBS
+_LDLIBS-y += --no-whole-archive
+
ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),n)
# The static libraries do not know their dependencies.
# So linking with static library requires explicit dependencies.
@@ -155,8 +157,6 @@ endif # !CONFIG_RTE_BUILD_SHARED_LIBS
_LDLIBS-y += $(EXECENV_LDLIBS)
-_LDLIBS-y += --no-whole-archive
-
LDLIBS += $(_LDLIBS-y) $(CPU_LDLIBS) $(EXTRA_LDLIBS)
# Eliminate duplicates without sorting
--
2.7.0
^ permalink raw reply [flat|nested] 62+ messages in thread
* Re: [dpdk-dev] [PATCH v2 6/6] mk: reduce scope of whole-archive static linking
2016-06-10 13:19 ` [dpdk-dev] [PATCH v2 6/6] mk: reduce scope of whole-archive static linking Thomas Monjalon
@ 2016-06-10 15:03 ` Ferruh Yigit
2016-06-10 15:18 ` Thomas Monjalon
0 siblings, 1 reply; 62+ messages in thread
From: Ferruh Yigit @ 2016-06-10 15:03 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: dev
On 6/10/2016 2:19 PM, Thomas Monjalon wrote:
> From: Ferruh Yigit <ferruh.yigit@intel.com>
>
> The --whole-archive argument is only required for plugins (drivers)
> and libraries used by these plugins.
> Currently it covers all libraries.
> Reducing the scope of this argument slightly reduce final application size
> when statically linked.
>
> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
> ---
Technically the scope of --whole-archive should be PMDs, wider scope
required because of unresolved references, but I think this is not good
workaround.
If libraries ordered as suggested before: pmd->librte->external, won't
need to extend scope of parameter
Still some applications will have problem for now, because of cyclic
dependency of librte_eal and librte_mempool, which seems targeted to fix.
So, instead of adding --whole-archive as workaround that efffects whole
binaries, I am for adding workaround for effected application.
The be effected this problem, an application should have direct calls to
librte_eal, but shouldn't have any calls to librte_mempool, I think this
rare case, that is why only a unit test application effected. And when
dependency issue removed we can fix this.
To be able to apply workaround per application, LDFLAGS should be set in
a way to commented previous patch.
Thanks,
ferruh
^ permalink raw reply [flat|nested] 62+ messages in thread
* Re: [dpdk-dev] [PATCH v2 6/6] mk: reduce scope of whole-archive static linking
2016-06-10 15:03 ` Ferruh Yigit
@ 2016-06-10 15:18 ` Thomas Monjalon
0 siblings, 0 replies; 62+ messages in thread
From: Thomas Monjalon @ 2016-06-10 15:18 UTC (permalink / raw)
To: Ferruh Yigit; +Cc: dev
2016-06-10 16:03, Ferruh Yigit:
> On 6/10/2016 2:19 PM, Thomas Monjalon wrote:
> > From: Ferruh Yigit <ferruh.yigit@intel.com>
> >
> > The --whole-archive argument is only required for plugins (drivers)
> > and libraries used by these plugins.
> > Currently it covers all libraries.
> > Reducing the scope of this argument slightly reduce final application size
> > when statically linked.
> >
> > Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> > Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
> > ---
>
> Technically the scope of --whole-archive should be PMDs, wider scope
> required because of unresolved references, but I think this is not good
> workaround.
>
> If libraries ordered as suggested before: pmd->librte->external, won't
> need to extend scope of parameter
>
> Still some applications will have problem for now, because of cyclic
> dependency of librte_eal and librte_mempool, which seems targeted to fix.
>
> So, instead of adding --whole-archive as workaround that efffects whole
> binaries, I am for adding workaround for effected application.
I would prefer keeping a small workaround in rte.app.mk instead of in the
application makefile. We must be careful with applications which may break
because of our changes. This is the kind of issue that they won't fix
quickly.
> The be effected this problem, an application should have direct calls to
> librte_eal, but shouldn't have any calls to librte_mempool, I think this
> rare case, that is why only a unit test application effected. And when
> dependency issue removed we can fix this.
>
> To be able to apply workaround per application, LDFLAGS should be set in
> a way to commented previous patch.
^ permalink raw reply [flat|nested] 62+ messages in thread
* [dpdk-dev] [PATCH v3 0/6] reduce overlinking in applications
2016-06-10 13:19 ` [dpdk-dev] [PATCH v2 0/6] reduce " Thomas Monjalon
` (5 preceding siblings ...)
2016-06-10 13:19 ` [dpdk-dev] [PATCH v2 6/6] mk: reduce scope of whole-archive static linking Thomas Monjalon
@ 2016-06-10 18:32 ` Ferruh Yigit
2016-06-10 18:32 ` [dpdk-dev] [PATCH v3 1/6] mk: sort drivers in static application link list Ferruh Yigit
` (5 more replies)
2016-06-13 14:14 ` [dpdk-dev] [PATCH v2 0/6] reduce overlinking in applications Thomas Monjalon
7 siblings, 6 replies; 62+ messages in thread
From: Ferruh Yigit @ 2016-06-10 18:32 UTC (permalink / raw)
To: dev; +Cc: Thomas Monjalon, Panu Matilainen, Christian Ehrhardt, Ferruh Yigit
This patch set updates application linking, main motivation is to reduce
overlinking in application, also removes library grouping by re-ordering
libraries and for static compilation reduces whole library linking to PMD
libs.
There is a workaround because of librte_eal <-> librte_mempool cyclic
dependency in rte.app.mk, which can be removed when issue solved.
It also brings some clean-up in rte.app.mk.
Ferruh Yigit (3):
mk: sort libraries when linking, move pmd libs to higher level
mk: sort libraries when linking, move external libs to lower level
mk: prevent overlinking in applications
Thomas Monjalon (3):
mk: sort drivers in static application link list
mk: fix driver dependencies order for static application
mk: remove library grouping during application linking
mk/exec-env/linuxapp/rte.vars.mk | 3 -
mk/rte.app.mk | 152 +++++++++++++++++----------------------
2 files changed, 66 insertions(+), 89 deletions(-)
--
2.5.5
^ permalink raw reply [flat|nested] 62+ messages in thread
* [dpdk-dev] [PATCH v3 1/6] mk: sort drivers in static application link list
2016-06-10 18:32 ` [dpdk-dev] [PATCH v3 0/6] reduce overlinking in applications Ferruh Yigit
@ 2016-06-10 18:32 ` Ferruh Yigit
2016-06-10 19:38 ` Wiles, Keith
2016-06-10 18:32 ` [dpdk-dev] [PATCH v3 2/6] mk: fix driver dependencies order for static application Ferruh Yigit
` (4 subsequent siblings)
5 siblings, 1 reply; 62+ messages in thread
From: Ferruh Yigit @ 2016-06-10 18:32 UTC (permalink / raw)
To: dev; +Cc: Thomas Monjalon, Panu Matilainen, Christian Ehrhardt
From: Thomas Monjalon <thomas.monjalon@6wind.com>
Just a clean up to prepare next patches.
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
---
mk/rte.app.mk | 45 +++++++++++++++++----------------------------
1 file changed, 17 insertions(+), 28 deletions(-)
diff --git a/mk/rte.app.mk b/mk/rte.app.mk
index b84b56d..07be17c 100644
--- a/mk/rte.app.mk
+++ b/mk/rte.app.mk
@@ -124,57 +124,46 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_EAL) += -lrte_eal
_LDLIBS-$(CONFIG_RTE_LIBRTE_CMDLINE) += -lrte_cmdline
_LDLIBS-$(CONFIG_RTE_LIBRTE_CFGFILE) += -lrte_cfgfile
_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += -lrte_pmd_bond
-
_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_XENVIRT) += -lrte_pmd_xenvirt
ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),n)
# plugins (link only if static libraries)
-_LDLIBS-$(CONFIG_RTE_LIBRTE_VMXNET3_PMD) += -lrte_pmd_vmxnet3_uio
-_LDLIBS-$(CONFIG_RTE_LIBRTE_VIRTIO_PMD) += -lrte_pmd_virtio
+_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AF_PACKET) += -lrte_pmd_af_packet
_LDLIBS-$(CONFIG_RTE_LIBRTE_BNX2X_PMD) += -lrte_pmd_bnx2x
_LDLIBS-$(CONFIG_RTE_LIBRTE_CXGBE_PMD) += -lrte_pmd_cxgbe
+_LDLIBS-$(CONFIG_RTE_LIBRTE_E1000_PMD) += -lrte_pmd_e1000
+_LDLIBS-$(CONFIG_RTE_LIBRTE_ENA_PMD) += -lrte_pmd_ena
_LDLIBS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += -lrte_pmd_enic
-_LDLIBS-$(CONFIG_RTE_LIBRTE_I40E_PMD) += -lrte_pmd_i40e
_LDLIBS-$(CONFIG_RTE_LIBRTE_FM10K_PMD) += -lrte_pmd_fm10k
+_LDLIBS-$(CONFIG_RTE_LIBRTE_I40E_PMD) += -lrte_pmd_i40e
_LDLIBS-$(CONFIG_RTE_LIBRTE_IXGBE_PMD) += -lrte_pmd_ixgbe
-_LDLIBS-$(CONFIG_RTE_LIBRTE_E1000_PMD) += -lrte_pmd_e1000
-_LDLIBS-$(CONFIG_RTE_LIBRTE_ENA_PMD) += -lrte_pmd_ena
_LDLIBS-$(CONFIG_RTE_LIBRTE_MLX4_PMD) += -lrte_pmd_mlx4
_LDLIBS-$(CONFIG_RTE_LIBRTE_MLX5_PMD) += -lrte_pmd_mlx5
-_LDLIBS-$(CONFIG_RTE_LIBRTE_NFP_PMD) += -lrte_pmd_nfp
-_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_SZEDATA2) += -lrte_pmd_szedata2
_LDLIBS-$(CONFIG_RTE_LIBRTE_MPIPE_PMD) += -lrte_pmd_mpipe
-_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_RING) += -lrte_pmd_ring
+_LDLIBS-$(CONFIG_RTE_LIBRTE_NFP_PMD) += -lrte_pmd_nfp
+_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_NULL) += -lrte_pmd_null
_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_PCAP) += -lrte_pmd_pcap
-_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AF_PACKET) += -lrte_pmd_af_packet
_LDLIBS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += -lrte_pmd_qede
-_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_NULL) += -lrte_pmd_null
+_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_RING) += -lrte_pmd_ring
+_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_SZEDATA2) += -lrte_pmd_szedata2
+_LDLIBS-$(CONFIG_RTE_LIBRTE_VIRTIO_PMD) += -lrte_pmd_virtio
+ifeq ($(CONFIG_RTE_LIBRTE_VHOST),y)
+_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_VHOST) += -lrte_pmd_vhost
+endif # $(CONFIG_RTE_LIBRTE_VHOST)
+_LDLIBS-$(CONFIG_RTE_LIBRTE_VMXNET3_PMD) += -lrte_pmd_vmxnet3_uio
ifeq ($(CONFIG_RTE_LIBRTE_CRYPTODEV),y)
-_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_QAT) += -lrte_pmd_qat
_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_MB) += -lrte_pmd_aesni_mb
-_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_GCM) += -lrte_pmd_aesni_gcm
+_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_MB) += -L$(AESNI_MULTI_BUFFER_LIB_PATH) -lIPSec_MB
+_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_GCM) += -lrte_pmd_aesni_gcm
+_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_GCM) += -L$(AESNI_MULTI_BUFFER_LIB_PATH) -lIPSec_MB
_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_NULL_CRYPTO) += -lrte_pmd_null_crypto
-
-# AESNI MULTI BUFFER / GCM PMDs are dependent on the IPSec_MB library
-ifeq ($(CONFIG_RTE_LIBRTE_PMD_AESNI_MB),y)
-_LDLIBS-y += -L$(AESNI_MULTI_BUFFER_LIB_PATH) -lIPSec_MB
-else ifeq ($(CONFIG_RTE_LIBRTE_PMD_AESNI_GCM),y)
-_LDLIBS-y += -L$(AESNI_MULTI_BUFFER_LIB_PATH) -lIPSec_MB
-endif
-
-# SNOW3G PMD is dependent on the LIBSSO library
+_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_QAT) += -lrte_pmd_qat
_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_SNOW3G) += -lrte_pmd_snow3g
_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_SNOW3G) += -L$(LIBSSO_PATH)/build -lsso
endif # CONFIG_RTE_LIBRTE_CRYPTODEV
-ifeq ($(CONFIG_RTE_LIBRTE_VHOST),y)
-
-_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_VHOST) += -lrte_pmd_vhost
-
-endif # $(CONFIG_RTE_LIBRTE_VHOST)
-
endif # ! $(CONFIG_RTE_BUILD_SHARED_LIB)
_LDLIBS-y += $(EXECENV_LDLIBS)
--
2.5.5
^ permalink raw reply [flat|nested] 62+ messages in thread
* Re: [dpdk-dev] [PATCH v3 1/6] mk: sort drivers in static application link list
2016-06-10 18:32 ` [dpdk-dev] [PATCH v3 1/6] mk: sort drivers in static application link list Ferruh Yigit
@ 2016-06-10 19:38 ` Wiles, Keith
0 siblings, 0 replies; 62+ messages in thread
From: Wiles, Keith @ 2016-06-10 19:38 UTC (permalink / raw)
To: Yigit, Ferruh, dev; +Cc: Thomas Monjalon, Panu Matilainen, Christian Ehrhardt
On 6/10/16, 1:32 PM, "dev on behalf of Ferruh Yigit" <dev-bounces@dpdk.org on behalf of ferruh.yigit@intel.com> wrote:
>From: Thomas Monjalon <thomas.monjalon@6wind.com>
>
>Just a clean up to prepare next patches.
One thing you have or will do with these patches is create a set of groups PMD, Core, LIB, … and sort the items in each group. I was thinking it maybe more useful to use different names for the groups instead of _LDLIBS e.g. _PMD, _CORE, _LIB(this one may not work), _XYZ then create _LDLIBS from these groups. I know it is another change and sorry I did not catch it before. This only makes sense if we need say different PMD libs in different places within the _LDLIBS variable. Something to think about if you have to make changes again.
>
>Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
>---
> mk/rte.app.mk | 45 +++++++++++++++++----------------------------
> 1 file changed, 17 insertions(+), 28 deletions(-)
>
>diff --git a/mk/rte.app.mk b/mk/rte.app.mk
>index b84b56d..07be17c 100644
>--- a/mk/rte.app.mk
>+++ b/mk/rte.app.mk
>@@ -124,57 +124,46 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_EAL) += -lrte_eal
> _LDLIBS-$(CONFIG_RTE_LIBRTE_CMDLINE) += -lrte_cmdline
> _LDLIBS-$(CONFIG_RTE_LIBRTE_CFGFILE) += -lrte_cfgfile
> _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += -lrte_pmd_bond
>-
> _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_XENVIRT) += -lrte_pmd_xenvirt
>
> ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),n)
> # plugins (link only if static libraries)
>
>-_LDLIBS-$(CONFIG_RTE_LIBRTE_VMXNET3_PMD) += -lrte_pmd_vmxnet3_uio
>-_LDLIBS-$(CONFIG_RTE_LIBRTE_VIRTIO_PMD) += -lrte_pmd_virtio
>+_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AF_PACKET) += -lrte_pmd_af_packet
> _LDLIBS-$(CONFIG_RTE_LIBRTE_BNX2X_PMD) += -lrte_pmd_bnx2x
> _LDLIBS-$(CONFIG_RTE_LIBRTE_CXGBE_PMD) += -lrte_pmd_cxgbe
>+_LDLIBS-$(CONFIG_RTE_LIBRTE_E1000_PMD) += -lrte_pmd_e1000
>+_LDLIBS-$(CONFIG_RTE_LIBRTE_ENA_PMD) += -lrte_pmd_ena
> _LDLIBS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += -lrte_pmd_enic
>-_LDLIBS-$(CONFIG_RTE_LIBRTE_I40E_PMD) += -lrte_pmd_i40e
> _LDLIBS-$(CONFIG_RTE_LIBRTE_FM10K_PMD) += -lrte_pmd_fm10k
>+_LDLIBS-$(CONFIG_RTE_LIBRTE_I40E_PMD) += -lrte_pmd_i40e
> _LDLIBS-$(CONFIG_RTE_LIBRTE_IXGBE_PMD) += -lrte_pmd_ixgbe
>-_LDLIBS-$(CONFIG_RTE_LIBRTE_E1000_PMD) += -lrte_pmd_e1000
>-_LDLIBS-$(CONFIG_RTE_LIBRTE_ENA_PMD) += -lrte_pmd_ena
> _LDLIBS-$(CONFIG_RTE_LIBRTE_MLX4_PMD) += -lrte_pmd_mlx4
> _LDLIBS-$(CONFIG_RTE_LIBRTE_MLX5_PMD) += -lrte_pmd_mlx5
>-_LDLIBS-$(CONFIG_RTE_LIBRTE_NFP_PMD) += -lrte_pmd_nfp
>-_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_SZEDATA2) += -lrte_pmd_szedata2
> _LDLIBS-$(CONFIG_RTE_LIBRTE_MPIPE_PMD) += -lrte_pmd_mpipe
>-_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_RING) += -lrte_pmd_ring
>+_LDLIBS-$(CONFIG_RTE_LIBRTE_NFP_PMD) += -lrte_pmd_nfp
>+_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_NULL) += -lrte_pmd_null
> _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_PCAP) += -lrte_pmd_pcap
>-_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AF_PACKET) += -lrte_pmd_af_packet
> _LDLIBS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += -lrte_pmd_qede
>-_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_NULL) += -lrte_pmd_null
>+_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_RING) += -lrte_pmd_ring
>+_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_SZEDATA2) += -lrte_pmd_szedata2
>+_LDLIBS-$(CONFIG_RTE_LIBRTE_VIRTIO_PMD) += -lrte_pmd_virtio
>+ifeq ($(CONFIG_RTE_LIBRTE_VHOST),y)
>+_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_VHOST) += -lrte_pmd_vhost
>+endif # $(CONFIG_RTE_LIBRTE_VHOST)
>+_LDLIBS-$(CONFIG_RTE_LIBRTE_VMXNET3_PMD) += -lrte_pmd_vmxnet3_uio
>
> ifeq ($(CONFIG_RTE_LIBRTE_CRYPTODEV),y)
>-_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_QAT) += -lrte_pmd_qat
> _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_MB) += -lrte_pmd_aesni_mb
>-_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_GCM) += -lrte_pmd_aesni_gcm
>+_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_MB) += -L$(AESNI_MULTI_BUFFER_LIB_PATH) -lIPSec_MB
>+_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_GCM) += -lrte_pmd_aesni_gcm
>+_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_GCM) += -L$(AESNI_MULTI_BUFFER_LIB_PATH) -lIPSec_MB
> _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_NULL_CRYPTO) += -lrte_pmd_null_crypto
>-
>-# AESNI MULTI BUFFER / GCM PMDs are dependent on the IPSec_MB library
>-ifeq ($(CONFIG_RTE_LIBRTE_PMD_AESNI_MB),y)
>-_LDLIBS-y += -L$(AESNI_MULTI_BUFFER_LIB_PATH) -lIPSec_MB
>-else ifeq ($(CONFIG_RTE_LIBRTE_PMD_AESNI_GCM),y)
>-_LDLIBS-y += -L$(AESNI_MULTI_BUFFER_LIB_PATH) -lIPSec_MB
>-endif
>-
>-# SNOW3G PMD is dependent on the LIBSSO library
>+_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_QAT) += -lrte_pmd_qat
> _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_SNOW3G) += -lrte_pmd_snow3g
> _LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_SNOW3G) += -L$(LIBSSO_PATH)/build -lsso
> endif # CONFIG_RTE_LIBRTE_CRYPTODEV
>
>-ifeq ($(CONFIG_RTE_LIBRTE_VHOST),y)
>-
>-_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_VHOST) += -lrte_pmd_vhost
>-
>-endif # $(CONFIG_RTE_LIBRTE_VHOST)
>-
> endif # ! $(CONFIG_RTE_BUILD_SHARED_LIB)
>
> _LDLIBS-y += $(EXECENV_LDLIBS)
>--
>2.5.5
>
>
^ permalink raw reply [flat|nested] 62+ messages in thread
* [dpdk-dev] [PATCH v3 2/6] mk: fix driver dependencies order for static application
2016-06-10 18:32 ` [dpdk-dev] [PATCH v3 0/6] reduce overlinking in applications Ferruh Yigit
2016-06-10 18:32 ` [dpdk-dev] [PATCH v3 1/6] mk: sort drivers in static application link list Ferruh Yigit
@ 2016-06-10 18:32 ` Ferruh Yigit
2016-06-10 18:32 ` [dpdk-dev] [PATCH v3 3/6] mk: sort libraries when linking, move pmd libs to higher level Ferruh Yigit
` (3 subsequent siblings)
5 siblings, 0 replies; 62+ messages in thread
From: Ferruh Yigit @ 2016-06-10 18:32 UTC (permalink / raw)
To: dev; +Cc: Thomas Monjalon, Panu Matilainen, Christian Ehrhardt
From: Thomas Monjalon <thomas.monjalon@6wind.com>
On a linker command line, the dependencies must be declared after
the libraries using them.
It will avoid some issues when building an application with static
libraries and --as-needed option.
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
---
mk/rte.app.mk | 38 +++++++++++---------------------------
1 file changed, 11 insertions(+), 27 deletions(-)
diff --git a/mk/rte.app.mk b/mk/rte.app.mk
index 07be17c..8068e66 100644
--- a/mk/rte.app.mk
+++ b/mk/rte.app.mk
@@ -93,22 +93,6 @@ ifeq ($(CONFIG_RTE_LIBRTE_VHOST_USER),n)
_LDLIBS-$(CONFIG_RTE_LIBRTE_VHOST) += -lfuse
endif
_LDLIBS-$(CONFIG_RTE_PORT_PCAP) += -lpcap
-_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_PCAP) += -lpcap
-_LDLIBS-$(CONFIG_RTE_LIBRTE_BNX2X_PMD) += -lz
-_LDLIBS-$(CONFIG_RTE_LIBRTE_MLX4_PMD) += -libverbs
-_LDLIBS-$(CONFIG_RTE_LIBRTE_MLX5_PMD) += -libverbs
-_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_SZEDATA2) += -lsze2
-_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_XENVIRT) += -lxenstore
-_LDLIBS-$(CONFIG_RTE_LIBRTE_MPIPE_PMD) += -lgxio
-_LDLIBS-$(CONFIG_RTE_LIBRTE_NFP_PMD) += -lm
-_LDLIBS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += -lz
-# QAT / AESNI GCM PMDs are dependent on libcrypto (from openssl)
-# for calculating HMAC precomputes
-ifeq ($(CONFIG_RTE_LIBRTE_PMD_QAT),y)
-_LDLIBS-y += -lcrypto
-else ifeq ($(CONFIG_RTE_LIBRTE_PMD_AESNI_GCM),y)
-_LDLIBS-y += -lcrypto
-endif
endif # !CONFIG_RTE_BUILD_SHARED_LIBS
_LDLIBS-y += --start-group
@@ -124,13 +108,13 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_EAL) += -lrte_eal
_LDLIBS-$(CONFIG_RTE_LIBRTE_CMDLINE) += -lrte_cmdline
_LDLIBS-$(CONFIG_RTE_LIBRTE_CFGFILE) += -lrte_cfgfile
_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += -lrte_pmd_bond
-_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_XENVIRT) += -lrte_pmd_xenvirt
+_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_XENVIRT) += -lrte_pmd_xenvirt -lxenstore
ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),n)
# plugins (link only if static libraries)
_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AF_PACKET) += -lrte_pmd_af_packet
-_LDLIBS-$(CONFIG_RTE_LIBRTE_BNX2X_PMD) += -lrte_pmd_bnx2x
+_LDLIBS-$(CONFIG_RTE_LIBRTE_BNX2X_PMD) += -lrte_pmd_bnx2x -lz
_LDLIBS-$(CONFIG_RTE_LIBRTE_CXGBE_PMD) += -lrte_pmd_cxgbe
_LDLIBS-$(CONFIG_RTE_LIBRTE_E1000_PMD) += -lrte_pmd_e1000
_LDLIBS-$(CONFIG_RTE_LIBRTE_ENA_PMD) += -lrte_pmd_ena
@@ -138,15 +122,15 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += -lrte_pmd_enic
_LDLIBS-$(CONFIG_RTE_LIBRTE_FM10K_PMD) += -lrte_pmd_fm10k
_LDLIBS-$(CONFIG_RTE_LIBRTE_I40E_PMD) += -lrte_pmd_i40e
_LDLIBS-$(CONFIG_RTE_LIBRTE_IXGBE_PMD) += -lrte_pmd_ixgbe
-_LDLIBS-$(CONFIG_RTE_LIBRTE_MLX4_PMD) += -lrte_pmd_mlx4
-_LDLIBS-$(CONFIG_RTE_LIBRTE_MLX5_PMD) += -lrte_pmd_mlx5
-_LDLIBS-$(CONFIG_RTE_LIBRTE_MPIPE_PMD) += -lrte_pmd_mpipe
-_LDLIBS-$(CONFIG_RTE_LIBRTE_NFP_PMD) += -lrte_pmd_nfp
+_LDLIBS-$(CONFIG_RTE_LIBRTE_MLX4_PMD) += -lrte_pmd_mlx4 -libverbs
+_LDLIBS-$(CONFIG_RTE_LIBRTE_MLX5_PMD) += -lrte_pmd_mlx5 -libverbs
+_LDLIBS-$(CONFIG_RTE_LIBRTE_MPIPE_PMD) += -lrte_pmd_mpipe -lgxio
+_LDLIBS-$(CONFIG_RTE_LIBRTE_NFP_PMD) += -lrte_pmd_nfp -lm
_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_NULL) += -lrte_pmd_null
-_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_PCAP) += -lrte_pmd_pcap
-_LDLIBS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += -lrte_pmd_qede
+_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_PCAP) += -lrte_pmd_pcap -lpcap
+_LDLIBS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += -lrte_pmd_qede -lz
_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_RING) += -lrte_pmd_ring
-_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_SZEDATA2) += -lrte_pmd_szedata2
+_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_SZEDATA2) += -lrte_pmd_szedata2 -lsze2
_LDLIBS-$(CONFIG_RTE_LIBRTE_VIRTIO_PMD) += -lrte_pmd_virtio
ifeq ($(CONFIG_RTE_LIBRTE_VHOST),y)
_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_VHOST) += -lrte_pmd_vhost
@@ -156,10 +140,10 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_VMXNET3_PMD) += -lrte_pmd_vmxnet3_uio
ifeq ($(CONFIG_RTE_LIBRTE_CRYPTODEV),y)
_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_MB) += -lrte_pmd_aesni_mb
_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_MB) += -L$(AESNI_MULTI_BUFFER_LIB_PATH) -lIPSec_MB
-_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_GCM) += -lrte_pmd_aesni_gcm
+_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_GCM) += -lrte_pmd_aesni_gcm -lcrypto
_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_GCM) += -L$(AESNI_MULTI_BUFFER_LIB_PATH) -lIPSec_MB
_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_NULL_CRYPTO) += -lrte_pmd_null_crypto
-_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_QAT) += -lrte_pmd_qat
+_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_QAT) += -lrte_pmd_qat -lcrypto
_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_SNOW3G) += -lrte_pmd_snow3g
_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_SNOW3G) += -L$(LIBSSO_PATH)/build -lsso
endif # CONFIG_RTE_LIBRTE_CRYPTODEV
--
2.5.5
^ permalink raw reply [flat|nested] 62+ messages in thread
* [dpdk-dev] [PATCH v3 3/6] mk: sort libraries when linking, move pmd libs to higher level
2016-06-10 18:32 ` [dpdk-dev] [PATCH v3 0/6] reduce overlinking in applications Ferruh Yigit
2016-06-10 18:32 ` [dpdk-dev] [PATCH v3 1/6] mk: sort drivers in static application link list Ferruh Yigit
2016-06-10 18:32 ` [dpdk-dev] [PATCH v3 2/6] mk: fix driver dependencies order for static application Ferruh Yigit
@ 2016-06-10 18:32 ` Ferruh Yigit
2016-06-13 9:29 ` Thomas Monjalon
2016-06-10 18:32 ` [dpdk-dev] [PATCH v3 4/6] mk: sort libraries when linking, move external libs to lower level Ferruh Yigit
` (2 subsequent siblings)
5 siblings, 1 reply; 62+ messages in thread
From: Ferruh Yigit @ 2016-06-10 18:32 UTC (permalink / raw)
To: dev; +Cc: Thomas Monjalon, Panu Matilainen, Christian Ehrhardt, Ferruh Yigit
As stated in the comment:
Order is important: from higher level to lower level
This is an attempt to make the layering order better respected.
Limit scope of --whole-archive to pmd libraries
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
mk/rte.app.mk | 88 ++++++++++++++++++++++++++++++-----------------------------
1 file changed, 45 insertions(+), 43 deletions(-)
diff --git a/mk/rte.app.mk b/mk/rte.app.mk
index 8068e66..b8761ae 100644
--- a/mk/rte.app.mk
+++ b/mk/rte.app.mk
@@ -59,6 +59,51 @@ _LDLIBS-y += -L$(RTE_SDK_BIN)/lib
_LDLIBS-y += --whole-archive
+ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),n)
+# plugins (link only if static libraries)
+
+_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AF_PACKET) += -lrte_pmd_af_packet
+_LDLIBS-$(CONFIG_RTE_LIBRTE_BNX2X_PMD) += -lrte_pmd_bnx2x -lz
+_LDLIBS-$(CONFIG_RTE_LIBRTE_CXGBE_PMD) += -lrte_pmd_cxgbe
+_LDLIBS-$(CONFIG_RTE_LIBRTE_E1000_PMD) += -lrte_pmd_e1000
+_LDLIBS-$(CONFIG_RTE_LIBRTE_ENA_PMD) += -lrte_pmd_ena
+_LDLIBS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += -lrte_pmd_enic
+_LDLIBS-$(CONFIG_RTE_LIBRTE_FM10K_PMD) += -lrte_pmd_fm10k
+_LDLIBS-$(CONFIG_RTE_LIBRTE_I40E_PMD) += -lrte_pmd_i40e
+_LDLIBS-$(CONFIG_RTE_LIBRTE_IXGBE_PMD) += -lrte_pmd_ixgbe
+_LDLIBS-$(CONFIG_RTE_LIBRTE_MLX4_PMD) += -lrte_pmd_mlx4 -libverbs
+_LDLIBS-$(CONFIG_RTE_LIBRTE_MLX5_PMD) += -lrte_pmd_mlx5 -libverbs
+_LDLIBS-$(CONFIG_RTE_LIBRTE_MPIPE_PMD) += -lrte_pmd_mpipe -lgxio
+_LDLIBS-$(CONFIG_RTE_LIBRTE_NFP_PMD) += -lrte_pmd_nfp -lm
+_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_NULL) += -lrte_pmd_null
+_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_PCAP) += -lrte_pmd_pcap -lpcap
+_LDLIBS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += -lrte_pmd_qede -lz
+_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_RING) += -lrte_pmd_ring
+_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_SZEDATA2) += -lrte_pmd_szedata2 -lsze2
+_LDLIBS-$(CONFIG_RTE_LIBRTE_VIRTIO_PMD) += -lrte_pmd_virtio
+ifeq ($(CONFIG_RTE_LIBRTE_VHOST),y)
+_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_VHOST) += -lrte_pmd_vhost
+endif # $(CONFIG_RTE_LIBRTE_VHOST)
+_LDLIBS-$(CONFIG_RTE_LIBRTE_VMXNET3_PMD) += -lrte_pmd_vmxnet3_uio
+
+ifeq ($(CONFIG_RTE_LIBRTE_CRYPTODEV),y)
+_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_MB) += -lrte_pmd_aesni_mb
+_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_MB) += -L$(AESNI_MULTI_BUFFER_LIB_PATH) -lIPSec_MB
+_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_GCM) += -lrte_pmd_aesni_gcm -lcrypto
+_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_GCM) += -L$(AESNI_MULTI_BUFFER_LIB_PATH) -lIPSec_MB
+_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_NULL_CRYPTO) += -lrte_pmd_null_crypto
+_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_QAT) += -lrte_pmd_qat -lcrypto
+_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_SNOW3G) += -lrte_pmd_snow3g
+_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_SNOW3G) += -L$(LIBSSO_PATH)/build -lsso
+endif # CONFIG_RTE_LIBRTE_CRYPTODEV
+
+endif # ! $(CONFIG_RTE_BUILD_SHARED_LIB)
+
+_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += -lrte_pmd_bond
+_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_XENVIRT) += -lrte_pmd_xenvirt -lxenstore
+
+_LDLIBS-y += --no-whole-archive
+
_LDLIBS-$(CONFIG_RTE_LIBRTE_DISTRIBUTOR) += -lrte_distributor
_LDLIBS-$(CONFIG_RTE_LIBRTE_REORDER) += -lrte_reorder
@@ -107,52 +152,9 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_RING) += -lrte_ring
_LDLIBS-$(CONFIG_RTE_LIBRTE_EAL) += -lrte_eal
_LDLIBS-$(CONFIG_RTE_LIBRTE_CMDLINE) += -lrte_cmdline
_LDLIBS-$(CONFIG_RTE_LIBRTE_CFGFILE) += -lrte_cfgfile
-_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += -lrte_pmd_bond
-_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_XENVIRT) += -lrte_pmd_xenvirt -lxenstore
-
-ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),n)
-# plugins (link only if static libraries)
-
-_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AF_PACKET) += -lrte_pmd_af_packet
-_LDLIBS-$(CONFIG_RTE_LIBRTE_BNX2X_PMD) += -lrte_pmd_bnx2x -lz
-_LDLIBS-$(CONFIG_RTE_LIBRTE_CXGBE_PMD) += -lrte_pmd_cxgbe
-_LDLIBS-$(CONFIG_RTE_LIBRTE_E1000_PMD) += -lrte_pmd_e1000
-_LDLIBS-$(CONFIG_RTE_LIBRTE_ENA_PMD) += -lrte_pmd_ena
-_LDLIBS-$(CONFIG_RTE_LIBRTE_ENIC_PMD) += -lrte_pmd_enic
-_LDLIBS-$(CONFIG_RTE_LIBRTE_FM10K_PMD) += -lrte_pmd_fm10k
-_LDLIBS-$(CONFIG_RTE_LIBRTE_I40E_PMD) += -lrte_pmd_i40e
-_LDLIBS-$(CONFIG_RTE_LIBRTE_IXGBE_PMD) += -lrte_pmd_ixgbe
-_LDLIBS-$(CONFIG_RTE_LIBRTE_MLX4_PMD) += -lrte_pmd_mlx4 -libverbs
-_LDLIBS-$(CONFIG_RTE_LIBRTE_MLX5_PMD) += -lrte_pmd_mlx5 -libverbs
-_LDLIBS-$(CONFIG_RTE_LIBRTE_MPIPE_PMD) += -lrte_pmd_mpipe -lgxio
-_LDLIBS-$(CONFIG_RTE_LIBRTE_NFP_PMD) += -lrte_pmd_nfp -lm
-_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_NULL) += -lrte_pmd_null
-_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_PCAP) += -lrte_pmd_pcap -lpcap
-_LDLIBS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += -lrte_pmd_qede -lz
-_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_RING) += -lrte_pmd_ring
-_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_SZEDATA2) += -lrte_pmd_szedata2 -lsze2
-_LDLIBS-$(CONFIG_RTE_LIBRTE_VIRTIO_PMD) += -lrte_pmd_virtio
-ifeq ($(CONFIG_RTE_LIBRTE_VHOST),y)
-_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_VHOST) += -lrte_pmd_vhost
-endif # $(CONFIG_RTE_LIBRTE_VHOST)
-_LDLIBS-$(CONFIG_RTE_LIBRTE_VMXNET3_PMD) += -lrte_pmd_vmxnet3_uio
-
-ifeq ($(CONFIG_RTE_LIBRTE_CRYPTODEV),y)
-_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_MB) += -lrte_pmd_aesni_mb
-_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_MB) += -L$(AESNI_MULTI_BUFFER_LIB_PATH) -lIPSec_MB
-_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_GCM) += -lrte_pmd_aesni_gcm -lcrypto
-_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_AESNI_GCM) += -L$(AESNI_MULTI_BUFFER_LIB_PATH) -lIPSec_MB
-_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_NULL_CRYPTO) += -lrte_pmd_null_crypto
-_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_QAT) += -lrte_pmd_qat -lcrypto
-_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_SNOW3G) += -lrte_pmd_snow3g
-_LDLIBS-$(CONFIG_RTE_LIBRTE_PMD_SNOW3G) += -L$(LIBSSO_PATH)/build -lsso
-endif # CONFIG_RTE_LIBRTE_CRYPTODEV
-
-endif # ! $(CONFIG_RTE_BUILD_SHARED_LIB)
_LDLIBS-y += $(EXECENV_LDLIBS)
_LDLIBS-y += --end-group
-_LDLIBS-y += --no-whole-archive
LDLIBS += $(_LDLIBS-y) $(CPU_LDLIBS) $(EXTRA_LDLIBS)
--
2.5.5
^ permalink raw reply [flat|nested] 62+ messages in thread
* Re: [dpdk-dev] [PATCH v3 3/6] mk: sort libraries when linking, move pmd libs to higher level
2016-06-10 18:32 ` [dpdk-dev] [PATCH v3 3/6] mk: sort libraries when linking, move pmd libs to higher level Ferruh Yigit
@ 2016-06-13 9:29 ` Thomas Monjalon
2016-06-13 10:04 ` Ferruh Yigit
0 siblings, 1 reply; 62+ messages in thread
From: Thomas Monjalon @ 2016-06-13 9:29 UTC (permalink / raw)
To: Ferruh Yigit; +Cc: dev, Panu Matilainen, Christian Ehrhardt
2016-06-10 19:32, Ferruh Yigit:
> As stated in the comment:
> Order is important: from higher level to lower level
>
> This is an attempt to make the layering order better respected.
>
> Limit scope of --whole-archive to pmd libraries
Compared to the link order in the v2, you did two things:
1/ move PMDs to the first position
2/ restrict --whole-archive to PMDs only
Having the PMDs first, helps the linker to get all the PMD dependencies
in the static binary. Thus it seems we do not need --whole-archive
for the PMD dependencies (ethdev, mbuf, etc).
But, if an external PMD is loaded via dlopen, it is possible that it
needs a symbol which was not used by the internal PMDs. So it will not
be found in the statically linked binary.
Let's take another example: if we disable the internal PMDs with their
config options from the static build, and we decide to build them
separately as DSOs. We won't be able to load them as plugins because
they depend on symbols which won't be found in the static binary.
To make it short, the PMDs must be considered as plugins. Therefore, we
must not rely on their availability to link the required symbols in
a static binary.
To make sure the plugin loading will be always well achieved, we must
link the static PMDs at the last position.
If you agree, I vote for the v2 of this patchset.
^ permalink raw reply [flat|nested] 62+ messages in thread
* Re: [dpdk-dev] [PATCH v3 3/6] mk: sort libraries when linking, move pmd libs to higher level
2016-06-13 9:29 ` Thomas Monjalon
@ 2016-06-13 10:04 ` Ferruh Yigit
2016-06-13 10:21 ` Thomas Monjalon
0 siblings, 1 reply; 62+ messages in thread
From: Ferruh Yigit @ 2016-06-13 10:04 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: dev, Panu Matilainen, Christian Ehrhardt
On 6/13/2016 10:29 AM, Thomas Monjalon wrote:
> 2016-06-10 19:32, Ferruh Yigit:
>> As stated in the comment:
>> Order is important: from higher level to lower level
>>
>> This is an attempt to make the layering order better respected.
>>
>> Limit scope of --whole-archive to pmd libraries
>
> Compared to the link order in the v2, you did two things:
> 1/ move PMDs to the first position
> 2/ restrict --whole-archive to PMDs only
>
> Having the PMDs first, helps the linker to get all the PMD dependencies
> in the static binary. Thus it seems we do not need --whole-archive
> for the PMD dependencies (ethdev, mbuf, etc).
> But, if an external PMD is loaded via dlopen, it is possible that it
> needs a symbol which was not used by the internal PMDs. So it will not
> be found in the statically linked binary.
> Let's take another example: if we disable the internal PMDs with their
> config options from the static build, and we decide to build them
> separately as DSOs. We won't be able to load them as plugins because
> they depend on symbols which won't be found in the static binary.
So you want to keep all objects in final binary (used or unused) because
of the possibility that any plugin may use them.
But what is the list to include here, whole dpdk?, -since we may not
know what API will plugin call.
What I am confused is --whole-archive only used when dpdk compiled as
static, if dpdk compiled as shared, each PMD should have proper
dependencies [1], and if external PMD compiled properly there shouldn't
be a problem. So do we have a case that dpdk compiled statically into
final binary but we still want to load some plugins dynamically?
>
> To make it short, the PMDs must be considered as plugins. Therefore, we
> must not rely on their availability to link the required symbols in
> a static binary.
> To make sure the plugin loading will be always well achieved, we must
> link the static PMDs at the last position.
I think this is not the issue of linking PMD's first or last, but
expanding --whole-archive to cover other libraries other than PMDs.
>
> If you agree, I vote for the v2 of this patchset.
If this is breaking something and best way to fix is not in external PMD
but in here, please feel free to go with v2.
[1] Like all has mbuf.so dependency:
# ldd build/lib/librte_pmd_ring.so
linux-vdso.so.1 (0x00007ffe3d78a000)
librte_eal.so.2.1 => not found
librte_ring.so.1.1 => not found
librte_mbuf.so.2.1 => not found
libethdev.so.4.1 => not found
librte_kvargs.so.1.1 => not found
libc.so.6 => /lib64/libc.so.6 (0x00007f8ab5ae1000)
/lib64/ld-linux-x86-64.so.2 (0x0000556616488000)
# ldd build/lib/librte_pmd_af_packet.so
linux-vdso.so.1 (0x00007ffcb0572000)
librte_mbuf.so.2.1 => not found
libethdev.so.4.1 => not found
librte_kvargs.so.1.1 => not found
libc.so.6 => /lib64/libc.so.6 (0x00007f7fbd4aa000)
/lib64/ld-linux-x86-64.so.2 (0x00005604556d2000)
# ldd build/lib/librte_pmd_null.so
linux-vdso.so.1 (0x00007ffdf08cf000)
librte_mbuf.so.2.1 => not found
libethdev.so.4.1 => not found
librte_kvargs.so.1.1 => not found
libc.so.6 => /lib64/libc.so.6 (0x00007fca6fbfc000)
/lib64/ld-linux-x86-64.so.2 (0x000055fe7dd4a000)
Thanks,
ferruh
^ permalink raw reply [flat|nested] 62+ messages in thread
* Re: [dpdk-dev] [PATCH v3 3/6] mk: sort libraries when linking, move pmd libs to higher level
2016-06-13 10:04 ` Ferruh Yigit
@ 2016-06-13 10:21 ` Thomas Monjalon
2016-06-13 10:29 ` Ferruh Yigit
0 siblings, 1 reply; 62+ messages in thread
From: Thomas Monjalon @ 2016-06-13 10:21 UTC (permalink / raw)
To: Ferruh Yigit; +Cc: dev, Panu Matilainen, Christian Ehrhardt
2016-06-13 11:04, Ferruh Yigit:
> On 6/13/2016 10:29 AM, Thomas Monjalon wrote:
> > 2016-06-10 19:32, Ferruh Yigit:
> >> As stated in the comment:
> >> Order is important: from higher level to lower level
> >>
> >> This is an attempt to make the layering order better respected.
> >>
> >> Limit scope of --whole-archive to pmd libraries
> >
> > Compared to the link order in the v2, you did two things:
> > 1/ move PMDs to the first position
> > 2/ restrict --whole-archive to PMDs only
> >
> > Having the PMDs first, helps the linker to get all the PMD dependencies
> > in the static binary. Thus it seems we do not need --whole-archive
> > for the PMD dependencies (ethdev, mbuf, etc).
> > But, if an external PMD is loaded via dlopen, it is possible that it
> > needs a symbol which was not used by the internal PMDs. So it will not
> > be found in the statically linked binary.
> > Let's take another example: if we disable the internal PMDs with their
> > config options from the static build, and we decide to build them
> > separately as DSOs. We won't be able to load them as plugins because
> > they depend on symbols which won't be found in the static binary.
>
> So you want to keep all objects in final binary (used or unused) because
> of the possibility that any plugin may use them.
Yes
> But what is the list to include here, whole dpdk?, -since we may not
> know what API will plugin call.
The list of the libraries candidates to be called from a driver can be
discussed. The top layers like lpm or distributor should not be in this
list I think.
> What I am confused is --whole-archive only used when dpdk compiled as
> static, if dpdk compiled as shared, each PMD should have proper
> dependencies [1], and if external PMD compiled properly there shouldn't
> be a problem. So do we have a case that dpdk compiled statically into
> final binary but we still want to load some plugins dynamically?
Yes a plugin can be loaded from a static binary.
Breaking this feature would need a separate discussion and notices.
> > To make it short, the PMDs must be considered as plugins. Therefore, we
> > must not rely on their availability to link the required symbols in
> > a static binary.
> > To make sure the plugin loading will be always well achieved, we must
> > link the static PMDs at the last position.
>
> I think this is not the issue of linking PMD's first or last, but
> expanding --whole-archive to cover other libraries other than PMDs.
Yes, linking PMD at the end is a way to force us to keep some libraries
in --whole-archive.
> > If you agree, I vote for the v2 of this patchset.
>
> If this is breaking something and best way to fix is not in external PMD
> but in here, please feel free to go with v2.
I don't see any other solution.
But I'm sure we could discuss it more and/or improve it in the future.
^ permalink raw reply [flat|nested] 62+ messages in thread
* Re: [dpdk-dev] [PATCH v3 3/6] mk: sort libraries when linking, move pmd libs to higher level
2016-06-13 10:21 ` Thomas Monjalon
@ 2016-06-13 10:29 ` Ferruh Yigit
0 siblings, 0 replies; 62+ messages in thread
From: Ferruh Yigit @ 2016-06-13 10:29 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: dev, Panu Matilainen, Christian Ehrhardt
On 6/13/2016 11:21 AM, Thomas Monjalon wrote:
> 2016-06-13 11:04, Ferruh Yigit:
>> On 6/13/2016 10:29 AM, Thomas Monjalon wrote:
>>> 2016-06-10 19:32, Ferruh Yigit:
>>>> As stated in the comment:
>>>> Order is important: from higher level to lower level
>>>>
>>>> This is an attempt to make the layering order better respected.
>>>>
>>>> Limit scope of --whole-archive to pmd libraries
>>>
>>> Compared to the link order in the v2, you did two things:
>>> 1/ move PMDs to the first position
>>> 2/ restrict --whole-archive to PMDs only
>>>
>>> Having the PMDs first, helps the linker to get all the PMD dependencies
>>> in the static binary. Thus it seems we do not need --whole-archive
>>> for the PMD dependencies (ethdev, mbuf, etc).
>>> But, if an external PMD is loaded via dlopen, it is possible that it
>>> needs a symbol which was not used by the internal PMDs. So it will not
>>> be found in the statically linked binary.
>>> Let's take another example: if we disable the internal PMDs with their
>>> config options from the static build, and we decide to build them
>>> separately as DSOs. We won't be able to load them as plugins because
>>> they depend on symbols which won't be found in the static binary.
>>
>> So you want to keep all objects in final binary (used or unused) because
>> of the possibility that any plugin may use them.
>
> Yes
>
>> But what is the list to include here, whole dpdk?, -since we may not
>> know what API will plugin call.
>
> The list of the libraries candidates to be called from a driver can be
> discussed. The top layers like lpm or distributor should not be in this
> list I think.
>
>> What I am confused is --whole-archive only used when dpdk compiled as
>> static, if dpdk compiled as shared, each PMD should have proper
>> dependencies [1], and if external PMD compiled properly there shouldn't
>> be a problem. So do we have a case that dpdk compiled statically into
>> final binary but we still want to load some plugins dynamically?
>
> Yes a plugin can be loaded from a static binary.
> Breaking this feature would need a separate discussion and notices.
Thanks for clarifying, I wasn't aware of this.
So I am leaving this patch, please just ping if anything required from me.
>
>>> To make it short, the PMDs must be considered as plugins. Therefore, we
>>> must not rely on their availability to link the required symbols in
>>> a static binary.
>>> To make sure the plugin loading will be always well achieved, we must
>>> link the static PMDs at the last position.
>>
>> I think this is not the issue of linking PMD's first or last, but
>> expanding --whole-archive to cover other libraries other than PMDs.
>
> Yes, linking PMD at the end is a way to force us to keep some libraries
> in --whole-archive.
>
>>> If you agree, I vote for the v2 of this patchset.
>>
>> If this is breaking something and best way to fix is not in external PMD
>> but in here, please feel free to go with v2.
>
> I don't see any other solution.
> But I'm sure we could discuss it more and/or improve it in the future.
>
^ permalink raw reply [flat|nested] 62+ messages in thread
* [dpdk-dev] [PATCH v3 4/6] mk: sort libraries when linking, move external libs to lower level
2016-06-10 18:32 ` [dpdk-dev] [PATCH v3 0/6] reduce overlinking in applications Ferruh Yigit
` (2 preceding siblings ...)
2016-06-10 18:32 ` [dpdk-dev] [PATCH v3 3/6] mk: sort libraries when linking, move pmd libs to higher level Ferruh Yigit
@ 2016-06-10 18:32 ` Ferruh Yigit
2016-06-10 18:32 ` [dpdk-dev] [PATCH v3 5/6] mk: remove library grouping during application linking Ferruh Yigit
2016-06-10 18:32 ` [dpdk-dev] [PATCH v3 6/6] mk: prevent overlinking in applications Ferruh Yigit
5 siblings, 0 replies; 62+ messages in thread
From: Ferruh Yigit @ 2016-06-10 18:32 UTC (permalink / raw)
To: dev; +Cc: Thomas Monjalon, Panu Matilainen, Christian Ehrhardt, Ferruh Yigit
As stated in the comment:
Order is important: from higher level to lower level
This is an attempt to make the layering order better respected.
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
mk/rte.app.mk | 30 +++++++++++++++---------------
1 file changed, 15 insertions(+), 15 deletions(-)
diff --git a/mk/rte.app.mk b/mk/rte.app.mk
index b8761ae..a518527 100644
--- a/mk/rte.app.mk
+++ b/mk/rte.app.mk
@@ -125,21 +125,6 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_METER) += -lrte_meter
_LDLIBS-$(CONFIG_RTE_LIBRTE_SCHED) += -lrte_sched
_LDLIBS-$(CONFIG_RTE_LIBRTE_VHOST) += -lrte_vhost
-# The static libraries do not know their dependencies.
-# So linking with static library requires explicit dependencies.
-ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),n)
-_LDLIBS-$(CONFIG_RTE_LIBRTE_SCHED) += -lm
-_LDLIBS-$(CONFIG_RTE_LIBRTE_SCHED) += -lrt
-_LDLIBS-$(CONFIG_RTE_LIBRTE_METER) += -lm
-ifeq ($(CONFIG_RTE_LIBRTE_VHOST_NUMA),y)
-_LDLIBS-$(CONFIG_RTE_LIBRTE_VHOST) += -lnuma
-endif
-ifeq ($(CONFIG_RTE_LIBRTE_VHOST_USER),n)
-_LDLIBS-$(CONFIG_RTE_LIBRTE_VHOST) += -lfuse
-endif
-_LDLIBS-$(CONFIG_RTE_PORT_PCAP) += -lpcap
-endif # !CONFIG_RTE_BUILD_SHARED_LIBS
-
_LDLIBS-y += --start-group
_LDLIBS-$(CONFIG_RTE_LIBRTE_KVARGS) += -lrte_kvargs
@@ -156,6 +141,21 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_CFGFILE) += -lrte_cfgfile
_LDLIBS-y += $(EXECENV_LDLIBS)
_LDLIBS-y += --end-group
+# The static libraries do not know their dependencies.
+# So linking with static library requires explicit dependencies.
+ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),n)
+_LDLIBS-$(CONFIG_RTE_LIBRTE_SCHED) += -lm
+_LDLIBS-$(CONFIG_RTE_LIBRTE_SCHED) += -lrt
+_LDLIBS-$(CONFIG_RTE_LIBRTE_METER) += -lm
+ifeq ($(CONFIG_RTE_LIBRTE_VHOST_NUMA),y)
+_LDLIBS-$(CONFIG_RTE_LIBRTE_VHOST) += -lnuma
+endif
+ifeq ($(CONFIG_RTE_LIBRTE_VHOST_USER),n)
+_LDLIBS-$(CONFIG_RTE_LIBRTE_VHOST) += -lfuse
+endif
+_LDLIBS-$(CONFIG_RTE_PORT_PCAP) += -lpcap
+endif # !CONFIG_RTE_BUILD_SHARED_LIBS
+
LDLIBS += $(_LDLIBS-y) $(CPU_LDLIBS) $(EXTRA_LDLIBS)
# Eliminate duplicates without sorting
--
2.5.5
^ permalink raw reply [flat|nested] 62+ messages in thread
* [dpdk-dev] [PATCH v3 5/6] mk: remove library grouping during application linking
2016-06-10 18:32 ` [dpdk-dev] [PATCH v3 0/6] reduce overlinking in applications Ferruh Yigit
` (3 preceding siblings ...)
2016-06-10 18:32 ` [dpdk-dev] [PATCH v3 4/6] mk: sort libraries when linking, move external libs to lower level Ferruh Yigit
@ 2016-06-10 18:32 ` Ferruh Yigit
2016-06-10 18:32 ` [dpdk-dev] [PATCH v3 6/6] mk: prevent overlinking in applications Ferruh Yigit
5 siblings, 0 replies; 62+ messages in thread
From: Ferruh Yigit @ 2016-06-10 18:32 UTC (permalink / raw)
To: dev; +Cc: Thomas Monjalon, Panu Matilainen, Christian Ehrhardt, Ferruh Yigit
From: Thomas Monjalon <thomas.monjalon@6wind.com>
>From "man ld":
Using this option has a significant performance cost.
It is best to use it only when there are unavoidable
circular references between two or more archives.
Remove the option since it does not seem necessary.
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
mk/rte.app.mk | 3 ---
1 file changed, 3 deletions(-)
diff --git a/mk/rte.app.mk b/mk/rte.app.mk
index a518527..f60e5bf 100644
--- a/mk/rte.app.mk
+++ b/mk/rte.app.mk
@@ -125,8 +125,6 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_METER) += -lrte_meter
_LDLIBS-$(CONFIG_RTE_LIBRTE_SCHED) += -lrte_sched
_LDLIBS-$(CONFIG_RTE_LIBRTE_VHOST) += -lrte_vhost
-_LDLIBS-y += --start-group
-
_LDLIBS-$(CONFIG_RTE_LIBRTE_KVARGS) += -lrte_kvargs
_LDLIBS-$(CONFIG_RTE_LIBRTE_MBUF) += -lrte_mbuf
_LDLIBS-$(CONFIG_RTE_LIBRTE_IP_FRAG) += -lrte_ip_frag
@@ -139,7 +137,6 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_CMDLINE) += -lrte_cmdline
_LDLIBS-$(CONFIG_RTE_LIBRTE_CFGFILE) += -lrte_cfgfile
_LDLIBS-y += $(EXECENV_LDLIBS)
-_LDLIBS-y += --end-group
# The static libraries do not know their dependencies.
# So linking with static library requires explicit dependencies.
--
2.5.5
^ permalink raw reply [flat|nested] 62+ messages in thread
* [dpdk-dev] [PATCH v3 6/6] mk: prevent overlinking in applications
2016-06-10 18:32 ` [dpdk-dev] [PATCH v3 0/6] reduce overlinking in applications Ferruh Yigit
` (4 preceding siblings ...)
2016-06-10 18:32 ` [dpdk-dev] [PATCH v3 5/6] mk: remove library grouping during application linking Ferruh Yigit
@ 2016-06-10 18:32 ` Ferruh Yigit
2016-06-11 6:34 ` Thomas Monjalon
5 siblings, 1 reply; 62+ messages in thread
From: Ferruh Yigit @ 2016-06-10 18:32 UTC (permalink / raw)
To: dev; +Cc: Thomas Monjalon, Panu Matilainen, Christian Ehrhardt, Ferruh Yigit
Replace --no-as-needed linker flag with --as-needed flag, which will
only link libraries directly called by application.
It can be achieved now that the libraries dependencies are handled
properly.
Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
---
mk/exec-env/linuxapp/rte.vars.mk | 3 ---
mk/rte.app.mk | 8 ++++++++
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/mk/exec-env/linuxapp/rte.vars.mk b/mk/exec-env/linuxapp/rte.vars.mk
index d51bd17..a8a1ee4 100644
--- a/mk/exec-env/linuxapp/rte.vars.mk
+++ b/mk/exec-env/linuxapp/rte.vars.mk
@@ -45,9 +45,6 @@ else
EXECENV_CFLAGS = -pthread
endif
-# Workaround lack of DT_NEEDED entry
-EXECENV_LDFLAGS = --no-as-needed
-
EXECENV_LDLIBS =
EXECENV_ASFLAGS =
diff --git a/mk/rte.app.mk b/mk/rte.app.mk
index f60e5bf..aa794bc 100644
--- a/mk/rte.app.mk
+++ b/mk/rte.app.mk
@@ -50,6 +50,14 @@ ifeq ($(NO_LDSCRIPT),)
LDSCRIPT = $(RTE_LDSCRIPT)
endif
+ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y)
+# Workaround to eal <-> mempool cyclic dependency
+_LDLIBS-$(CONFIG_RTE_LIBRTE_MEMPOOL) += -lrte_mempool
+endif
+
+# Link only the libraries used in the application
+_LDLIBS-y += --as-needed
+
# default path for libs
_LDLIBS-y += -L$(RTE_SDK_BIN)/lib
--
2.5.5
^ permalink raw reply [flat|nested] 62+ messages in thread
* Re: [dpdk-dev] [PATCH v3 6/6] mk: prevent overlinking in applications
2016-06-10 18:32 ` [dpdk-dev] [PATCH v3 6/6] mk: prevent overlinking in applications Ferruh Yigit
@ 2016-06-11 6:34 ` Thomas Monjalon
2016-06-13 9:05 ` Ferruh Yigit
0 siblings, 1 reply; 62+ messages in thread
From: Thomas Monjalon @ 2016-06-11 6:34 UTC (permalink / raw)
To: Ferruh Yigit; +Cc: dev, Panu Matilainen, Christian Ehrhardt
Hi Ferruh,
2016-06-10 19:32, Ferruh Yigit:
> --- a/mk/rte.app.mk
> +++ b/mk/rte.app.mk
> @@ -50,6 +50,14 @@ ifeq ($(NO_LDSCRIPT),)
> LDSCRIPT = $(RTE_LDSCRIPT)
> endif
>
> +ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y)
> +# Workaround to eal <-> mempool cyclic dependency
> +_LDLIBS-$(CONFIG_RTE_LIBRTE_MEMPOOL) += -lrte_mempool
> +endif
> +
> +# Link only the libraries used in the application
> +_LDLIBS-y += --as-needed
I think we do not need this workaround.
The dependency of EAL logs on mempool is now removed.
We only have the dependency of EAL ivshmem on librte_ivshmem header
(which needs mempool and rings headers).
^ permalink raw reply [flat|nested] 62+ messages in thread
* Re: [dpdk-dev] [PATCH v3 6/6] mk: prevent overlinking in applications
2016-06-11 6:34 ` Thomas Monjalon
@ 2016-06-13 9:05 ` Ferruh Yigit
2016-06-13 9:24 ` Christian Ehrhardt
0 siblings, 1 reply; 62+ messages in thread
From: Ferruh Yigit @ 2016-06-13 9:05 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: dev, Panu Matilainen, Christian Ehrhardt
On 6/11/2016 7:34 AM, Thomas Monjalon wrote:
> Hi Ferruh,
>
> 2016-06-10 19:32, Ferruh Yigit:
>> --- a/mk/rte.app.mk
>> +++ b/mk/rte.app.mk
>> @@ -50,6 +50,14 @@ ifeq ($(NO_LDSCRIPT),)
>> LDSCRIPT = $(RTE_LDSCRIPT)
>> endif
>>
>> +ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y)
>> +# Workaround to eal <-> mempool cyclic dependency
>> +_LDLIBS-$(CONFIG_RTE_LIBRTE_MEMPOOL) += -lrte_mempool
>> +endif
>> +
>> +# Link only the libraries used in the application
>> +_LDLIBS-y += --as-needed
>
> I think we do not need this workaround.
> The dependency of EAL logs on mempool is now removed.
> We only have the dependency of EAL ivshmem on librte_ivshmem header
> (which needs mempool and rings headers).
>
I missed that dependency removed, this is good, I will send a new
version of the patch.
Thanks,
ferruh
^ permalink raw reply [flat|nested] 62+ messages in thread
* Re: [dpdk-dev] [PATCH v3 6/6] mk: prevent overlinking in applications
2016-06-13 9:05 ` Ferruh Yigit
@ 2016-06-13 9:24 ` Christian Ehrhardt
2016-06-13 9:48 ` [dpdk-dev] [PATCH] mk: fix missing DEPDIRS to avoid libarary underlinking Christian Ehrhardt
0 siblings, 1 reply; 62+ messages in thread
From: Christian Ehrhardt @ 2016-06-13 9:24 UTC (permalink / raw)
To: Ferruh Yigit; +Cc: Thomas Monjalon, dev, Panu Matilainen
Hi,
great work on cleaning that up already.
I applied v3 of the series and see already much better results.
But I found some more that should be part of this.
I don't know how generally available a similar solution is, but usually in
our build dpkg-shlibdeps checks for under/overlinking issues.
I let that run on a dir built from git plus v3 of the series in discussion
here.
There are two way of open dependency issues left:
1. some libraries use symbols of other libraries they are not linked with
correctly yet
2. the appliactions are still overlinking
We need to finalize #1 first before being able to tackle #2 without
breaking something.
I'll send a patch for the following so it can be part of your v4
$ for binfile in $(find debian/build/shared-root/lib -executable -type f;
find debian/build/shared-root/app -executable -type f;); do printf
"\n\n\nTesting %s\n" $binfile; dpkg-shlibdeps -e $binfile
-ldebian/build/shared-root/lib/ | grep -v "installed in their package's
directory"; done
Testing debian/build/shared-root/lib/librte_port.so.3
dpkg-shlibdeps: warning: binaries to analyze should already be installed in
their package's directory
dpkg-shlibdeps: warning: symbol rte_sched_port_dequeue used by
debian/build/shared-root/lib/librte_port.so.3 found in none of the libraries
dpkg-shlibdeps: warning: symbol rte_sched_port_enqueue used by
debian/build/shared-root/lib/librte_port.so.3 found in none of the libraries
dpkg-shlibdeps: warning: binaries to analyze should already be installed in
their package's directory
Testing debian/build/shared-root/lib/librte_pmd_bond.so.1
dpkg-shlibdeps: warning: binaries to analyze should already be installed in
their package's directory
dpkg-shlibdeps: warning: binaries to analyze should already be installed in
their package's directory
dpkg-shlibdeps: warning: symbol rte_mempool_create used by
debian/build/shared-root/lib/librte_pmd_bond.so.1 found in none of the
libraries
dpkg-shlibdeps: warning: symbol rte_ring_create used by
debian/build/shared-root/lib/librte_pmd_bond.so.1 found in none of the
libraries
Testing debian/build/shared-root/lib/librte_pipeline.so.3
dpkg-shlibdeps: warning: binaries to analyze should already be installed in
their package's directory
dpkg-shlibdeps: warning: binaries to analyze should already be installed in
their package's directory
dpkg-shlibdeps: warning: symbol per_lcore__lcore_id used by
debian/build/shared-root/lib/librte_pipeline.so.3 found in none of the
libraries
dpkg-shlibdeps: warning: symbol rte_eal_has_hugepages used by
debian/build/shared-root/lib/librte_pipeline.so.3 found in none of the
libraries
dpkg-shlibdeps: warning: symbol rte_mem_virt2phy used by
debian/build/shared-root/lib/librte_pipeline.so.3 found in none of the
libraries
dpkg-shlibdeps: warning: symbol rte_free used by
debian/build/shared-root/lib/librte_pipeline.so.3 found in none of the
libraries
dpkg-shlibdeps: warning: symbol rte_log used by
debian/build/shared-root/lib/librte_pipeline.so.3 found in none of the
libraries
dpkg-shlibdeps: warning: symbol rte_zmalloc_socket used by
debian/build/shared-root/lib/librte_pipeline.so.3 found in none of the
libraries
Testing debian/build/shared-root/lib/librte_pmd_null_crypto.so.1
dpkg-shlibdeps: warning: binaries to analyze should already be installed in
their package's directory
dpkg-shlibdeps: warning: symbol rte_ring_create used by
debian/build/shared-root/lib/librte_pmd_null_crypto.so.1 found in none of
the libraries
dpkg-shlibdeps: warning: symbol rte_kvargs_parse used by
debian/build/shared-root/lib/librte_pmd_null_crypto.so.1 found in none of
the libraries
dpkg-shlibdeps: warning: symbol rte_kvargs_free used by
debian/build/shared-root/lib/librte_pmd_null_crypto.so.1 found in none of
the libraries
dpkg-shlibdeps: warning: symbol rte_kvargs_process used by
debian/build/shared-root/lib/librte_pmd_null_crypto.so.1 found in none of
the libraries
dpkg-shlibdeps: warning: symbol rte_ring_lookup used by
debian/build/shared-root/lib/librte_pmd_null_crypto.so.1 found in none of
the libraries
dpkg-shlibdeps: warning: binaries to analyze should already be installed in
their package's directory
Testing debian/build/shared-root/lib/librte_pmd_vhost.so.1
dpkg-shlibdeps: warning: binaries to analyze should already be installed in
their package's directory
dpkg-shlibdeps: warning: symbol rte_eal_driver_register used by
debian/build/shared-root/lib/librte_pmd_vhost.so.1 found in none of the
libraries
dpkg-shlibdeps: warning: symbol rte_log used by
debian/build/shared-root/lib/librte_pmd_vhost.so.1 found in none of the
libraries
dpkg-shlibdeps: warning: symbol pthread_join used by
debian/build/shared-root/lib/librte_pmd_vhost.so.1 found in none of the
libraries
dpkg-shlibdeps: warning: symbol pthread_cancel used by
debian/build/shared-root/lib/librte_pmd_vhost.so.1 found in none of the
libraries
dpkg-shlibdeps: warning: symbol rte_eal_has_hugepages used by
debian/build/shared-root/lib/librte_pmd_vhost.so.1 found in none of the
libraries
dpkg-shlibdeps: warning: symbol rte_mem_virt2phy used by
debian/build/shared-root/lib/librte_pmd_vhost.so.1 found in none of the
libraries
dpkg-shlibdeps: warning: symbol rte_zmalloc_socket used by
debian/build/shared-root/lib/librte_pmd_vhost.so.1 found in none of the
libraries
dpkg-shlibdeps: warning: symbol pthread_create used by
debian/build/shared-root/lib/librte_pmd_vhost.so.1 found in none of the
libraries
dpkg-shlibdeps: warning: symbol per_lcore__lcore_id used by
debian/build/shared-root/lib/librte_pmd_vhost.so.1 found in none of the
libraries
dpkg-shlibdeps: warning: symbol rte_socket_id used by
debian/build/shared-root/lib/librte_pmd_vhost.so.1 found in none of the
libraries
dpkg-shlibdeps: warning: 2 other similar warnings have been skipped (use -v
to see them all)
dpkg-shlibdeps: warning: binaries to analyze should already be installed in
their package's directory
Testing debian/build/shared-root/lib/librte_pmd_fm10k.so.1
dpkg-shlibdeps: warning: binaries to analyze should already be installed in
their package's directory
dpkg-shlibdeps: warning: symbol rte_kvargs_count used by
debian/build/shared-root/lib/librte_pmd_fm10k.so.1 found in none of the
libraries
dpkg-shlibdeps: warning: symbol rte_kvargs_free used by
debian/build/shared-root/lib/librte_pmd_fm10k.so.1 found in none of the
libraries
dpkg-shlibdeps: warning: symbol rte_kvargs_parse used by
debian/build/shared-root/lib/librte_pmd_fm10k.so.1 found in none of the
libraries
dpkg-shlibdeps: warning: symbol rte_kvargs_process used by
debian/build/shared-root/lib/librte_pmd_fm10k.so.1 found in none of the
libraries
dpkg-shlibdeps: warning: binaries to analyze should already be installed in
their package's directory
Testing debian/build/shared-root/lib/librte_pmd_pcap.so.1
dpkg-shlibdeps: warning: binaries to analyze should already be installed in
their package's directory
dpkg-shlibdeps: warning: symbol rte_eal_driver_register used by
debian/build/shared-root/lib/librte_pmd_pcap.so.1 found in none of the
libraries
dpkg-shlibdeps: warning: symbol rte_cycles_vmware_tsc_map used by
debian/build/shared-root/lib/librte_pmd_pcap.so.1 found in none of the
libraries
dpkg-shlibdeps: warning: symbol rte_zmalloc_socket used by
debian/build/shared-root/lib/librte_pmd_pcap.so.1 found in none of the
libraries
dpkg-shlibdeps: warning: symbol rte_get_tsc_hz used by
debian/build/shared-root/lib/librte_pmd_pcap.so.1 found in none of the
libraries
dpkg-shlibdeps: warning: symbol rte_free used by
debian/build/shared-root/lib/librte_pmd_pcap.so.1 found in none of the
libraries
dpkg-shlibdeps: warning: symbol rte_eal_has_hugepages used by
debian/build/shared-root/lib/librte_pmd_pcap.so.1 found in none of the
libraries
dpkg-shlibdeps: warning: symbol rte_socket_id used by
debian/build/shared-root/lib/librte_pmd_pcap.so.1 found in none of the
libraries
dpkg-shlibdeps: warning: symbol eal_timer_source used by
debian/build/shared-root/lib/librte_pmd_pcap.so.1 found in none of the
libraries
dpkg-shlibdeps: warning: symbol rte_mem_virt2phy used by
debian/build/shared-root/lib/librte_pmd_pcap.so.1 found in none of the
libraries
dpkg-shlibdeps: warning: symbol rte_log used by
debian/build/shared-root/lib/librte_pmd_pcap.so.1 found in none of the
libraries
dpkg-shlibdeps: warning: 2 other similar warnings have been skipped (use -v
to see them all)
dpkg-shlibdeps: warning: binaries to analyze should already be installed in
their package's directory
Testing debian/build/shared-root/lib/librte_sched.so.1
dpkg-shlibdeps: warning: binaries to analyze should already be installed in
their package's directory
dpkg-shlibdeps: warning: symbol rte_zmalloc used by
debian/build/shared-root/lib/librte_sched.so.1 found in none of the
libraries
dpkg-shlibdeps: warning: symbol __rte_panic used by
debian/build/shared-root/lib/librte_sched.so.1 found in none of the
libraries
dpkg-shlibdeps: warning: symbol per_lcore__lcore_id used by
debian/build/shared-root/lib/librte_sched.so.1 found in none of the
libraries
dpkg-shlibdeps: warning: symbol rte_free used by
debian/build/shared-root/lib/librte_sched.so.1 found in none of the
libraries
dpkg-shlibdeps: warning: symbol rte_eal_has_hugepages used by
debian/build/shared-root/lib/librte_sched.so.1 found in none of the
libraries
dpkg-shlibdeps: warning: symbol rte_get_tsc_hz used by
debian/build/shared-root/lib/librte_sched.so.1 found in none of the
libraries
dpkg-shlibdeps: warning: symbol rte_mem_virt2phy used by
debian/build/shared-root/lib/librte_sched.so.1 found in none of the
libraries
dpkg-shlibdeps: warning: symbol rte_log used by
debian/build/shared-root/lib/librte_sched.so.1 found in none of the
libraries
dpkg-shlibdeps: warning: symbol rte_cycles_vmware_tsc_map used by
debian/build/shared-root/lib/librte_sched.so.1 found in none of the
libraries
dpkg-shlibdeps: warning: binaries to analyze should already be installed in
their package's directory
Testing debian/build/shared-root/lib/librte_pmd_af_packet.so.1
dpkg-shlibdeps: warning: binaries to analyze should already be installed in
their package's directory
dpkg-shlibdeps: warning: binaries to analyze should already be installed in
their package's directory
dpkg-shlibdeps: warning: symbol rte_eal_has_hugepages used by
debian/build/shared-root/lib/librte_pmd_af_packet.so.1 found in none of the
libraries
dpkg-shlibdeps: warning: symbol rte_zmalloc_socket used by
debian/build/shared-root/lib/librte_pmd_af_packet.so.1 found in none of the
libraries
dpkg-shlibdeps: warning: symbol rte_free used by
debian/build/shared-root/lib/librte_pmd_af_packet.so.1 found in none of the
libraries
dpkg-shlibdeps: warning: symbol rte_socket_id used by
debian/build/shared-root/lib/librte_pmd_af_packet.so.1 found in none of the
libraries
dpkg-shlibdeps: warning: symbol rte_mem_virt2phy used by
debian/build/shared-root/lib/librte_pmd_af_packet.so.1 found in none of the
libraries
dpkg-shlibdeps: warning: symbol rte_eal_driver_register used by
debian/build/shared-root/lib/librte_pmd_af_packet.so.1 found in none of the
libraries
dpkg-shlibdeps: warning: symbol per_lcore__lcore_id used by
debian/build/shared-root/lib/librte_pmd_af_packet.so.1 found in none of the
libraries
dpkg-shlibdeps: warning: symbol rte_log used by
debian/build/shared-root/lib/librte_pmd_af_packet.so.1 found in none of the
libraries
Testing debian/build/shared-root/lib/librte_port.so.2
dpkg-shlibdeps: warning: binaries to analyze should already be installed in
their package's directory
dpkg-shlibdeps: warning: symbol rte_sched_port_enqueue used by
debian/build/shared-root/lib/librte_port.so.2 found in none of the libraries
dpkg-shlibdeps: warning: symbol rte_sched_port_dequeue used by
debian/build/shared-root/lib/librte_port.so.2 found in none of the libraries
dpkg-shlibdeps: warning: binaries to analyze should already be installed in
their package's directory
Testing debian/build/shared-root/lib/librte_pmd_null.so.1
dpkg-shlibdeps: warning: binaries to analyze should already be installed in
their package's directory
dpkg-shlibdeps: warning: symbol rte_zmalloc_socket used by
debian/build/shared-root/lib/librte_pmd_null.so.1 found in none of the
libraries
dpkg-shlibdeps: warning: symbol rte_mem_virt2phy used by
debian/build/shared-root/lib/librte_pmd_null.so.1 found in none of the
libraries
dpkg-shlibdeps: warning: symbol rte_socket_id used by
debian/build/shared-root/lib/librte_pmd_null.so.1 found in none of the
libraries
dpkg-shlibdeps: warning: symbol rte_cpu_get_flag_enabled used by
debian/build/shared-root/lib/librte_pmd_null.so.1 found in none of the
libraries
dpkg-shlibdeps: warning: symbol rte_log used by
debian/build/shared-root/lib/librte_pmd_null.so.1 found in none of the
libraries
dpkg-shlibdeps: warning: symbol rte_eal_has_hugepages used by
debian/build/shared-root/lib/librte_pmd_null.so.1 found in none of the
libraries
dpkg-shlibdeps: warning: symbol rte_free used by
debian/build/shared-root/lib/librte_pmd_null.so.1 found in none of the
libraries
dpkg-shlibdeps: warning: symbol per_lcore__lcore_id used by
debian/build/shared-root/lib/librte_pmd_null.so.1 found in none of the
libraries
dpkg-shlibdeps: warning: symbol rte_eal_driver_register used by
debian/build/shared-root/lib/librte_pmd_null.so.1 found in none of the
libraries
dpkg-shlibdeps: warning: binaries to analyze should already be installed in
their package's directory
Testing debian/build/shared-root/lib/librte_ip_frag.so.1
dpkg-shlibdeps: warning: binaries to analyze should already be installed in
their package's directory
dpkg-shlibdeps: warning: symbol rte_eal_has_hugepages used by
debian/build/shared-root/lib/librte_ip_frag.so.1 found in none of the
libraries
dpkg-shlibdeps: warning: symbol rte_log used by
debian/build/shared-root/lib/librte_ip_frag.so.1 found in none of the
libraries
dpkg-shlibdeps: warning: symbol per_lcore__lcore_id used by
debian/build/shared-root/lib/librte_ip_frag.so.1 found in none of the
libraries
dpkg-shlibdeps: warning: symbol rte_zmalloc_socket used by
debian/build/shared-root/lib/librte_ip_frag.so.1 found in none of the
libraries
dpkg-shlibdeps: warning: symbol rte_cpu_get_flag_enabled used by
debian/build/shared-root/lib/librte_ip_frag.so.1 found in none of the
libraries
dpkg-shlibdeps: warning: symbol rte_mem_virt2phy used by
debian/build/shared-root/lib/librte_ip_frag.so.1 found in none of the
libraries
dpkg-shlibdeps: warning: binaries to analyze should already be installed in
their package's directory
Christian Ehrhardt
Software Engineer, Ubuntu Server
Canonical Ltd
On Mon, Jun 13, 2016 at 11:05 AM, Ferruh Yigit <ferruh.yigit@intel.com>
wrote:
> On 6/11/2016 7:34 AM, Thomas Monjalon wrote:
> > Hi Ferruh,
> >
> > 2016-06-10 19:32, Ferruh Yigit:
> >> --- a/mk/rte.app.mk
> >> +++ b/mk/rte.app.mk
> >> @@ -50,6 +50,14 @@ ifeq ($(NO_LDSCRIPT),)
> >> LDSCRIPT = $(RTE_LDSCRIPT)
> >> endif
> >>
> >> +ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y)
> >> +# Workaround to eal <-> mempool cyclic dependency
> >> +_LDLIBS-$(CONFIG_RTE_LIBRTE_MEMPOOL) += -lrte_mempool
> >> +endif
> >> +
> >> +# Link only the libraries used in the application
> >> +_LDLIBS-y += --as-needed
> >
> > I think we do not need this workaround.
> > The dependency of EAL logs on mempool is now removed.
> > We only have the dependency of EAL ivshmem on librte_ivshmem header
> > (which needs mempool and rings headers).
> >
>
> I missed that dependency removed, this is good, I will send a new
> version of the patch.
>
> Thanks,
> ferruh
>
^ permalink raw reply [flat|nested] 62+ messages in thread
* [dpdk-dev] [PATCH] mk: fix missing DEPDIRS to avoid libarary underlinking
2016-06-13 9:24 ` Christian Ehrhardt
@ 2016-06-13 9:48 ` Christian Ehrhardt
2016-06-13 10:08 ` Thomas Monjalon
0 siblings, 1 reply; 62+ messages in thread
From: Christian Ehrhardt @ 2016-06-13 9:48 UTC (permalink / raw)
To: christian.ehrhardt, ferruh.yigit, thomas.monjalon, dev
After several cleanups libraries are now linked against the libs the
refer as DEPDIR which is great. But that now made it visible that some DEPDIRS
where still missing.
This patch is adding the missing depdirs to avoid any library referring to
symbols they are not linked against (found with dpkg-shlibs).
Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
---
drivers/crypto/null/Makefile | 2 ++
drivers/net/af_packet/Makefile | 1 +
drivers/net/bonding/Makefile | 2 ++
drivers/net/fm10k/Makefile | 1 +
drivers/net/null/Makefile | 1 +
drivers/net/pcap/Makefile | 1 +
drivers/net/vhost/Makefile | 3 +++
lib/librte_ip_frag/Makefile | 1 +
lib/librte_pipeline/Makefile | 1 +
lib/librte_port/Makefile | 1 +
lib/librte_sched/Makefile | 1 +
11 files changed, 15 insertions(+)
diff --git a/drivers/crypto/null/Makefile b/drivers/crypto/null/Makefile
index 2173277..573894f 100644
--- a/drivers/crypto/null/Makefile
+++ b/drivers/crypto/null/Makefile
@@ -55,5 +55,7 @@ SYMLINK-y-include +=
DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_NULL_CRYPTO) += lib/librte_eal
DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_NULL_CRYPTO) += lib/librte_mbuf
DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_NULL_CRYPTO) += lib/librte_cryptodev
+DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_NULL_CRYPTO) += lib/librte_ring
+DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_NULL_CRYPTO) += lib/librte_kvargs
include $(RTE_SDK)/mk/rte.lib.mk
diff --git a/drivers/net/af_packet/Makefile b/drivers/net/af_packet/Makefile
index cb1a7ae..132f1d9 100644
--- a/drivers/net/af_packet/Makefile
+++ b/drivers/net/af_packet/Makefile
@@ -54,5 +54,6 @@ SRCS-$(CONFIG_RTE_LIBRTE_PMD_AF_PACKET) += rte_eth_af_packet.c
DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_AF_PACKET) += lib/librte_mbuf
DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_AF_PACKET) += lib/librte_ether
DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_AF_PACKET) += lib/librte_kvargs
+DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_AF_PACKET) += lib/librte_eal
include $(RTE_SDK)/mk/rte.lib.mk
diff --git a/drivers/net/bonding/Makefile b/drivers/net/bonding/Makefile
index 10c794c..504f2e8 100644
--- a/drivers/net/bonding/Makefile
+++ b/drivers/net/bonding/Makefile
@@ -64,5 +64,7 @@ DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += lib/librte_ether
DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += lib/librte_eal
DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += lib/librte_kvargs
DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += lib/librte_cmdline
+DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += lib/librte_mempool
+DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += lib/librte_ring
include $(RTE_SDK)/mk/rte.lib.mk
diff --git a/drivers/net/fm10k/Makefile b/drivers/net/fm10k/Makefile
index cf141ae..afcbd1d 100644
--- a/drivers/net/fm10k/Makefile
+++ b/drivers/net/fm10k/Makefile
@@ -100,5 +100,6 @@ SRCS-$(CONFIG_RTE_LIBRTE_FM10K_INC_VECTOR) += fm10k_rxtx_vec.c
DEPDIRS-$(CONFIG_RTE_LIBRTE_FM10K_PMD) += lib/librte_eal lib/librte_ether
DEPDIRS-$(CONFIG_RTE_LIBRTE_FM10K_PMD) += lib/librte_mempool lib/librte_mbuf
DEPDIRS-$(CONFIG_RTE_LIBRTE_FM10K_PMD) += lib/librte_net
+DEPDIRS-$(CONFIG_RTE_LIBRTE_FM10K_PMD) += lib/librte_kvargs
include $(RTE_SDK)/mk/rte.lib.mk
diff --git a/drivers/net/null/Makefile b/drivers/net/null/Makefile
index 2202389..3502095 100644
--- a/drivers/net/null/Makefile
+++ b/drivers/net/null/Makefile
@@ -57,5 +57,6 @@ SYMLINK-y-include += rte_eth_null.h
DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_NULL) += lib/librte_mbuf
DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_NULL) += lib/librte_ether
DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_NULL) += lib/librte_kvargs
+DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_NULL) += lib/librte_eal
include $(RTE_SDK)/mk/rte.lib.mk
diff --git a/drivers/net/pcap/Makefile b/drivers/net/pcap/Makefile
index b41d8a2..85179ad 100644
--- a/drivers/net/pcap/Makefile
+++ b/drivers/net/pcap/Makefile
@@ -59,5 +59,6 @@ SYMLINK-y-include +=
DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_PCAP) += lib/librte_mbuf
DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_PCAP) += lib/librte_ether
DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_PCAP) += lib/librte_kvargs
+DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_PCAP) += lib/librte_eal
include $(RTE_SDK)/mk/rte.lib.mk
diff --git a/drivers/net/vhost/Makefile b/drivers/net/vhost/Makefile
index f49a69b..dd318a8 100644
--- a/drivers/net/vhost/Makefile
+++ b/drivers/net/vhost/Makefile
@@ -36,6 +36,8 @@ include $(RTE_SDK)/mk/rte.vars.mk
#
LIB = librte_pmd_vhost.a
+LDLIBS += -lpthread
+
CFLAGS += -O3
CFLAGS += $(WERROR_FLAGS)
@@ -58,5 +60,6 @@ DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_VHOST) += lib/librte_mbuf
DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_VHOST) += lib/librte_ether
DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_VHOST) += lib/librte_kvargs
DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_VHOST) += lib/librte_vhost
+DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_VHOST) += lib/librte_eal
include $(RTE_SDK)/mk/rte.lib.mk
diff --git a/lib/librte_ip_frag/Makefile b/lib/librte_ip_frag/Makefile
index 9d06780..2b91f73 100644
--- a/lib/librte_ip_frag/Makefile
+++ b/lib/librte_ip_frag/Makefile
@@ -55,5 +55,6 @@ SYMLINK-$(CONFIG_RTE_LIBRTE_IP_FRAG)-include += rte_ip_frag.h
# this library depends on rte_ether
DEPDIRS-$(CONFIG_RTE_LIBRTE_IP_FRAG) += lib/librte_mempool lib/librte_ether
+DEPDIRS-$(CONFIG_RTE_LIBRTE_IP_FRAG) += lib/librte_eal
include $(RTE_SDK)/mk/rte.lib.mk
diff --git a/lib/librte_pipeline/Makefile b/lib/librte_pipeline/Makefile
index 822fd41..a3b00f4 100644
--- a/lib/librte_pipeline/Makefile
+++ b/lib/librte_pipeline/Makefile
@@ -54,5 +54,6 @@ SYMLINK-$(CONFIG_RTE_LIBRTE_PIPELINE)-include += rte_pipeline.h
# this lib depends upon:
DEPDIRS-$(CONFIG_RTE_LIBRTE_PIPELINE) := lib/librte_table
DEPDIRS-$(CONFIG_RTE_LIBRTE_PIPELINE) += lib/librte_port
+DEPDIRS-$(CONFIG_RTE_LIBRTE_PIPELINE) += lib/librte_eal
include $(RTE_SDK)/mk/rte.lib.mk
diff --git a/lib/librte_port/Makefile b/lib/librte_port/Makefile
index d4de5af..dc6a601 100644
--- a/lib/librte_port/Makefile
+++ b/lib/librte_port/Makefile
@@ -75,5 +75,6 @@ DEPDIRS-$(CONFIG_RTE_LIBRTE_PORT) += lib/librte_mbuf
DEPDIRS-$(CONFIG_RTE_LIBRTE_PORT) += lib/librte_mempool
DEPDIRS-$(CONFIG_RTE_LIBRTE_PORT) += lib/librte_ether
DEPDIRS-$(CONFIG_RTE_LIBRTE_PORT) += lib/librte_ip_frag
+DEPDIRS-$(CONFIG_RTE_LIBRTE_PORT) += lib/librte_sched
include $(RTE_SDK)/mk/rte.lib.mk
diff --git a/lib/librte_sched/Makefile b/lib/librte_sched/Makefile
index a782cd1..0766fb9 100644
--- a/lib/librte_sched/Makefile
+++ b/lib/librte_sched/Makefile
@@ -61,5 +61,6 @@ SYMLINK-$(CONFIG_RTE_LIBRTE_SCHED)-include += rte_reciprocal.h
# this lib depends upon:
DEPDIRS-$(CONFIG_RTE_LIBRTE_SCHED) += lib/librte_mempool lib/librte_mbuf
DEPDIRS-$(CONFIG_RTE_LIBRTE_SCHED) += lib/librte_net lib/librte_timer
+DEPDIRS-$(CONFIG_RTE_LIBRTE_SCHED) += lib/librte_eal
include $(RTE_SDK)/mk/rte.lib.mk
--
2.7.4
^ permalink raw reply [flat|nested] 62+ messages in thread
* Re: [dpdk-dev] [PATCH] mk: fix missing DEPDIRS to avoid libarary underlinking
2016-06-13 9:48 ` [dpdk-dev] [PATCH] mk: fix missing DEPDIRS to avoid libarary underlinking Christian Ehrhardt
@ 2016-06-13 10:08 ` Thomas Monjalon
2016-06-13 10:20 ` Christian Ehrhardt
0 siblings, 1 reply; 62+ messages in thread
From: Thomas Monjalon @ 2016-06-13 10:08 UTC (permalink / raw)
To: Christian Ehrhardt; +Cc: ferruh.yigit, dev
2016-06-13 11:48, Christian Ehrhardt:
> --- a/drivers/net/af_packet/Makefile
> +++ b/drivers/net/af_packet/Makefile
> @@ -54,5 +54,6 @@ SRCS-$(CONFIG_RTE_LIBRTE_PMD_AF_PACKET) += rte_eth_af_packet.c
> DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_AF_PACKET) += lib/librte_mbuf
> DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_AF_PACKET) += lib/librte_ether
> DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_AF_PACKET) += lib/librte_kvargs
> +DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_AF_PACKET) += lib/librte_eal
It looks more logical to have eal as first DEPDIR in these lists.
> --- a/drivers/net/vhost/Makefile
> +++ b/drivers/net/vhost/Makefile
> @@ -36,6 +36,8 @@ include $(RTE_SDK)/mk/rte.vars.mk
> #
> LIB = librte_pmd_vhost.a
>
> +LDLIBS += -lpthread
> +
It is not a DEPDIR but an external dependency.
It deserves a separate patch.
Do we need it in rte.app.mk? It is an EAL dependency as well.
^ permalink raw reply [flat|nested] 62+ messages in thread
* Re: [dpdk-dev] [PATCH] mk: fix missing DEPDIRS to avoid libarary underlinking
2016-06-13 10:08 ` Thomas Monjalon
@ 2016-06-13 10:20 ` Christian Ehrhardt
2016-06-13 11:06 ` [dpdk-dev] [PATCH v2 0/2] mk: fix more library underlinking Christian Ehrhardt
0 siblings, 1 reply; 62+ messages in thread
From: Christian Ehrhardt @ 2016-06-13 10:20 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: Ferruh Yigit, dev
On Mon, Jun 13, 2016 at 12:08 PM, Thomas Monjalon <thomas.monjalon@6wind.com
> wrote:
> 2016-06-13 11:48, Christian Ehrhardt:
> > --- a/drivers/net/af_packet/Makefile
> > +++ b/drivers/net/af_packet/Makefile
> > @@ -54,5 +54,6 @@ SRCS-$(CONFIG_RTE_LIBRTE_PMD_AF_PACKET) +=
> rte_eth_af_packet.c
> > DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_AF_PACKET) += lib/librte_mbuf
> > DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_AF_PACKET) += lib/librte_ether
> > DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_AF_PACKET) += lib/librte_kvargs
> > +DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_AF_PACKET) += lib/librte_eal
>
> It looks more logical to have eal as first DEPDIR in these lists.
Yeah, thought about alphanumeric order, but eal first should be most
appropriate.
> > --- a/drivers/net/vhost/Makefile
> > +++ b/drivers/net/vhost/Makefile
> > @@ -36,6 +36,8 @@ include $(RTE_SDK)/mk/rte.vars.mk
> > #
> > LIB = librte_pmd_vhost.a
> >
> > +LDLIBS += -lpthread
> > +
>
> It is not a DEPDIR but an external dependency.
It deserves a separate patch.
>
Yes, sorry for just wrapping it in.
Will send a v2 with both changes later.
> Do we need it in rte.app.mk? It is an EAL dependency as well.
>
Not IMHO:
EAL depends on it so librte_eal.so depends on it as it should (just
reverified by ldd).
I don't see a reason that any app created should depend on pthread other
than if it actually uses libpthread.
^ permalink raw reply [flat|nested] 62+ messages in thread
* [dpdk-dev] [PATCH v2 0/2] mk: fix more library underlinking
2016-06-13 10:20 ` Christian Ehrhardt
@ 2016-06-13 11:06 ` Christian Ehrhardt
2016-06-13 11:06 ` [dpdk-dev] [PATCH v2 1/2] mk: fix missing vhost dependency to pthread to avoid libarary underlinking Christian Ehrhardt
` (2 more replies)
0 siblings, 3 replies; 62+ messages in thread
From: Christian Ehrhardt @ 2016-06-13 11:06 UTC (permalink / raw)
To: christian.ehrhardt, ferruh.yigit, thomas.monjalon, dev
After several cleanups libraries are now linked against the libs they
refer as DEPDIR which is great.
But that now also made it visible that some references where still missing.
The following two patches try to fix that:
[PATCH v2 1/2] mk: fix missing vhost dependency to pthread to avoid
[PATCH v2 2/2] mk: fix missing DEPDIRS to avoid libarary underlinking
^ permalink raw reply [flat|nested] 62+ messages in thread
* [dpdk-dev] [PATCH v2 1/2] mk: fix missing vhost dependency to pthread to avoid libarary underlinking
2016-06-13 11:06 ` [dpdk-dev] [PATCH v2 0/2] mk: fix more library underlinking Christian Ehrhardt
@ 2016-06-13 11:06 ` Christian Ehrhardt
2016-06-13 11:06 ` [dpdk-dev] [PATCH v2 2/2] mk: fix missing DEPDIRS " Christian Ehrhardt
2016-06-13 14:16 ` [dpdk-dev] [PATCH v2 0/2] mk: fix more library underlinking Thomas Monjalon
2 siblings, 0 replies; 62+ messages in thread
From: Christian Ehrhardt @ 2016-06-13 11:06 UTC (permalink / raw)
To: christian.ehrhardt, ferruh.yigit, thomas.monjalon, dev
Add the missing external dependency to pthread to avoid referring to
symbols the library is not linked against.
Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
---
drivers/net/vhost/Makefile | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/vhost/Makefile b/drivers/net/vhost/Makefile
index f49a69b..545d998 100644
--- a/drivers/net/vhost/Makefile
+++ b/drivers/net/vhost/Makefile
@@ -36,6 +36,8 @@ include $(RTE_SDK)/mk/rte.vars.mk
#
LIB = librte_pmd_vhost.a
+LDLIBS += -lpthread
+
CFLAGS += -O3
CFLAGS += $(WERROR_FLAGS)
--
2.7.4
^ permalink raw reply [flat|nested] 62+ messages in thread
* [dpdk-dev] [PATCH v2 2/2] mk: fix missing DEPDIRS to avoid libarary underlinking
2016-06-13 11:06 ` [dpdk-dev] [PATCH v2 0/2] mk: fix more library underlinking Christian Ehrhardt
2016-06-13 11:06 ` [dpdk-dev] [PATCH v2 1/2] mk: fix missing vhost dependency to pthread to avoid libarary underlinking Christian Ehrhardt
@ 2016-06-13 11:06 ` Christian Ehrhardt
2016-06-13 14:16 ` [dpdk-dev] [PATCH v2 0/2] mk: fix more library underlinking Thomas Monjalon
2 siblings, 0 replies; 62+ messages in thread
From: Christian Ehrhardt @ 2016-06-13 11:06 UTC (permalink / raw)
To: christian.ehrhardt, ferruh.yigit, thomas.monjalon, dev
This patch adds missing DEPDIRS to avoid any library referring to
symbols they are not linked against.
Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
---
drivers/crypto/null/Makefile | 2 ++
drivers/net/af_packet/Makefile | 1 +
drivers/net/bonding/Makefile | 2 ++
drivers/net/fm10k/Makefile | 1 +
drivers/net/null/Makefile | 1 +
drivers/net/pcap/Makefile | 1 +
drivers/net/vhost/Makefile | 1 +
lib/librte_ip_frag/Makefile | 1 +
lib/librte_pipeline/Makefile | 1 +
lib/librte_port/Makefile | 1 +
lib/librte_sched/Makefile | 1 +
11 files changed, 13 insertions(+)
diff --git a/drivers/crypto/null/Makefile b/drivers/crypto/null/Makefile
index 2173277..573894f 100644
--- a/drivers/crypto/null/Makefile
+++ b/drivers/crypto/null/Makefile
@@ -55,5 +55,7 @@ SYMLINK-y-include +=
DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_NULL_CRYPTO) += lib/librte_eal
DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_NULL_CRYPTO) += lib/librte_mbuf
DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_NULL_CRYPTO) += lib/librte_cryptodev
+DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_NULL_CRYPTO) += lib/librte_ring
+DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_NULL_CRYPTO) += lib/librte_kvargs
include $(RTE_SDK)/mk/rte.lib.mk
diff --git a/drivers/net/af_packet/Makefile b/drivers/net/af_packet/Makefile
index cb1a7ae..c6de1c6 100644
--- a/drivers/net/af_packet/Makefile
+++ b/drivers/net/af_packet/Makefile
@@ -51,6 +51,7 @@ CFLAGS += $(WERROR_FLAGS)
SRCS-$(CONFIG_RTE_LIBRTE_PMD_AF_PACKET) += rte_eth_af_packet.c
# this lib depends upon:
+DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_AF_PACKET) += lib/librte_eal
DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_AF_PACKET) += lib/librte_mbuf
DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_AF_PACKET) += lib/librte_ether
DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_AF_PACKET) += lib/librte_kvargs
diff --git a/drivers/net/bonding/Makefile b/drivers/net/bonding/Makefile
index 10c794c..504f2e8 100644
--- a/drivers/net/bonding/Makefile
+++ b/drivers/net/bonding/Makefile
@@ -64,5 +64,7 @@ DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += lib/librte_ether
DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += lib/librte_eal
DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += lib/librte_kvargs
DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += lib/librte_cmdline
+DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += lib/librte_mempool
+DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_BOND) += lib/librte_ring
include $(RTE_SDK)/mk/rte.lib.mk
diff --git a/drivers/net/fm10k/Makefile b/drivers/net/fm10k/Makefile
index cf141ae..afcbd1d 100644
--- a/drivers/net/fm10k/Makefile
+++ b/drivers/net/fm10k/Makefile
@@ -100,5 +100,6 @@ SRCS-$(CONFIG_RTE_LIBRTE_FM10K_INC_VECTOR) += fm10k_rxtx_vec.c
DEPDIRS-$(CONFIG_RTE_LIBRTE_FM10K_PMD) += lib/librte_eal lib/librte_ether
DEPDIRS-$(CONFIG_RTE_LIBRTE_FM10K_PMD) += lib/librte_mempool lib/librte_mbuf
DEPDIRS-$(CONFIG_RTE_LIBRTE_FM10K_PMD) += lib/librte_net
+DEPDIRS-$(CONFIG_RTE_LIBRTE_FM10K_PMD) += lib/librte_kvargs
include $(RTE_SDK)/mk/rte.lib.mk
diff --git a/drivers/net/null/Makefile b/drivers/net/null/Makefile
index 2202389..2d115de 100644
--- a/drivers/net/null/Makefile
+++ b/drivers/net/null/Makefile
@@ -54,6 +54,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_PMD_NULL) += rte_eth_null.c
SYMLINK-y-include += rte_eth_null.h
# this lib depends upon:
+DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_NULL) += lib/librte_eal
DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_NULL) += lib/librte_mbuf
DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_NULL) += lib/librte_ether
DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_NULL) += lib/librte_kvargs
diff --git a/drivers/net/pcap/Makefile b/drivers/net/pcap/Makefile
index b41d8a2..b2071e8 100644
--- a/drivers/net/pcap/Makefile
+++ b/drivers/net/pcap/Makefile
@@ -56,6 +56,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_PMD_PCAP) += rte_eth_pcap.c
SYMLINK-y-include +=
# this lib depends upon:
+DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_PCAP) += lib/librte_eal
DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_PCAP) += lib/librte_mbuf
DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_PCAP) += lib/librte_ether
DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_PCAP) += lib/librte_kvargs
diff --git a/drivers/net/vhost/Makefile b/drivers/net/vhost/Makefile
index 545d998..d3d3d05 100644
--- a/drivers/net/vhost/Makefile
+++ b/drivers/net/vhost/Makefile
@@ -56,6 +56,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_PMD_VHOST) += rte_eth_vhost.c
SYMLINK-y-include += rte_eth_vhost.h
# this lib depends upon:
+DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_VHOST) += lib/librte_eal
DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_VHOST) += lib/librte_mbuf
DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_VHOST) += lib/librte_ether
DEPDIRS-$(CONFIG_RTE_LIBRTE_PMD_VHOST) += lib/librte_kvargs
diff --git a/lib/librte_ip_frag/Makefile b/lib/librte_ip_frag/Makefile
index 9d06780..a375222 100644
--- a/lib/librte_ip_frag/Makefile
+++ b/lib/librte_ip_frag/Makefile
@@ -54,6 +54,7 @@ SYMLINK-$(CONFIG_RTE_LIBRTE_IP_FRAG)-include += rte_ip_frag.h
# this library depends on rte_ether
+DEPDIRS-$(CONFIG_RTE_LIBRTE_IP_FRAG) += lib/librte_eal
DEPDIRS-$(CONFIG_RTE_LIBRTE_IP_FRAG) += lib/librte_mempool lib/librte_ether
include $(RTE_SDK)/mk/rte.lib.mk
diff --git a/lib/librte_pipeline/Makefile b/lib/librte_pipeline/Makefile
index 822fd41..95387aa 100644
--- a/lib/librte_pipeline/Makefile
+++ b/lib/librte_pipeline/Makefile
@@ -52,6 +52,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_PIPELINE) := rte_pipeline.c
SYMLINK-$(CONFIG_RTE_LIBRTE_PIPELINE)-include += rte_pipeline.h
# this lib depends upon:
+DEPDIRS-$(CONFIG_RTE_LIBRTE_PIPELINE) += lib/librte_eal
DEPDIRS-$(CONFIG_RTE_LIBRTE_PIPELINE) := lib/librte_table
DEPDIRS-$(CONFIG_RTE_LIBRTE_PIPELINE) += lib/librte_port
diff --git a/lib/librte_port/Makefile b/lib/librte_port/Makefile
index d4de5af..dc6a601 100644
--- a/lib/librte_port/Makefile
+++ b/lib/librte_port/Makefile
@@ -75,5 +75,6 @@ DEPDIRS-$(CONFIG_RTE_LIBRTE_PORT) += lib/librte_mbuf
DEPDIRS-$(CONFIG_RTE_LIBRTE_PORT) += lib/librte_mempool
DEPDIRS-$(CONFIG_RTE_LIBRTE_PORT) += lib/librte_ether
DEPDIRS-$(CONFIG_RTE_LIBRTE_PORT) += lib/librte_ip_frag
+DEPDIRS-$(CONFIG_RTE_LIBRTE_PORT) += lib/librte_sched
include $(RTE_SDK)/mk/rte.lib.mk
diff --git a/lib/librte_sched/Makefile b/lib/librte_sched/Makefile
index a782cd1..44cb780 100644
--- a/lib/librte_sched/Makefile
+++ b/lib/librte_sched/Makefile
@@ -59,6 +59,7 @@ SYMLINK-$(CONFIG_RTE_LIBRTE_SCHED)-include := rte_sched.h rte_bitmap.h rte_sched
SYMLINK-$(CONFIG_RTE_LIBRTE_SCHED)-include += rte_reciprocal.h
# this lib depends upon:
+DEPDIRS-$(CONFIG_RTE_LIBRTE_SCHED) += lib/librte_eal
DEPDIRS-$(CONFIG_RTE_LIBRTE_SCHED) += lib/librte_mempool lib/librte_mbuf
DEPDIRS-$(CONFIG_RTE_LIBRTE_SCHED) += lib/librte_net lib/librte_timer
--
2.7.4
^ permalink raw reply [flat|nested] 62+ messages in thread
* Re: [dpdk-dev] [PATCH v2 0/2] mk: fix more library underlinking
2016-06-13 11:06 ` [dpdk-dev] [PATCH v2 0/2] mk: fix more library underlinking Christian Ehrhardt
2016-06-13 11:06 ` [dpdk-dev] [PATCH v2 1/2] mk: fix missing vhost dependency to pthread to avoid libarary underlinking Christian Ehrhardt
2016-06-13 11:06 ` [dpdk-dev] [PATCH v2 2/2] mk: fix missing DEPDIRS " Christian Ehrhardt
@ 2016-06-13 14:16 ` Thomas Monjalon
2 siblings, 0 replies; 62+ messages in thread
From: Thomas Monjalon @ 2016-06-13 14:16 UTC (permalink / raw)
To: Christian Ehrhardt; +Cc: ferruh.yigit, dev
2016-06-13 13:06, Christian Ehrhardt:
> After several cleanups libraries are now linked against the libs they
> refer as DEPDIR which is great.
> But that now also made it visible that some references where still missing.
>
> The following two patches try to fix that:
> [PATCH v2 1/2] mk: fix missing vhost dependency to pthread to avoid
> [PATCH v2 2/2] mk: fix missing DEPDIRS to avoid libarary underlinking
Applied, thanks
^ permalink raw reply [flat|nested] 62+ messages in thread
* Re: [dpdk-dev] [PATCH v2 0/6] reduce overlinking in applications
2016-06-10 13:19 ` [dpdk-dev] [PATCH v2 0/6] reduce " Thomas Monjalon
` (6 preceding siblings ...)
2016-06-10 18:32 ` [dpdk-dev] [PATCH v3 0/6] reduce overlinking in applications Ferruh Yigit
@ 2016-06-13 14:14 ` Thomas Monjalon
7 siblings, 0 replies; 62+ messages in thread
From: Thomas Monjalon @ 2016-06-13 14:14 UTC (permalink / raw)
To: Ferruh Yigit; +Cc: dev
2016-06-10 15:19, Thomas Monjalon:
> This is a respin of the ideas of Christian and Ferruh to limit
> the static application size or dynamic links to shared libraries.
>
> It also brings some clean-up in rte.app.mk.
>
> Ferruh Yigit (2):
> mk: prevent overlinking in applications
> mk: reduce scope of whole-archive static linking
>
> Thomas Monjalon (4):
> mk: sort drivers in static application link list
> mk: fix driver dependencies order for static application
> mk: remove library grouping during application linking
> mk: sort libraries in level order when linking
Applied
^ permalink raw reply [flat|nested] 62+ messages in thread