mk: fix linking with some linux toolchains
authorSergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
Thu, 30 Oct 2014 10:57:42 +0000 (10:57 +0000)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Sat, 29 Nov 2014 20:17:01 +0000 (21:17 +0100)
Ubuntu/Debian toolchain passes --as-needed flag to the linker by default.
Add --no-as-needed flag by default in linuxapp exec-env to ensure correct
linking.

The problem arises because librte_eal doesn't add a DT_NEEDED entry for
librte_mempool despite the fact that it references symbols in that library.
It does this because we don't explicitly link with -lrte_mempool when we
build librte_eal.

Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
mk/exec-env/linuxapp/rte.vars.mk

index afcefa6..e5af318 100644 (file)
@@ -45,7 +45,9 @@ else
 EXECENV_CFLAGS  = -pthread
 endif
 
-EXECENV_LDFLAGS =
+# Workaround lack of DT_NEEDED entry
+EXECENV_LDFLAGS = --no-as-needed
+
 EXECENV_LDLIBS  = -lrt -lm
 EXECENV_ASFLAGS =