From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f43.google.com (mail-wm0-f43.google.com [74.125.82.43]) by dpdk.org (Postfix) with ESMTP id 796392C8 for ; Wed, 13 Jul 2016 09:42:18 +0200 (CEST) Received: by mail-wm0-f43.google.com with SMTP id f126so16946649wma.1 for ; Wed, 13 Jul 2016 00:42:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id; bh=dZ0lu0Y+3wCU4GCIf2Yf3PMrM5MZ7xHZ9PJ0JRqDkvs=; b=QlvnHztBraUhU75pbcKUpDT4YIoczgGQxGiyYEBkZfJmcSkbZT9LgxpkY+Yc9liOWK U0ZTKRNW6Ws0xUzE91xZaDKBlWdiPIcVB0OZBFGLy9ch4s42R4YbeOENAQuYIWRWwntX Y/eaoksX8xpOfNdXBYM4KzJyVDoiFb12/PWScxwm9tIdFqBsCH3iRHTxZh8XPA2IHOcB dxRtg1xWNx3FcKXyjZvTDO12Oz9WhE+eChbkVBunguWN5u8wLkv9M6GUDJZ8TYhfuvEN KEzfMGoPnRDYEfHL93csoteF5KUxyONxG/t8n4jZKA3WbOtwgh0GLQJSRB/js0D+vPNK XD4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id; bh=dZ0lu0Y+3wCU4GCIf2Yf3PMrM5MZ7xHZ9PJ0JRqDkvs=; b=Aan/39SKAtSkaVU0RyEwR1D1N8EBIO+IwqyKQy5oHWdorOouLlQ1IOa+kgLq0cVcX/ RhLJU+Yyanb1zsKBXsZN+Imv6EFgfXDRPdl/Xw3iKEQk1sbJdMuTBiCde0SLN6tZTmrO xG4fhVd+qXX3E1QdfYNmw+p/Sc7zR4f0KmETfjynJeREgFxShGK6Hc0Q+XVi9NJQMqzD ATkr0XkFhAEtOQfbYIAORb7dq01BgDAKGMwNSiEaiqfJQnPePd0N6oosQIN1/vdu9w12 K3MZuDc6OjfY33rzrQRAhBHKVjbnSsASyPa+/vDKaCWnUfqU14GpSK7wC9vLMrtSa9ri m6jg== X-Gm-Message-State: ALyK8tKS7ergHNfHHt0GOTaT/NxQzDvqqhAHbPfdv7K/75F3JeRx8cujJ8AHnWTusFNf/gCn X-Received: by 10.28.45.15 with SMTP id t15mr24190118wmt.37.1468395737963; Wed, 13 Jul 2016 00:42:17 -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.16 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 13 Jul 2016 00:42:16 -0700 (PDT) From: Thomas Monjalon To: dev@dpdk.org Date: Wed, 13 Jul 2016 09:42:07 +0200 Message-Id: <1468395728-6968-1-git-send-email-thomas.monjalon@6wind.com> X-Mailer: git-send-email 2.7.0 Subject: [dpdk-dev] [PATCH 1/2] mk: clean up application linker flags X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jul 2016 07:42:18 -0000 Make some cleaning before fixing the link dependency ordering in the next commit. - Move flags for creating a map file in the variable MAPFLAGS. - Make only one call to linkerprefix macro. - Group linker flags on the same line. Signed-off-by: Thomas Monjalon --- mk/rte.app.mk | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/mk/rte.app.mk b/mk/rte.app.mk index ea22961..f9acb74 100644 --- a/mk/rte.app.mk +++ b/mk/rte.app.mk @@ -176,6 +176,8 @@ ifeq ($(RTE_DEVEL_BUILD)$(CONFIG_RTE_BUILD_SHARED_LIB),yy) LDFLAGS += -rpath=$(RTE_SDK_BIN)/lib endif +MAPFLAGS = -Map=$@.map --cref + .PHONY: all all: install @@ -190,13 +192,13 @@ build: _postbuild exe2cmd = $(strip $(call dotfile,$(patsubst %,%.cmd,$(1)))) ifeq ($(LINK_USING_CC),1) -override EXTRA_LDFLAGS := $(call linkerprefix,$(EXTRA_LDFLAGS)) -O_TO_EXE = $(CC) $(CFLAGS) $(LDFLAGS_$(@)) \ - -Wl,-Map=$(@).map,--cref -o $@ $(OBJS-y) $(call linkerprefix,$(LDFLAGS)) \ - $(EXTRA_LDFLAGS) $(call linkerprefix,$(LDLIBS)) +O_TO_EXE = $(CC) -o $@ $(CFLAGS) $(OBJS-y) $(call linkerprefix, \ + $(LDFLAGS) $(LDFLAGS_$(@)) $(EXTRA_LDFLAGS) $(LDLIBS) \ + $(MAPFLAGS)) else -O_TO_EXE = $(LD) $(LDFLAGS) $(LDFLAGS_$(@)) $(EXTRA_LDFLAGS) \ - -Map=$(@).map --cref -o $@ $(OBJS-y) $(LDLIBS) +O_TO_EXE = $(LD) -o $@ $(OBJS-y) \ + $(LDFLAGS) $(LDFLAGS_$(@)) $(EXTRA_LDFLAGS) $(LDLIBS) \ + $(MAPFLAGS) endif O_TO_EXE_STR = $(subst ','\'',$(O_TO_EXE)) #'# fix syntax highlight O_TO_EXE_DISP = $(if $(V),"$(O_TO_EXE_STR)"," LD $(@)") -- 2.7.0