[dpdk-dev] [PATCH] mk: fix build ignoring other installed versions
Thomas Monjalon
thomas.monjalon at 6wind.com
Tue Apr 29 13:52:03 CEST 2014
If some DPDK libraries are installed on the system, the linker was trying
to use them before searching in -L path.
The obscure reason is that we were prefixing -L with -Wl, to pass it
directly to the linker.
But -L is also a gcc option. And allowing gcc to process this option fixes
the issue.
Signed-off-by: Thomas Monjalon <thomas.monjalon at 6wind.com>
---
mk/rte.app.mk | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/mk/rte.app.mk b/mk/rte.app.mk
index 072718a..fa67a67 100644
--- a/mk/rte.app.mk
+++ b/mk/rte.app.mk
@@ -51,7 +51,7 @@ LDSCRIPT = $(RTE_LDSCRIPT)
endif
# default path for libs
-LDLIBS += -L$(RTE_SDK_BIN)/lib
+LDPATH += -L$(RTE_SDK_BIN)/lib
#
# Include libraries depending on config if NO_AUTOLIBS is not set
@@ -209,10 +209,11 @@ LDLIBS := $(addprefix -Wl$(comma),$(LDLIBS))
LDFLAGS := $(addprefix -Wl$(comma),$(LDFLAGS))
override EXTRA_LDFLAGS := $(addprefix -Wl$(comma),$(EXTRA_LDFLAGS))
O_TO_EXE = $(CC) $(CFLAGS) $(LDFLAGS_$(@)) \
- -Wl,-Map=$(@).map,--cref -o $@ $(OBJS-y) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LDLIBS)
+ -Wl,-Map=$(@).map,--cref -o $@ $(OBJS-y) \
+ $(LDFLAGS) $(EXTRA_LDFLAGS) $(LDPATH) $(LDLIBS)
else
O_TO_EXE = $(LD) $(LDFLAGS) $(LDFLAGS_$(@)) $(EXTRA_LDFLAGS) \
- -Map=$(@).map --cref -o $@ $(OBJS-y) $(LDLIBS)
+ -Map=$(@).map --cref -o $@ $(OBJS-y) $(LDPATH) $(LDLIBS)
endif
O_TO_EXE_STR = $(subst ','\'',$(O_TO_EXE)) #'# fix syntax highlight
O_TO_EXE_DISP = $(if $(V),"$(O_TO_EXE_STR)"," LD $(@)")
--
1.9.2
More information about the dev
mailing list