bpf: Use --no-fail option if CONFIG_BPF is not enabled
Subsystems (4)
Jiri Olsa
reviewerPATCH v2 1/2 bpf: Use --no-fail option if CONFIG_BPF is not enabled
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.
---
v2 changes:
- disable resolve_btfids completely when CONFIG_BPF is not defined
Makefile | 4 +++- scripts/link-vmlinux.sh | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-)
Makefile +3 -1
@@ -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
scripts/link-vmlinux.sh +3 -3
@@ -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
Signature · 1 line
2.26.2
Jiri Olsa
reviewerPATCH v2 2/2 tools resolve_btfids: Always force HOSTARCH
Seth reported problem with cross builds, that fail on resolve_btfids build, because we are trying to build it on cross build arch.
Fixing this by always forcing the host arch.
--- tools/bpf/resolve_btfids/Makefile | 2 ++ 1 file changed, 2 insertions(+)
tools/bpf/resolve_btfids/Makefile +2 -0
@@ -1,5 +1,6 @@ # SPDX-License-Identifier: GPL-2.0-only include ../../scripts/Makefile.include +include ../../scripts/Makefile.arch ifeq ($(srctree),) srctree := $(patsubst %/,%,$(dir $(CURDIR)))
@@ -29,6 +30,7 @@ endif AR = $(HOSTAR) CC = $(HOSTCC) LD = $(HOSTLD) +ARCH = $(HOSTARCH) OUTPUT ?= $(srctree)/tools/bpf/resolve_btfids/
Signature · 1 line
2.26.2
Re: [PATCHv2 bpf-next 2/2] tools resolve_btfids: Always force HOSTARCH
Quoted 10 lines · Jiri Olsa
Seth reported problem with cross builds, that fail on
resolve_btfidsbuild, because we are trying to build it on cross build arch.Fixing this by always forcing the host arch.
Reported-by Seth Forshee <[email protected]>Signed-off-by Jiri Olsa <[email protected]>---
Quoted 25 lines
tools/bpf/resolve_btfids/Makefile | 2 ++ 1 file changed, 2 insertions(+)tools/bpf/resolve_btfids/Makefile +2
-1@@ -1,5 +1,6 @@ # SPDX-License-Identifier: GPL-2.0-only include ../../scripts/Makefile.include +include ../../scripts/Makefile.arch ifeq ($(srctree),) srctree := $(patsubst %/,%,$(dir $(CURDIR)))@@ -29,6 +30,7 @@ endif AR = $(HOSTAR) CC = $(HOSTCC) LD = $(HOSTLD) +ARCH = $(HOSTARCH) OUTPUT ?= $(srctree)/tools/bpf/resolve_btfids/ --2.26.2
Quoted 5 lines · Jiri Olsa
Currently all the
resolve_btfids'users' are underCONFIG_BPFcode, so if we haveCONFIG_BPFdisabled,resolve_btfidswill fail, because there's no data to resolve.
Quoted 8 lines
Disabling
resolve_btfidsif there'sCONFIG_BPFdisabled, so we won't fail such builds.Suggested-by Andrii Nakryiko <[email protected]>Signed-off-by Jiri Olsa <[email protected]>---
v2 changes:
- disableresolve_btfidscompletely whenCONFIG_BPFis not defined
[...]
Quoted 1 line · Andrii Nakryiko
On Wed, Sep 23, 2020 at 7:06 AM Jiri Olsa <[email protected]> wrote:
damn I'm blind this week.. will send v3 with proper subject :-\
jirka
Quoted 18 lines
Quoted 5 lines
Currently all the
resolve_btfids'users' are underCONFIG_BPFcode, so if we haveCONFIG_BPFdisabled,resolve_btfidswill fail, because there's no data to resolve.Quoted 8 lines
Disabling
resolve_btfidsif there'sCONFIG_BPFdisabled, so we won't fail such builds.Suggested-by Andrii Nakryiko <[email protected]>Signed-off-by Jiri Olsa <[email protected]>---
v2 changes:
- disableresolve_btfidscompletely whenCONFIG_BPFis not definedAcked-by Andrii Nakryiko <[email protected]>[...]