mk: prevent overlinking in applications

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>
This commit is contained in:
Ferruh Yigit 2016-06-10 15:19:07 +02:00 committed by Thomas Monjalon
parent 4e04fd459c
commit 6248e442ee
2 changed files with 3 additions and 3 deletions

View 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 =

View 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