]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
bpf: Check CONFIG_BPF option for resolve_btfids
authorJiri Olsa <jolsa@kernel.org>
Wed, 23 Sep 2020 18:57:34 +0000 (20:57 +0200)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 23 Sep 2020 19:43:04 +0000 (12:43 -0700)
Currently all the resolve_btfids 'users' are under CONFIG_BPF
code, so if we have CONFIG_BPF disabled, resolve_btfids will
fail, because there's no data to resolve.

Disabling resolve_btfids if there's CONFIG_BPF disabled,
so we won't fail such builds.

Suggested-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Andrii Nakryiko <andriin@fb.com>
Link: https://lore.kernel.org/bpf/20200923185735.3048198-1-jolsa@kernel.org
Makefile
scripts/link-vmlinux.sh

index c4470a4e131f2cedfac4e7602d41b33f54647769..b05682eea2c019086c29623f9d52519e2fbfcdc6 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1084,13 +1084,15 @@ ifdef CONFIG_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
+endif # CONFIG_DEBUG_INFO_BTF
+endif # CONFIG_BPF
 
 PHONY += prepare0
 
index e6e2d9e5ff48785d5415f6724a76cadf82961c2b..dbde59d343b11bcc2051198945e728a0101c222c 100755 (executable)
@@ -341,9 +341,9 @@ fi
 vmlinux_link vmlinux "${kallsymso}" ${btf_vmlinux_bin_o}
 
 # fill in BTF IDs
-if [ -n "${CONFIG_DEBUG_INFO_BTF}" ]; then
-info BTFIDS vmlinux
-${RESOLVE_BTFIDS} vmlinux
+if [ -n "${CONFIG_DEBUG_INFO_BTF}" -a -n "${CONFIG_BPF}" ]; then
+       info BTFIDS vmlinux
+       ${RESOLVE_BTFIDS} vmlinux
 fi
 
 if [ -n "${CONFIG_BUILDTIME_TABLE_SORT}" ]; then