]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - Makefile
objtool: Query pkg-config for libelf location
[mirror_ubuntu-bionic-kernel.git] / Makefile
index 146f17268237421c4fa5d77c4434134107c92398..aa6ea26ca3eefd4e722f21fb02f38a82c3bdadc2 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -974,9 +974,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