From patchwork Mon Jul 31 21:49:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Eads, Gage" X-Patchwork-Id: 27296 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id EC1F79B49; Mon, 31 Jul 2017 23:50:12 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id C09C99A16 for ; Mon, 31 Jul 2017 23:50:09 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga105.fm.intel.com with ESMTP; 31 Jul 2017 14:50:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="5.41,304,1498546800"; d="scan'208"; a="1178308677" Received: from txasoft-yocto.an.intel.com (HELO txasoft-yocto.an.intel.com.) ([10.123.72.111]) by fmsmga001.fm.intel.com with ESMTP; 31 Jul 2017 14:49:57 -0700 From: Gage Eads To: dev@dpdk.org Cc: thomas@monjalon.net Date: Mon, 31 Jul 2017 16:49:51 -0500 Message-Id: <1501537791-29754-1-git-send-email-gage.eads@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1500995026-20707-1-git-send-email-gage.eads@intel.com> References: <1500995026-20707-1-git-send-email-gage.eads@intel.com> Subject: [dpdk-dev] [PATCH v2] mk: use extra cflags when linking libs with a compiler X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" When using the compiler to link libraries, include EXTRA_CFLAGS. This is needed when cross-compiling to pass --sysroot, for example. GCC cross-compilers built with Yocto don't use the --with-sysroot option, making it necessary to pass the --sysroot command-line option. This is the same solution as in commit e8fbb6d9cfd9 ("mk: use extra cflags when linking with compiler"), but applied to libs instead of apps. Signed-off-by: Gage Eads --- v2: Added missing Signed-off-by field mk/rte.lib.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mk/rte.lib.mk b/mk/rte.lib.mk index bc2f2fb..13115d1 100644 --- a/mk/rte.lib.mk +++ b/mk/rte.lib.mk @@ -77,7 +77,7 @@ exe2cmd = $(strip $(call dotfile,$(patsubst %,%.cmd,$(1)))) ifeq ($(LINK_USING_CC),1) # Override the definition of LD here, since we're linking with CC -LD := $(CC) $(CPU_CFLAGS) +LD := $(CC) $(CPU_CFLAGS) $(EXTRA_CFLAGS) _CPU_LDFLAGS := $(call linkerprefix,$(CPU_LDFLAGS)) override EXTRA_LDFLAGS := $(call linkerprefix,$(EXTRA_LDFLAGS)) else