Skip to content

Commit 017dab3

Browse files
olsajiriAlexei Starovoitov
authored and
Alexei Starovoitov
committed
bpf: Check CONFIG_BPF option for resolve_btfids
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 <[email protected]> Signed-off-by: Jiri Olsa <[email protected]> Signed-off-by: Alexei Starovoitov <[email protected]> Acked-by: Andrii Nakryiko <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
1 parent 0789e13 commit 017dab3

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1084,13 +1084,15 @@ ifdef CONFIG_STACK_VALIDATION
10841084
endif
10851085
endif
10861086

1087+
ifdef CONFIG_BPF
10871088
ifdef CONFIG_DEBUG_INFO_BTF
10881089
ifeq ($(has_libelf),1)
10891090
resolve_btfids_target := tools/bpf/resolve_btfids FORCE
10901091
else
10911092
ERROR_RESOLVE_BTFIDS := 1
10921093
endif
1093-
endif
1094+
endif # CONFIG_DEBUG_INFO_BTF
1095+
endif # CONFIG_BPF
10941096

10951097
PHONY += prepare0
10961098

scripts/link-vmlinux.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -341,9 +341,9 @@ fi
341341
vmlinux_link vmlinux "${kallsymso}" ${btf_vmlinux_bin_o}
342342

343343
# fill in BTF IDs
344-
if [ -n "${CONFIG_DEBUG_INFO_BTF}" ]; then
345-
info BTFIDS vmlinux
346-
${RESOLVE_BTFIDS} vmlinux
344+
if [ -n "${CONFIG_DEBUG_INFO_BTF}" -a -n "${CONFIG_BPF}" ]; then
345+
info BTFIDS vmlinux
346+
${RESOLVE_BTFIDS} vmlinux
347347
fi
348348

349349
if [ -n "${CONFIG_BUILDTIME_TABLE_SORT}" ]; then

0 commit comments

Comments
 (0)