From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: [PATCH 2/2] mk: fix dependency on toolchain libraries Date: Wed, 13 Jul 2016 09:42:08 +0200 Message-ID: <1468395728-6968-2-git-send-email-thomas.monjalon@6wind.com> References: <1468395728-6968-1-git-send-email-thomas.monjalon@6wind.com> To: dev@dpdk.org Return-path: Received: from mail-wm0-f47.google.com (mail-wm0-f47.google.com [74.125.82.47]) by dpdk.org (Postfix) with ESMTP id 6C9712C8 for ; Wed, 13 Jul 2016 09:42:19 +0200 (CEST) Received: by mail-wm0-f47.google.com with SMTP id i5so55112640wmg.0 for ; Wed, 13 Jul 2016 00:42:19 -0700 (PDT) Received: from XPS13.dev.6wind.com (guy78-3-82-239-227-177.fbx.proxad.net. [82.239.227.177]) by smtp.gmail.com with ESMTPSA id a191sm8732538wme.5.2016.07.13.00.42.18 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 13 Jul 2016 00:42:18 -0700 (PDT) In-Reply-To: <1468395728-6968-1-git-send-email-thomas.monjalon@6wind.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 Tested-by: Raslan Darawsheh --- mk/rte.app.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mk/rte.app.mk b/mk/rte.app.mk index f9acb74..886dbdd 100644 --- a/mk/rte.app.mk +++ b/mk/rte.app.mk @@ -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 -- 2.7.0