From: Ben Hutchings Date: Mon, 7 Sep 2020 02:38:04 +0000 (+0100) Subject: Makefile: Do not check for libelf when building OOT module X-Git-Tag: archive/raspbian/5.10.4-1+rpi1^2~28 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=fd1e56174257170c5a19868853872c349cf629b5;p=linux.git Makefile: Do not check for libelf when building OOT module When building out-of-tree modules, the necessary tools should have already been built. We therefore do not need libelf-dev to be installed. This effectively reverts commit 9f0c18aec620 "objtool: Fix CONFIG_STACK_VALIDATION=y warning for out-of-tree modules", and similarly moves the check introduced by commit 33a57ce0a54d "bpf: Compile resolve_btfids tool at kernel compilation start". Gbp-Pq: Topic debian Gbp-Pq: Name makefile-do-not-check-for-libelf-when-building-oot-module.patch --- diff --git a/Makefile b/Makefile index 456e82e55a8..88cc98a1de6 100644 --- a/Makefile +++ b/Makefile @@ -1073,28 +1073,6 @@ export mod_sign_cmd HOST_LIBELF_LIBS = $(shell pkg-config libelf --libs 2>/dev/null || echo -lelf) -has_libelf = $(call try-run,\ - echo "int main() {}" | $(HOSTCC) -xc -o /dev/null $(HOST_LIBELF_LIBS) -,1,0) - -ifdef CONFIG_STACK_VALIDATION - ifeq ($(has_libelf),1) - objtool_target := tools/objtool FORCE - else - SKIP_STACK_VALIDATION := 1 - export SKIP_STACK_VALIDATION - endif -endif - -ifdef CONFIG_BPF -ifdef CONFIG_DEBUG_INFO_BTF - ifeq ($(has_libelf),1) - resolve_btfids_target := tools/bpf/resolve_btfids FORCE - else - ERROR_RESOLVE_BTFIDS := 1 - endif -endif # CONFIG_DEBUG_INFO_BTF -endif # CONFIG_BPF - PHONY += prepare0 export MODORDER := $(extmod-prefix)modules.order @@ -1218,6 +1196,28 @@ uapi-asm-generic: $(Q)$(MAKE) $(asm-generic)=arch/$(SRCARCH)/include/generated/uapi/asm \ generic=include/uapi/asm-generic +has_libelf = $(call try-run,\ + echo "int main() {}" | $(HOSTCC) -xc -o /dev/null $(HOST_LIBELF_LIBS) -,1,0) + +ifdef CONFIG_STACK_VALIDATION + ifeq ($(has_libelf),1) + objtool_target := tools/objtool FORCE + else + SKIP_STACK_VALIDATION := 1 + export SKIP_STACK_VALIDATION + endif +endif + +ifdef CONFIG_BPF +ifdef CONFIG_DEBUG_INFO_BTF + ifeq ($(has_libelf),1) + resolve_btfids_target := tools/bpf/resolve_btfids FORCE + else + ERROR_RESOLVE_BTFIDS := 1 + endif +endif # CONFIG_DEBUG_INFO_BTF +endif # CONFIG_BPF + PHONY += prepare-objtool prepare-resolve_btfids prepare-objtool: $(objtool_target) ifeq ($(SKIP_STACK_VALIDATION),1)