From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8A72CA0352; Tue, 5 Nov 2019 02:56:54 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2740C2C23; Tue, 5 Nov 2019 02:56:54 +0100 (CET) Received: from mail-pg1-f176.google.com (mail-pg1-f176.google.com [209.85.215.176]) by dpdk.org (Postfix) with ESMTP id C54D52BE9 for ; Tue, 5 Nov 2019 02:56:52 +0100 (CET) Received: by mail-pg1-f176.google.com with SMTP id j30so9375388pgn.5 for ; Mon, 04 Nov 2019 17:56:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=MxpsR8NssAX9UcgonB/YE2uVMlEIN4UfEVX6frMYE3Q=; b=Isg980YbgAMztV4sCXA84QlhUWvAgWUNYJCIetvg5Yf8wfy9IqncrP10+LnAGCN5J8 dFDLdbo0zS2uviPQwJ1BFtNaFElJZgJrnlq85QuZFcADkXcMGRZMRULLr35PtxXxGqA9 E0Px7yx3GxNdTk4mrR4GxO0MVij/b64kBo+V/+DGQQTyMwffiyS5LHlmvR/FIz45uslQ e2EyiZUeoQHT+KbDltr6iA3kZn5AQh8wOKtRtPVcuDa0U21Dc008j3Qh5TasdYgmc/0M evB3mjnDEz90bzW4ieU8lA8wqPDuHOYbE9tf90fROJEXQMNqyHJBmkPMaDvlUZC8c3i9 gWaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=MxpsR8NssAX9UcgonB/YE2uVMlEIN4UfEVX6frMYE3Q=; b=HmZAdxGWsGi3+bG5jqS+y8tbCbx2rDT2ztatt1fQwK9CpIiv3lPgZpkJqDfl7QeVfP XMw8dE2NLGFR+H5zf8fcdPLsY5xD+9o9M00iCmrKincAvIAasqrocW956l7RHrkfD648 +VG9RcTy8e6ZQSbwSH8riPQK9IqFsB7Svgf4Bh8BNlqD5LLfN06deAbwgvsj9EveNDzQ kef0txMQE/AmjSFmNMX7TqwCZ81+aG4RAh3TyyugCDGVrYyLf/l+kxqX2OQXLlJGMSe0 snByyuLCIkmrfNlpvP2eCC5EG6G5OmAmOk+QGYEC1B8bR/NnTD7G2NFB15D6UyxXZ9o4 FpAg== X-Gm-Message-State: APjAAAUqcdBnALTT/J7qh/z+ePnD7BOGAycFcWtEQLJMeeoJKaw9BsR+ m+qeKiuElXYzNMCGEIs5q1Dln6KZ/SRBHA== X-Google-Smtp-Source: APXvYqwwO89gw1/pb/ZOYppWeRkAda0C2LUIhS3rk4VERA/++1aGNfch4FpHkGdgclolW28Z/YgKpQ== X-Received: by 2002:a63:4104:: with SMTP id o4mr32926651pga.169.1572919011154; Mon, 04 Nov 2019 17:56:51 -0800 (PST) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id x10sm15036653pgl.53.2019.11.04.17.56.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Nov 2019 17:56:50 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Date: Mon, 4 Nov 2019 17:56:42 -0800 Message-Id: <20191105015642.17385-1-stephen@networkplumber.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH] mk: add EXTRA_CFLAGS to link step for shared library 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 doing a cross compiling it is common to use EXTRA_CFLAGS with --sysroot option to point to alternate root filesystem. This already works as expected for objects and executables, it just doesn't work correctly for shared libraries. When a shared library is linked using CC this flag needs to be passed in order for libraries to be found. Signed-off-by: Stephen Hemminger --- mk/rte.shared.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mk/rte.shared.mk b/mk/rte.shared.mk index 2b501ddb8480..a0620a3eb233 100644 --- a/mk/rte.shared.mk +++ b/mk/rte.shared.mk @@ -31,7 +31,7 @@ exe2cmd = $(strip $(call dotfile,$(patsubst %,%.cmd,$(1)))) ifeq ($(LINK_USING_CC),1) override EXTRA_LDFLAGS := $(call linkerprefix,$(EXTRA_LDFLAGS)) -O_TO_SO = $(CC) $(call linkerprefix,$(LDFLAGS)) $(LDFLAGS_$(@)) $(EXTRA_LDFLAGS) \ +O_TO_SO = $(CC) $(EXTRA_CFLAGS) $(call linkerprefix,$(LDFLAGS)) $(LDFLAGS_$(@)) $(EXTRA_LDFLAGS) \ -shared -o $@ $(OBJS-y) $(call linkerprefix,$(LDLIBS)) else O_TO_SO = $(LD) $(LDFLAGS) $(LDFLAGS_$(@)) $(EXTRA_LDFLAGS) \ -- 2.20.1