mk: prevent overlinking in applications
authorFerruh Yigit <ferruh.yigit@intel.com>
Fri, 10 Jun 2016 13:19:07 +0000 (15:19 +0200)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Mon, 13 Jun 2016 14:09:58 +0000 (16:09 +0200)
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
mk/rte.app.mk

index d51bd17..a8a1ee4 100644 (file)
@@ -45,9 +45,6 @@ else
 EXECENV_CFLAGS  = -pthread
 endif
 
-# Workaround lack of DT_NEEDED entry
-EXECENV_LDFLAGS = --no-as-needed
-
 EXECENV_LDLIBS  =
 EXECENV_ASFLAGS =
 
index 9306b30..d01a79f 100644 (file)
@@ -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