bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCHv2 bpf-next 1/2] bpf: Use --no-fail option if CONFIG_BPF is not enabled
@ 2020-09-23 14:04 Jiri Olsa
  2020-09-23 14:04 ` [PATCHv2 bpf-next 2/2] tools resolve_btfids: Always force HOSTARCH Jiri Olsa
  2020-09-23 16:09 ` [PATCHv2 bpf-next 1/2] bpf: Use --no-fail option if CONFIG_BPF is not enabled Andrii Nakryiko
  0 siblings, 2 replies; 5+ messages in thread
From: Jiri Olsa @ 2020-09-23 14:04 UTC (permalink / raw)
  To: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko
  Cc: netdev, bpf, Martin KaFai Lau, Song Liu, Yonghong Song,
	John Fastabend, KP Singh, Seth Forshee

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>
---
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(-)

diff --git a/Makefile b/Makefile
index c4470a4e131f..b05682eea2c0 100644
--- 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
 
diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh
index e6e2d9e5ff48..dbde59d343b1 100755
--- a/scripts/link-vmlinux.sh
+++ b/scripts/link-vmlinux.sh
@@ -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
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCHv2 bpf-next 2/2] tools resolve_btfids: Always force HOSTARCH
  2020-09-23 14:04 [PATCHv2 bpf-next 1/2] bpf: Use --no-fail option if CONFIG_BPF is not enabled Jiri Olsa
@ 2020-09-23 14:04 ` Jiri Olsa
  2020-09-23 16:08   ` Andrii Nakryiko
  2020-09-23 16:09 ` [PATCHv2 bpf-next 1/2] bpf: Use --no-fail option if CONFIG_BPF is not enabled Andrii Nakryiko
  1 sibling, 1 reply; 5+ messages in thread
From: Jiri Olsa @ 2020-09-23 14:04 UTC (permalink / raw)
  To: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko
  Cc: Seth Forshee, netdev, bpf, Martin KaFai Lau, Song Liu,
	Yonghong Song, John Fastabend, KP Singh

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.

Reported-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
 tools/bpf/resolve_btfids/Makefile | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/bpf/resolve_btfids/Makefile b/tools/bpf/resolve_btfids/Makefile
index a88cd4426398..d3c818b8d8d3 100644
--- a/tools/bpf/resolve_btfids/Makefile
+++ b/tools/bpf/resolve_btfids/Makefile
@@ -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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCHv2 bpf-next 2/2] tools resolve_btfids: Always force HOSTARCH
  2020-09-23 14:04 ` [PATCHv2 bpf-next 2/2] tools resolve_btfids: Always force HOSTARCH Jiri Olsa
@ 2020-09-23 16:08   ` Andrii Nakryiko
  0 siblings, 0 replies; 5+ messages in thread
From: Andrii Nakryiko @ 2020-09-23 16:08 UTC (permalink / raw)
  To: Jiri Olsa
  Cc: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
	Seth Forshee, Networking, bpf, Martin KaFai Lau, Song Liu,
	Yonghong Song, John Fastabend, KP Singh

On Wed, Sep 23, 2020 at 7:06 AM Jiri Olsa <jolsa@kernel.org> wrote:
>
> 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.
>
> Reported-by: Seth Forshee <seth.forshee@canonical.com>
> Signed-off-by: Jiri Olsa <jolsa@kernel.org>
> ---

Acked-by: Andrii Nakryiko <andriin@fb.com>

>  tools/bpf/resolve_btfids/Makefile | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/tools/bpf/resolve_btfids/Makefile b/tools/bpf/resolve_btfids/Makefile
> index a88cd4426398..d3c818b8d8d3 100644
> --- a/tools/bpf/resolve_btfids/Makefile
> +++ b/tools/bpf/resolve_btfids/Makefile
> @@ -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
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCHv2 bpf-next 1/2] bpf: Use --no-fail option if CONFIG_BPF is not enabled
  2020-09-23 14:04 [PATCHv2 bpf-next 1/2] bpf: Use --no-fail option if CONFIG_BPF is not enabled Jiri Olsa
  2020-09-23 14:04 ` [PATCHv2 bpf-next 2/2] tools resolve_btfids: Always force HOSTARCH Jiri Olsa
@ 2020-09-23 16:09 ` Andrii Nakryiko
  2020-09-23 18:47   ` Jiri Olsa
  1 sibling, 1 reply; 5+ messages in thread
From: Andrii Nakryiko @ 2020-09-23 16:09 UTC (permalink / raw)
  To: Jiri Olsa
  Cc: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko, Networking,
	bpf, Martin KaFai Lau, Song Liu, Yonghong Song, John Fastabend,
	KP Singh, Seth Forshee

On Wed, Sep 23, 2020 at 7:06 AM Jiri Olsa <jolsa@kernel.org> wrote:
>
> 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>
> ---
> v2 changes:
>   - disable resolve_btfids completely when CONFIG_BPF is not defined

Acked-by: Andrii Nakryiko <andriin@fb.com>

[...]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCHv2 bpf-next 1/2] bpf: Use --no-fail option if CONFIG_BPF is not enabled
  2020-09-23 16:09 ` [PATCHv2 bpf-next 1/2] bpf: Use --no-fail option if CONFIG_BPF is not enabled Andrii Nakryiko
@ 2020-09-23 18:47   ` Jiri Olsa
  0 siblings, 0 replies; 5+ messages in thread
From: Jiri Olsa @ 2020-09-23 18:47 UTC (permalink / raw)
  To: Andrii Nakryiko
  Cc: Jiri Olsa, Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko,
	Networking, bpf, Martin KaFai Lau, Song Liu, Yonghong Song,
	John Fastabend, KP Singh, Seth Forshee

On Wed, Sep 23, 2020 at 09:09:17AM -0700, Andrii Nakryiko wrote:
> On Wed, Sep 23, 2020 at 7:06 AM Jiri Olsa <jolsa@kernel.org> wrote:

damn I'm blind this week.. will send v3 with proper subject :-\

jirka

> >
> > 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>
> > ---
> > v2 changes:
> >   - disable resolve_btfids completely when CONFIG_BPF is not defined
> 
> Acked-by: Andrii Nakryiko <andriin@fb.com>
> 
> [...]
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-09-23 18:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-23 14:04 [PATCHv2 bpf-next 1/2] bpf: Use --no-fail option if CONFIG_BPF is not enabled Jiri Olsa
2020-09-23 14:04 ` [PATCHv2 bpf-next 2/2] tools resolve_btfids: Always force HOSTARCH Jiri Olsa
2020-09-23 16:08   ` Andrii Nakryiko
2020-09-23 16:09 ` [PATCHv2 bpf-next 1/2] bpf: Use --no-fail option if CONFIG_BPF is not enabled Andrii Nakryiko
2020-09-23 18:47   ` Jiri Olsa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).