summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorRolf Eike Beer <eb@emlix.com>2019-03-26 12:48:39 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-04-03 06:27:38 +0200
commit8f84f7daabb2fddfc5f81e9257e8c465b2a0caef (patch)
treebf6ddb6a500c4f9a0307dce39980e3bda6cacc15 /Makefile
parenta0de19f1c307e8e82add7660632857759a4ab814 (diff)
objtool: Query pkg-config for libelf location
commit 056d28d135bca0b1d0908990338e00e9dadaf057 upstream. If it is not in the default location, compilation fails at several points. Signed-off-by: Rolf Eike Beer <eb@emlix.com> Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/91a25e992566a7968fedc89ec80e7f4c83ad0548.1553622500.git.jpoimboe@redhat.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile4
1 files changed, 3 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 63152c5ca136..b09896e694fd 100644
--- a/Makefile
+++ b/Makefile
@@ -944,9 +944,11 @@ mod_sign_cmd = true
endif
export mod_sign_cmd
+HOST_LIBELF_LIBS = $(shell pkg-config libelf --libs 2>/dev/null || echo -lelf)
+
ifdef CONFIG_STACK_VALIDATION
has_libelf := $(call try-run,\
- echo "int main() {}" | $(HOSTCC) -xc -o /dev/null -lelf -,1,0)
+ echo "int main() {}" | $(HOSTCC) -xc -o /dev/null $(HOST_LIBELF_LIBS) -,1,0)
ifeq ($(has_libelf),1)
objtool_target := tools/objtool FORCE
else