Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp5612663yba; Thu, 11 Apr 2019 01:47:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqxnD62z/dmCDqaUjowCCq3bthZsaa4g4fk7EFZ6v2HcvTDHqffGJRUsZUIpr6rWMnGnC5B6 X-Received: by 2002:a63:751d:: with SMTP id q29mr46268464pgc.215.1554972457141; Thu, 11 Apr 2019 01:47:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554972457; cv=none; d=google.com; s=arc-20160816; b=RGOlfJDmg7pzr5i+xHHi6ef9Kqd7akGRqVTs64808tb8n8wRuAHY5PCdIb9mgpxFgQ GpJKwX8ty40AKKD1uMRx6GmyiicJpNm+xe0NKmeU6pKLdBNS6A7mX+ZGYghimjD3Ti3j ULLxf8Mdf+Hae9HyEdJfGhGtIrR23lp5ooSoSmluMg+dLTSMExWP+LwpE3S+Gvaa3BZg 1nm7ZCOoxBnWMdFf5lnJthitxVfqCMQCh64C+mA37D83lkJHnUxGPl07JCi5WNX2byJn 6F8i7+kjwbcwS/zg10znnNGCsFf59NHFWrAZaITx8rTmvRRYouWnwst/0/e0SZQjhYve WocQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=iLgaw4QN4Wf/+YGzbTi1xE3Rqzdnvv5BKv1KWjuKcMY=; b=GAqGilvb8/d09fV0Lpn9HhGpY84jzMCLWnQoCVcaqO2pUAA6+FJH/t1kGXgMgXRVjo JXHRFei/UqRNnjrjRIIg2FiPAWuQBE5MbjL9Hj7DFfmbhh0A2Pu4LXwitCABTEehZ8Km eIs2KKcUli5/w3iBkao8HW/Ga0tfTKR87TLPYR86mDpVVjAk/feeEbNFhatgdRRHn+aB fdJI0NC/PWfbIa39/CVkh8ijG5RFvfF67JMmPvR0WLeRuh9QvRvIOdCcB2fp0R6iZu9O Vy/Z2yehyzUtNQoFhTyqKSuIdOM6TGnNMS+RDW84DYXA209j6A07gOZXOP0LUGlyG4tl s4ag== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d23si12739043pgh.448.2019.04.11.01.47.21; Thu, 11 Apr 2019 01:47:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726914AbfDKIqf (ORCPT + 99 others); Thu, 11 Apr 2019 04:46:35 -0400 Received: from host.76.145.23.62.rev.coltfrance.com ([62.23.145.76]:56237 "EHLO proxy.6wind.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726121AbfDKIqf (ORCPT ); Thu, 11 Apr 2019 04:46:35 -0400 X-Greylist: delayed 412 seconds by postgrey-1.27 at vger.kernel.org; Thu, 11 Apr 2019 04:46:34 EDT Received: from bretzel.dev.6wind.com (unknown [10.16.0.19]) by proxy.6wind.com (Postfix) with ESMTPS id 337FA29703B; Thu, 11 Apr 2019 10:39:41 +0200 (CEST) Received: from dichtel by bretzel.dev.6wind.com with local (Exim 4.89) (envelope-from ) id 1hEVFF-00012m-22; Thu, 11 Apr 2019 10:39:41 +0200 From: Nicolas Dichtel To: tglx@linutronix.de, jpoimboe@redhat.com, eb@emlix.com, yamada.masahiro@socionext.com, peterz@infradead.org Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Nicolas Dichtel Subject: [PATCH linux] objtool: fix pkg-config query in case of cross-compilation Date: Thu, 11 Apr 2019 10:39:40 +0200 Message-Id: <20190411083940.3911-1-nicolas.dichtel@6wind.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In case of cross-compilation, there may be two pkg-config tools, one for the host and one for the target. Enable to override the default name. Fixes: 056d28d135bc ("objtool: Query pkg-config for libelf location") Signed-off-by: Nicolas Dichtel --- Makefile | 3 ++- tools/objtool/Makefile | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 15c8251d4d5e..f12ca3598fc4 100644 --- a/Makefile +++ b/Makefile @@ -953,7 +953,8 @@ mod_sign_cmd = true endif export mod_sign_cmd -HOST_LIBELF_LIBS = $(shell pkg-config libelf --libs 2>/dev/null || echo -lelf) +export HOST_PKG_CONFIG ?= pkg-config +HOST_LIBELF_LIBS = $(shell $(HOST_PKG_CONFIG) libelf --libs 2>/dev/null || echo -lelf) ifdef CONFIG_STACK_VALIDATION has_libelf := $(call try-run,\ diff --git a/tools/objtool/Makefile b/tools/objtool/Makefile index 53f8be0f4a1f..4e229e77aacf 100644 --- a/tools/objtool/Makefile +++ b/tools/objtool/Makefile @@ -25,8 +25,8 @@ LIBSUBCMD = $(LIBSUBCMD_OUTPUT)libsubcmd.a OBJTOOL := $(OUTPUT)objtool OBJTOOL_IN := $(OBJTOOL)-in.o -LIBELF_FLAGS := $(shell pkg-config libelf --cflags 2>/dev/null) -LIBELF_LIBS := $(shell pkg-config libelf --libs 2>/dev/null || echo -lelf) +LIBELF_FLAGS := $(shell $(HOST_PKG_CONFIG) libelf --cflags 2>/dev/null) +LIBELF_LIBS := $(shell $(HOST_PKG_CONFIG) libelf --libs 2>/dev/null || echo -lelf) all: $(OBJTOOL) -- 2.21.0