[dpdk-dev,2/2] mk: fix dependency on toolchain libraries
Commit Message
The -l options specifying libraries to link with are in LDLIBS.
But it can happen to have some libraries in other variables.
In case of a low level dependency specified in some environments
via EXTRA_LDFLAGS, there can be an unresolved issue due to a
wrong linking order. Indeed the libraries must be specified from
the higher level (dependency consumers) to the lower level (dependencies).
It is fixed by moving LDLIBS before LDFLAGS variables in the link
command line.
Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Tested-by: Raslan Darawsheh <rasland@mellanox.com>
---
mk/rte.app.mk | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Comments
2016-07-13 09:42, Thomas Monjalon:
> The -l options specifying libraries to link with are in LDLIBS.
> But it can happen to have some libraries in other variables.
> In case of a low level dependency specified in some environments
> via EXTRA_LDFLAGS, there can be an unresolved issue due to a
> wrong linking order. Indeed the libraries must be specified from
> the higher level (dependency consumers) to the lower level (dependencies).
>
> It is fixed by moving LDLIBS before LDFLAGS variables in the link
> command line.
>
> Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
> Tested-by: Raslan Darawsheh <rasland@mellanox.com>
Series applied
@@ -193,11 +193,11 @@ exe2cmd = $(strip $(call dotfile,$(patsubst %,%.cmd,$(1))))
ifeq ($(LINK_USING_CC),1)
O_TO_EXE = $(CC) -o $@ $(CFLAGS) $(OBJS-y) $(call linkerprefix, \
- $(LDFLAGS) $(LDFLAGS_$(@)) $(EXTRA_LDFLAGS) $(LDLIBS) \
+ $(LDLIBS) $(LDFLAGS) $(LDFLAGS_$(@)) $(EXTRA_LDFLAGS) \
$(MAPFLAGS))
else
O_TO_EXE = $(LD) -o $@ $(OBJS-y) \
- $(LDFLAGS) $(LDFLAGS_$(@)) $(EXTRA_LDFLAGS) $(LDLIBS) \
+ $(LDLIBS) $(LDFLAGS) $(LDFLAGS_$(@)) $(EXTRA_LDFLAGS) \
$(MAPFLAGS)
endif
O_TO_EXE_STR = $(subst ','\'',$(O_TO_EXE)) #'# fix syntax highlight