lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 11 Apr 2019 10:39:40 +0200
From:   Nicolas Dichtel <nicolas.dichtel@...nd.com>
To:     tglx@...utronix.de, jpoimboe@...hat.com, eb@...ix.com,
        yamada.masahiro@...ionext.com, peterz@...radead.org
Cc:     linux-kbuild@...r.kernel.org, linux-kernel@...r.kernel.org,
        Nicolas Dichtel <nicolas.dichtel@...nd.com>
Subject: [PATCH linux] objtool: fix pkg-config query in case of cross-compilation

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 <nicolas.dichtel@...nd.com>
---
 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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ