bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH bpf] samples/bpf: kbuild: add CONFIG_SAMPLE_BPF Kconfig
@ 2019-10-01 10:14 Björn Töpel
  2019-10-01 10:17 ` Björn Töpel
  2019-10-01 12:33 ` Masahiro Yamada
  0 siblings, 2 replies; 12+ messages in thread
From: Björn Töpel @ 2019-10-01 10:14 UTC (permalink / raw)
  To: netdev, ast, daniel
  Cc: Björn Töpel, linux-kbuild, bpf, yamada.masahiro

From: Björn Töpel <bjorn.topel@intel.com>

This commit makes it possible to build the BPF samples via a Kconfig
option, CONFIG_SAMPLE_BPF. Further, it fixes that samples/bpf/ could
not be built due to a missing samples/Makefile subdir-y entry, after
the introduction of commit 394053f4a4b3 ("kbuild: make single targets
work more correctly").

Signed-off-by: Björn Töpel <bjorn.topel@intel.com>
---
 samples/Kconfig  | 4 ++++
 samples/Makefile | 1 +
 2 files changed, 5 insertions(+)

diff --git a/samples/Kconfig b/samples/Kconfig
index c8dacb4dda80..054297ac89ad 100644
--- a/samples/Kconfig
+++ b/samples/Kconfig
@@ -169,4 +169,8 @@ config SAMPLE_VFS
 	  as mount API and statx().  Note that this is restricted to the x86
 	  arch whilst it accesses system calls that aren't yet in all arches.
 
+config SAMPLE_BPF
+	bool "BPF samples"
+	depends on HEADERS_INSTALL
+
 endif # SAMPLES
diff --git a/samples/Makefile b/samples/Makefile
index 7d6e4ca28d69..49aa2f7d044b 100644
--- a/samples/Makefile
+++ b/samples/Makefile
@@ -20,3 +20,4 @@ obj-$(CONFIG_SAMPLE_TRACE_PRINTK)	+= trace_printk/
 obj-$(CONFIG_VIDEO_PCI_SKELETON)	+= v4l/
 obj-y					+= vfio-mdev/
 subdir-$(CONFIG_SAMPLE_VFS)		+= vfs
+subdir-$(CONFIG_SAMPLE_BPF)		+= bpf
-- 
2.20.1


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

* Re: [PATCH bpf] samples/bpf: kbuild: add CONFIG_SAMPLE_BPF Kconfig
  2019-10-01 10:14 [PATCH bpf] samples/bpf: kbuild: add CONFIG_SAMPLE_BPF Kconfig Björn Töpel
@ 2019-10-01 10:17 ` Björn Töpel
  2019-10-01 12:33 ` Masahiro Yamada
  1 sibling, 0 replies; 12+ messages in thread
From: Björn Töpel @ 2019-10-01 10:17 UTC (permalink / raw)
  To: Netdev, Alexei Starovoitov, Daniel Borkmann
  Cc: Björn Töpel, linux-kbuild, bpf, yamada.masahiro

On Tue, 1 Oct 2019 at 12:14, Björn Töpel <bjorn.topel@gmail.com> wrote:
>
> From: Björn Töpel <bjorn.topel@intel.com>
>
> This commit makes it possible to build the BPF samples via a Kconfig
> option, CONFIG_SAMPLE_BPF. Further, it fixes that samples/bpf/ could
> not be built due to a missing samples/Makefile subdir-y entry, after
> the introduction of commit 394053f4a4b3 ("kbuild: make single targets
> work more correctly").
>
> Signed-off-by: Björn Töpel <bjorn.topel@intel.com>

I didn't add a Fixes:-tag for the kbuild commit above; The fix is a
fallout from the kbuild change.

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

* Re: [PATCH bpf] samples/bpf: kbuild: add CONFIG_SAMPLE_BPF Kconfig
  2019-10-01 10:14 [PATCH bpf] samples/bpf: kbuild: add CONFIG_SAMPLE_BPF Kconfig Björn Töpel
  2019-10-01 10:17 ` Björn Töpel
@ 2019-10-01 12:33 ` Masahiro Yamada
  2019-10-01 14:16   ` Björn Töpel
  1 sibling, 1 reply; 12+ messages in thread
From: Masahiro Yamada @ 2019-10-01 12:33 UTC (permalink / raw)
  To: Björn Töpel
  Cc: Networking, Alexei Starovoitov, Daniel Borkmann,
	Björn Töpel, Linux Kbuild mailing list, bpf

Hi Bjorn

On Tue, Oct 1, 2019 at 7:14 PM Björn Töpel <bjorn.topel@gmail.com> wrote:
>
> From: Björn Töpel <bjorn.topel@intel.com>
>
> This commit makes it possible to build the BPF samples via a Kconfig
> option, CONFIG_SAMPLE_BPF. Further, it fixes that samples/bpf/ could
> not be built due to a missing samples/Makefile subdir-y entry, after
> the introduction of commit 394053f4a4b3 ("kbuild: make single targets
> work more correctly").
>
> Signed-off-by: Björn Töpel <bjorn.topel@intel.com>
> ---
>  samples/Kconfig  | 4 ++++
>  samples/Makefile | 1 +
>  2 files changed, 5 insertions(+)
>
> diff --git a/samples/Kconfig b/samples/Kconfig
> index c8dacb4dda80..054297ac89ad 100644
> --- a/samples/Kconfig
> +++ b/samples/Kconfig
> @@ -169,4 +169,8 @@ config SAMPLE_VFS
>           as mount API and statx().  Note that this is restricted to the x86
>           arch whilst it accesses system calls that aren't yet in all arches.
>
> +config SAMPLE_BPF
> +       bool "BPF samples"
> +       depends on HEADERS_INSTALL
> +
>  endif # SAMPLES
> diff --git a/samples/Makefile b/samples/Makefile
> index 7d6e4ca28d69..49aa2f7d044b 100644
> --- a/samples/Makefile
> +++ b/samples/Makefile
> @@ -20,3 +20,4 @@ obj-$(CONFIG_SAMPLE_TRACE_PRINTK)     += trace_printk/
>  obj-$(CONFIG_VIDEO_PCI_SKELETON)       += v4l/
>  obj-y                                  += vfio-mdev/
>  subdir-$(CONFIG_SAMPLE_VFS)            += vfs
> +subdir-$(CONFIG_SAMPLE_BPF)            += bpf


Please keep samples/Makefile sorted alphabetically.




I am not checking samples/bpf/Makefile, but
allmodconfig no longer compiles for me.



samples/bpf/Makefile:209: WARNING: Detected possible issues with include path.
samples/bpf/Makefile:210: WARNING: Please install kernel headers
locally (make headers_install).
error: unable to create target: 'No available targets are compatible
with triple "bpf"'
1 error generated.
readelf: Error: './llvm_btf_verify.o': No such file
*** ERROR: LLVM (llc) does not support 'bpf' target
   NOTICE: LLVM version >= 3.7.1 required

-- 
Best Regards
Masahiro Yamada

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

* Re: [PATCH bpf] samples/bpf: kbuild: add CONFIG_SAMPLE_BPF Kconfig
  2019-10-01 12:33 ` Masahiro Yamada
@ 2019-10-01 14:16   ` Björn Töpel
  2019-10-02  1:48     ` Masahiro Yamada
  0 siblings, 1 reply; 12+ messages in thread
From: Björn Töpel @ 2019-10-01 14:16 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: Networking, Alexei Starovoitov, Daniel Borkmann,
	Björn Töpel, Linux Kbuild mailing list, bpf

On Tue, 1 Oct 2019 at 14:33, Masahiro Yamada
<yamada.masahiro@socionext.com> wrote:
>
> Hi Bjorn
>
> On Tue, Oct 1, 2019 at 7:14 PM Björn Töpel <bjorn.topel@gmail.com> wrote:
> >
[...]
> >  subdir-$(CONFIG_SAMPLE_VFS)            += vfs
> > +subdir-$(CONFIG_SAMPLE_BPF)            += bpf
>
>
> Please keep samples/Makefile sorted alphabetically.
>

Thank you, I'll address that in the v2!

>
>
>
> I am not checking samples/bpf/Makefile, but
> allmodconfig no longer compiles for me.
>
>
>
> samples/bpf/Makefile:209: WARNING: Detected possible issues with include path.
> samples/bpf/Makefile:210: WARNING: Please install kernel headers
> locally (make headers_install).
> error: unable to create target: 'No available targets are compatible
> with triple "bpf"'
> 1 error generated.
> readelf: Error: './llvm_btf_verify.o': No such file
> *** ERROR: LLVM (llc) does not support 'bpf' target
>    NOTICE: LLVM version >= 3.7.1 required
>

Yes, the BPF samples require clang/LLVM with BPF support to build. Any
suggestion on a good way to address this (missing tools), better than
the warning above? After the commit 394053f4a4b3 ("kbuild: make single
targets work more correctly"), it's no longer possible to build
samples/bpf without support in the samples/Makefile.


Thanks,
Björn

> --
> Best Regards
> Masahiro Yamada

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

* Re: [PATCH bpf] samples/bpf: kbuild: add CONFIG_SAMPLE_BPF Kconfig
  2019-10-01 14:16   ` Björn Töpel
@ 2019-10-02  1:48     ` Masahiro Yamada
  2019-10-02  7:41       ` Björn Töpel
  0 siblings, 1 reply; 12+ messages in thread
From: Masahiro Yamada @ 2019-10-02  1:48 UTC (permalink / raw)
  To: Björn Töpel
  Cc: Networking, Alexei Starovoitov, Daniel Borkmann,
	Björn Töpel, Linux Kbuild mailing list, bpf

On Tue, Oct 1, 2019 at 11:16 PM Björn Töpel <bjorn.topel@gmail.com> wrote:
>
> On Tue, 1 Oct 2019 at 14:33, Masahiro Yamada
> <yamada.masahiro@socionext.com> wrote:
> >
> > Hi Bjorn
> >
> > On Tue, Oct 1, 2019 at 7:14 PM Björn Töpel <bjorn.topel@gmail.com> wrote:
> > >
> [...]
> > >  subdir-$(CONFIG_SAMPLE_VFS)            += vfs
> > > +subdir-$(CONFIG_SAMPLE_BPF)            += bpf
> >
> >
> > Please keep samples/Makefile sorted alphabetically.
> >
>
> Thank you, I'll address that in the v2!
>
> >
> >
> >
> > I am not checking samples/bpf/Makefile, but
> > allmodconfig no longer compiles for me.
> >
> >
> >
> > samples/bpf/Makefile:209: WARNING: Detected possible issues with include path.
> > samples/bpf/Makefile:210: WARNING: Please install kernel headers
> > locally (make headers_install).
> > error: unable to create target: 'No available targets are compatible
> > with triple "bpf"'
> > 1 error generated.
> > readelf: Error: './llvm_btf_verify.o': No such file
> > *** ERROR: LLVM (llc) does not support 'bpf' target
> >    NOTICE: LLVM version >= 3.7.1 required
> >

So, samples/bpf intentionally opts out the normal build
because most of people fail to build it.

It must be fixed somehow
before supporting it in samples/Makefile.



> Yes, the BPF samples require clang/LLVM with BPF support to build. Any
> suggestion on a good way to address this (missing tools), better than
> the warning above? After the commit 394053f4a4b3 ("kbuild: make single
> targets work more correctly"), it's no longer possible to build
> samples/bpf without support in the samples/Makefile.


You can with

"make M=samples/bpf"



--
Best Regards
Masahiro Yamada

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

* Re: [PATCH bpf] samples/bpf: kbuild: add CONFIG_SAMPLE_BPF Kconfig
  2019-10-02  1:48     ` Masahiro Yamada
@ 2019-10-02  7:41       ` Björn Töpel
  2019-10-02 23:14         ` Ivan Khoronzhuk
  0 siblings, 1 reply; 12+ messages in thread
From: Björn Töpel @ 2019-10-02  7:41 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: Networking, Alexei Starovoitov, Daniel Borkmann,
	Björn Töpel, Linux Kbuild mailing list, bpf

On Wed, 2 Oct 2019 at 03:49, Masahiro Yamada
<yamada.masahiro@socionext.com> wrote:
>
[...]
> > Yes, the BPF samples require clang/LLVM with BPF support to build. Any
> > suggestion on a good way to address this (missing tools), better than
> > the warning above? After the commit 394053f4a4b3 ("kbuild: make single
> > targets work more correctly"), it's no longer possible to build
> > samples/bpf without support in the samples/Makefile.
>
>
> You can with
>
> "make M=samples/bpf"
>

Oh, I didn't know that. Does M= support "output" builds (O=)?

I usually just build samples/bpf/ with:

  $ make V=1 O=/home/foo/build/bleh samples/bpf/


Björn

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

* Re: [PATCH bpf] samples/bpf: kbuild: add CONFIG_SAMPLE_BPF Kconfig
  2019-10-02  7:41       ` Björn Töpel
@ 2019-10-02 23:14         ` Ivan Khoronzhuk
  2019-10-03  6:28           ` Björn Töpel
  0 siblings, 1 reply; 12+ messages in thread
From: Ivan Khoronzhuk @ 2019-10-02 23:14 UTC (permalink / raw)
  To: Björn Töpel
  Cc: Masahiro Yamada, Networking, Alexei Starovoitov, Daniel Borkmann,
	Björn Töpel, Linux Kbuild mailing list, bpf

On Wed, Oct 02, 2019 at 09:41:15AM +0200, Björn Töpel wrote:
>On Wed, 2 Oct 2019 at 03:49, Masahiro Yamada
><yamada.masahiro@socionext.com> wrote:
>>
>[...]
>> > Yes, the BPF samples require clang/LLVM with BPF support to build. Any
>> > suggestion on a good way to address this (missing tools), better than
>> > the warning above? After the commit 394053f4a4b3 ("kbuild: make single
>> > targets work more correctly"), it's no longer possible to build
>> > samples/bpf without support in the samples/Makefile.
>>
>>
>> You can with
>>
>> "make M=samples/bpf"
>>
>
>Oh, I didn't know that. Does M= support "output" builds (O=)?
>
>I usually just build samples/bpf/ with:
>
>  $ make V=1 O=/home/foo/build/bleh samples/bpf/
>
>
>Björn

Shouldn't README be updated?

-- 
Regards,
Ivan Khoronzhuk

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

* Re: [PATCH bpf] samples/bpf: kbuild: add CONFIG_SAMPLE_BPF Kconfig
  2019-10-02 23:14         ` Ivan Khoronzhuk
@ 2019-10-03  6:28           ` Björn Töpel
  2019-10-03 10:36             ` Masahiro Yamada
  0 siblings, 1 reply; 12+ messages in thread
From: Björn Töpel @ 2019-10-03  6:28 UTC (permalink / raw)
  To: Ivan Khoronzhuk
  Cc: Masahiro Yamada, Networking, Alexei Starovoitov, Daniel Borkmann,
	Björn Töpel, Linux Kbuild mailing list, bpf

On Thu, 3 Oct 2019 at 01:14, Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org> wrote:
>
> On Wed, Oct 02, 2019 at 09:41:15AM +0200, Björn Töpel wrote:
> >On Wed, 2 Oct 2019 at 03:49, Masahiro Yamada
> ><yamada.masahiro@socionext.com> wrote:
> >>
> >[...]
> >> > Yes, the BPF samples require clang/LLVM with BPF support to build. Any
> >> > suggestion on a good way to address this (missing tools), better than
> >> > the warning above? After the commit 394053f4a4b3 ("kbuild: make single
> >> > targets work more correctly"), it's no longer possible to build
> >> > samples/bpf without support in the samples/Makefile.
> >>
> >>
> >> You can with
> >>
> >> "make M=samples/bpf"
> >>
> >
> >Oh, I didn't know that. Does M= support "output" builds (O=)?
> >
> >I usually just build samples/bpf/ with:
> >
> >  $ make V=1 O=/home/foo/build/bleh samples/bpf/
> >
> >
> >Björn
>
> Shouldn't README be updated?
>

Hmm, the M= variant doesn't work at all for me. The build is still
broken for me. Maybe I'm missing anything obvious...


> --
> Regards,
> Ivan Khoronzhuk

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

* Re: [PATCH bpf] samples/bpf: kbuild: add CONFIG_SAMPLE_BPF Kconfig
  2019-10-03  6:28           ` Björn Töpel
@ 2019-10-03 10:36             ` Masahiro Yamada
  2019-10-03 10:50               ` Björn Töpel
  0 siblings, 1 reply; 12+ messages in thread
From: Masahiro Yamada @ 2019-10-03 10:36 UTC (permalink / raw)
  To: Björn Töpel
  Cc: Ivan Khoronzhuk, Networking, Alexei Starovoitov, Daniel Borkmann,
	Björn Töpel, Linux Kbuild mailing list, bpf

On Thu, Oct 3, 2019 at 3:28 PM Björn Töpel <bjorn.topel@gmail.com> wrote:
>
> On Thu, 3 Oct 2019 at 01:14, Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org> wrote:
> >
> > On Wed, Oct 02, 2019 at 09:41:15AM +0200, Björn Töpel wrote:
> > >On Wed, 2 Oct 2019 at 03:49, Masahiro Yamada
> > ><yamada.masahiro@socionext.com> wrote:
> > >>
> > >[...]
> > >> > Yes, the BPF samples require clang/LLVM with BPF support to build. Any
> > >> > suggestion on a good way to address this (missing tools), better than
> > >> > the warning above? After the commit 394053f4a4b3 ("kbuild: make single
> > >> > targets work more correctly"), it's no longer possible to build
> > >> > samples/bpf without support in the samples/Makefile.
> > >>
> > >>
> > >> You can with
> > >>
> > >> "make M=samples/bpf"
> > >>
> > >
> > >Oh, I didn't know that. Does M= support "output" builds (O=)?

No.
O= points to the output directory of vmlinux,
not of the external module.

You cannot put the build artifacts from samples/bpf/
in a separate directory.



> > >I usually just build samples/bpf/ with:
> > >
> > >  $ make V=1 O=/home/foo/build/bleh samples/bpf/
> > >
> > >
> > >Björn
> >
> > Shouldn't README be updated?
> >
>
> Hmm, the M= variant doesn't work at all for me. The build is still
> broken for me. Maybe I'm missing anything obvious...
>
>
> > --
> > Regards,
> > Ivan Khoronzhuk



-- 
Best Regards
Masahiro Yamada

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

* Re: [PATCH bpf] samples/bpf: kbuild: add CONFIG_SAMPLE_BPF Kconfig
  2019-10-03 10:36             ` Masahiro Yamada
@ 2019-10-03 10:50               ` Björn Töpel
  2019-10-03 17:16                 ` Andrii Nakryiko
  0 siblings, 1 reply; 12+ messages in thread
From: Björn Töpel @ 2019-10-03 10:50 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: Ivan Khoronzhuk, Networking, Alexei Starovoitov, Daniel Borkmann,
	Björn Töpel, Linux Kbuild mailing list, bpf

On Thu, 3 Oct 2019 at 12:37, Masahiro Yamada
<yamada.masahiro@socionext.com> wrote:
>
> On Thu, Oct 3, 2019 at 3:28 PM Björn Töpel <bjorn.topel@gmail.com> wrote:
> >
> > On Thu, 3 Oct 2019 at 01:14, Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org> wrote:
> > >
> > > On Wed, Oct 02, 2019 at 09:41:15AM +0200, Björn Töpel wrote:
> > > >On Wed, 2 Oct 2019 at 03:49, Masahiro Yamada
> > > ><yamada.masahiro@socionext.com> wrote:
> > > >>
> > > >[...]
> > > >> > Yes, the BPF samples require clang/LLVM with BPF support to build. Any
> > > >> > suggestion on a good way to address this (missing tools), better than
> > > >> > the warning above? After the commit 394053f4a4b3 ("kbuild: make single
> > > >> > targets work more correctly"), it's no longer possible to build
> > > >> > samples/bpf without support in the samples/Makefile.
> > > >>
> > > >>
> > > >> You can with
> > > >>
> > > >> "make M=samples/bpf"
> > > >>
> > > >
> > > >Oh, I didn't know that. Does M= support "output" builds (O=)?
>
> No.
> O= points to the output directory of vmlinux,
> not of the external module.
>
> You cannot put the build artifacts from samples/bpf/
> in a separate directory.
>

Hmm, I can't even get "make M=samples/bpf/" to build. Am I missing
something obvious?

Prior 394053f4a4b3 "make samples/bpf/" and "make O=/foo/bar
samples/bpf/" worked, but I guess I can live with that...


Thanks!
Björn


>
>
> > > >I usually just build samples/bpf/ with:
> > > >
> > > >  $ make V=1 O=/home/foo/build/bleh samples/bpf/
> > > >
> > > >
> > > >Björn
> > >
> > > Shouldn't README be updated?
> > >
> >
> > Hmm, the M= variant doesn't work at all for me. The build is still
> > broken for me. Maybe I'm missing anything obvious...
> >
> >
> > > --
> > > Regards,
> > > Ivan Khoronzhuk
>
>
>
> --
> Best Regards
> Masahiro Yamada

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

* Re: [PATCH bpf] samples/bpf: kbuild: add CONFIG_SAMPLE_BPF Kconfig
  2019-10-03 10:50               ` Björn Töpel
@ 2019-10-03 17:16                 ` Andrii Nakryiko
  2019-10-03 17:37                   ` Björn Töpel
  0 siblings, 1 reply; 12+ messages in thread
From: Andrii Nakryiko @ 2019-10-03 17:16 UTC (permalink / raw)
  To: Björn Töpel
  Cc: Masahiro Yamada, Ivan Khoronzhuk, Networking, Alexei Starovoitov,
	Daniel Borkmann, Björn Töpel,
	Linux Kbuild mailing list, bpf

On Thu, Oct 3, 2019 at 3:52 AM Björn Töpel <bjorn.topel@gmail.com> wrote:
>
> On Thu, 3 Oct 2019 at 12:37, Masahiro Yamada
> <yamada.masahiro@socionext.com> wrote:
> >
> > On Thu, Oct 3, 2019 at 3:28 PM Björn Töpel <bjorn.topel@gmail.com> wrote:
> > >
> > > On Thu, 3 Oct 2019 at 01:14, Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org> wrote:
> > > >
> > > > On Wed, Oct 02, 2019 at 09:41:15AM +0200, Björn Töpel wrote:
> > > > >On Wed, 2 Oct 2019 at 03:49, Masahiro Yamada
> > > > ><yamada.masahiro@socionext.com> wrote:
> > > > >>
> > > > >[...]
> > > > >> > Yes, the BPF samples require clang/LLVM with BPF support to build. Any
> > > > >> > suggestion on a good way to address this (missing tools), better than
> > > > >> > the warning above? After the commit 394053f4a4b3 ("kbuild: make single
> > > > >> > targets work more correctly"), it's no longer possible to build
> > > > >> > samples/bpf without support in the samples/Makefile.
> > > > >>
> > > > >>
> > > > >> You can with
> > > > >>
> > > > >> "make M=samples/bpf"
> > > > >>
> > > > >
> > > > >Oh, I didn't know that. Does M= support "output" builds (O=)?
> >
> > No.
> > O= points to the output directory of vmlinux,
> > not of the external module.
> >
> > You cannot put the build artifacts from samples/bpf/
> > in a separate directory.
> >
>
> Hmm, I can't even get "make M=samples/bpf/" to build. Am I missing
> something obvious?

There were 3 or 4 separate fixes submitted for samples/bpf yesterday,
maybe you are hitting some of those issues. Try to pull latest (not
sure if bpf or bpf-next tree). I tried make M=samples/bpf and it
worked for me.

>
> Prior 394053f4a4b3 "make samples/bpf/" and "make O=/foo/bar
> samples/bpf/" worked, but I guess I can live with that...
>
>
> Thanks!
> Björn
>
>
> >
> >
> > > > >I usually just build samples/bpf/ with:
> > > > >
> > > > >  $ make V=1 O=/home/foo/build/bleh samples/bpf/
> > > > >
> > > > >
> > > > >Björn
> > > >
> > > > Shouldn't README be updated?
> > > >
> > >
> > > Hmm, the M= variant doesn't work at all for me. The build is still
> > > broken for me. Maybe I'm missing anything obvious...
> > >
> > >
> > > > --
> > > > Regards,
> > > > Ivan Khoronzhuk
> >
> >
> >
> > --
> > Best Regards
> > Masahiro Yamada

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

* Re: [PATCH bpf] samples/bpf: kbuild: add CONFIG_SAMPLE_BPF Kconfig
  2019-10-03 17:16                 ` Andrii Nakryiko
@ 2019-10-03 17:37                   ` Björn Töpel
  0 siblings, 0 replies; 12+ messages in thread
From: Björn Töpel @ 2019-10-03 17:37 UTC (permalink / raw)
  To: Andrii Nakryiko
  Cc: Masahiro Yamada, Ivan Khoronzhuk, Networking, Alexei Starovoitov,
	Daniel Borkmann, Björn Töpel,
	Linux Kbuild mailing list, bpf

On Thu, 3 Oct 2019 at 19:16, Andrii Nakryiko <andrii.nakryiko@gmail.com> wrote:
>
> On Thu, Oct 3, 2019 at 3:52 AM Björn Töpel <bjorn.topel@gmail.com> wrote:
> >
> > On Thu, 3 Oct 2019 at 12:37, Masahiro Yamada
> > <yamada.masahiro@socionext.com> wrote:
> > >
> > > On Thu, Oct 3, 2019 at 3:28 PM Björn Töpel <bjorn.topel@gmail.com> wrote:
> > > >
> > > > On Thu, 3 Oct 2019 at 01:14, Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org> wrote:
> > > > >
> > > > > On Wed, Oct 02, 2019 at 09:41:15AM +0200, Björn Töpel wrote:
> > > > > >On Wed, 2 Oct 2019 at 03:49, Masahiro Yamada
> > > > > ><yamada.masahiro@socionext.com> wrote:
> > > > > >>
> > > > > >[...]
> > > > > >> > Yes, the BPF samples require clang/LLVM with BPF support to build. Any
> > > > > >> > suggestion on a good way to address this (missing tools), better than
> > > > > >> > the warning above? After the commit 394053f4a4b3 ("kbuild: make single
> > > > > >> > targets work more correctly"), it's no longer possible to build
> > > > > >> > samples/bpf without support in the samples/Makefile.
> > > > > >>
> > > > > >>
> > > > > >> You can with
> > > > > >>
> > > > > >> "make M=samples/bpf"
> > > > > >>
> > > > > >
> > > > > >Oh, I didn't know that. Does M= support "output" builds (O=)?
> > >
> > > No.
> > > O= points to the output directory of vmlinux,
> > > not of the external module.
> > >
> > > You cannot put the build artifacts from samples/bpf/
> > > in a separate directory.
> > >
> >
> > Hmm, I can't even get "make M=samples/bpf/" to build. Am I missing
> > something obvious?
>
> There were 3 or 4 separate fixes submitted for samples/bpf yesterday,
> maybe you are hitting some of those issues. Try to pull latest (not
> sure if bpf or bpf-next tree). I tried make M=samples/bpf and it
> worked for me.
>

Yeah, it was PEBKAC. "make M=samples/bpf" works if you have a proper
.config + "make prepare" ;-)

I guess I need to change my workflow. I build all my kernels "O=", and
did so with samples/bpf as well. Everything ended up in the same
output directory. Now I need to have all this build output in source
tree, and need to manage the .config files in where the source is at.
Oh well... I'll stop complaining now. :-)

Thanks,
Björn

> >
> > Prior 394053f4a4b3 "make samples/bpf/" and "make O=/foo/bar
> > samples/bpf/" worked, but I guess I can live with that...
> >
> >
> > Thanks!
> > Björn
> >
> >
> > >
> > >
> > > > > >I usually just build samples/bpf/ with:
> > > > > >
> > > > > >  $ make V=1 O=/home/foo/build/bleh samples/bpf/
> > > > > >
> > > > > >
> > > > > >Björn
> > > > >
> > > > > Shouldn't README be updated?
> > > > >
> > > >
> > > > Hmm, the M= variant doesn't work at all for me. The build is still
> > > > broken for me. Maybe I'm missing anything obvious...
> > > >
> > > >
> > > > > --
> > > > > Regards,
> > > > > Ivan Khoronzhuk
> > >
> > >
> > >
> > > --
> > > Best Regards
> > > Masahiro Yamada

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

end of thread, other threads:[~2019-10-03 17:38 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-01 10:14 [PATCH bpf] samples/bpf: kbuild: add CONFIG_SAMPLE_BPF Kconfig Björn Töpel
2019-10-01 10:17 ` Björn Töpel
2019-10-01 12:33 ` Masahiro Yamada
2019-10-01 14:16   ` Björn Töpel
2019-10-02  1:48     ` Masahiro Yamada
2019-10-02  7:41       ` Björn Töpel
2019-10-02 23:14         ` Ivan Khoronzhuk
2019-10-03  6:28           ` Björn Töpel
2019-10-03 10:36             ` Masahiro Yamada
2019-10-03 10:50               ` Björn Töpel
2019-10-03 17:16                 ` Andrii Nakryiko
2019-10-03 17:37                   ` Björn Töpel

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