[dpdk-dev,3/3] mk: update app linking flags against shared libs

Message ID 1429090230-25137-4-git-send-email-sergio.gonzalez.monroy@intel.com (mailing list archive)
State Changes Requested, archived
Headers

Commit Message

Sergio Gonzalez Monroy April 15, 2015, 9:30 a.m. UTC
  Use flag --as-needed when linking against shared libs, exluding
eal, malloc, mempool and ring as explained in:
7cee5f6b4a9b ("lib: set LDLIBS for each library")

Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
---
 mk/rte.app.mk | 36 ++++++++++++++++++++----------------
 1 file changed, 20 insertions(+), 16 deletions(-)
  

Comments

Sergio Gonzalez Monroy April 15, 2015, 2:17 p.m. UTC | #1
On 15/04/2015 10:30, Sergio Gonzalez Monroy wrote:
> Use flag --as-needed when linking against shared libs, exluding
> eal, malloc, mempool and ring as explained in:
> 7cee5f6b4a9b ("lib: set LDLIBS for each library")
Self-NACK. It is not correct to put the commit id here (it does not 
exist after all :) ).

I'll send v2 with new commit message, but I'd wait until someone review 
the rest of the patch first.

Sergio
> Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
> ---
>   mk/rte.app.mk | 36 ++++++++++++++++++++----------------
>   1 file changed, 20 insertions(+), 16 deletions(-)
>
> diff --git a/mk/rte.app.mk b/mk/rte.app.mk
> index 62a76ae..c557957 100644
> --- a/mk/rte.app.mk
> +++ b/mk/rte.app.mk
> @@ -67,6 +67,26 @@ endif
>   
>   ifeq ($(CONFIG_RTE_BUILD_COMBINE_LIBS),n)
>   
> +ifeq ($(CONFIG_RTE_LIBRTE_EAL),y)
> +LDLIBS += -lrte_eal
> +endif
> +
> +ifeq ($(CONFIG_RTE_LIBRTE_MALLOC),y)
> +LDLIBS += -lrte_malloc
> +endif
> +
> +ifeq ($(CONFIG_RTE_LIBRTE_MEMPOOL),y)
> +LDLIBS += -lrte_mempool
> +endif
> +
> +ifeq ($(CONFIG_RTE_LIBRTE_RING),y)
> +LDLIBS += -lrte_ring
> +endif
> +
> +ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y)
> +LDLIBS += --as-needed
> +endif
> +
>   ifeq ($(CONFIG_RTE_LIBRTE_DISTRIBUTOR),y)
>   LDLIBS += -lrte_distributor
>   endif
> @@ -171,22 +191,6 @@ ifeq ($(CONFIG_RTE_LIBRTE_ETHER),y)
>   LDLIBS += -lethdev
>   endif
>   
> -ifeq ($(CONFIG_RTE_LIBRTE_MALLOC),y)
> -LDLIBS += -lrte_malloc
> -endif
> -
> -ifeq ($(CONFIG_RTE_LIBRTE_MEMPOOL),y)
> -LDLIBS += -lrte_mempool
> -endif
> -
> -ifeq ($(CONFIG_RTE_LIBRTE_RING),y)
> -LDLIBS += -lrte_ring
> -endif
> -
> -ifeq ($(CONFIG_RTE_LIBRTE_EAL),y)
> -LDLIBS += -lrte_eal
> -endif
> -
>   ifeq ($(CONFIG_RTE_LIBRTE_CMDLINE),y)
>   LDLIBS += -lrte_cmdline
>   endif
  

Patch

diff --git a/mk/rte.app.mk b/mk/rte.app.mk
index 62a76ae..c557957 100644
--- a/mk/rte.app.mk
+++ b/mk/rte.app.mk
@@ -67,6 +67,26 @@  endif
 
 ifeq ($(CONFIG_RTE_BUILD_COMBINE_LIBS),n)
 
+ifeq ($(CONFIG_RTE_LIBRTE_EAL),y)
+LDLIBS += -lrte_eal
+endif
+
+ifeq ($(CONFIG_RTE_LIBRTE_MALLOC),y)
+LDLIBS += -lrte_malloc
+endif
+
+ifeq ($(CONFIG_RTE_LIBRTE_MEMPOOL),y)
+LDLIBS += -lrte_mempool
+endif
+
+ifeq ($(CONFIG_RTE_LIBRTE_RING),y)
+LDLIBS += -lrte_ring
+endif
+
+ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y)
+LDLIBS += --as-needed
+endif
+
 ifeq ($(CONFIG_RTE_LIBRTE_DISTRIBUTOR),y)
 LDLIBS += -lrte_distributor
 endif
@@ -171,22 +191,6 @@  ifeq ($(CONFIG_RTE_LIBRTE_ETHER),y)
 LDLIBS += -lethdev
 endif
 
-ifeq ($(CONFIG_RTE_LIBRTE_MALLOC),y)
-LDLIBS += -lrte_malloc
-endif
-
-ifeq ($(CONFIG_RTE_LIBRTE_MEMPOOL),y)
-LDLIBS += -lrte_mempool
-endif
-
-ifeq ($(CONFIG_RTE_LIBRTE_RING),y)
-LDLIBS += -lrte_ring
-endif
-
-ifeq ($(CONFIG_RTE_LIBRTE_EAL),y)
-LDLIBS += -lrte_eal
-endif
-
 ifeq ($(CONFIG_RTE_LIBRTE_CMDLINE),y)
 LDLIBS += -lrte_cmdline
 endif