diff mbox series

[RFC,1/4] llvm: Add BPF backend

Message ID 20200929102618.28571-2-qais.yousef@arm.com
State Changes Requested
Headers show
Series add BCC and bpftrace packages | expand

Commit Message

Qais Yousef Sept. 29, 2020, 10:26 a.m. UTC
We need BPF backend to enable BPF Compiler Collection (BCC) and bpftrace
packager in later commits.

Signed-off-by: Qais Yousef <qais.yousef@arm.com>
---
 package/llvm/Config.in | 6 ++++++
 package/llvm/llvm.mk   | 5 +++++
 2 files changed, 11 insertions(+)

Comments

Romain Naour Sept. 29, 2020, 7:35 p.m. UTC | #1
Hello Qais,

Le 29/09/2020 à 12:26, Qais Yousef a écrit :
> We need BPF backend to enable BPF Compiler Collection (BCC) and bpftrace
> packager in later commits.
> 
> Signed-off-by: Qais Yousef <qais.yousef@arm.com>

There is already a pending patch to review enabling BPF backend in llvm.
http://patchwork.ozlabs.org/project/buildroot/patch/20200824181740.12878-1-jugurtha.belkalem@smile.fr/

Your patch appears to be the same as the one we published with Jugurtha.
You are welcome to review and tests patches available from patchwork, see the
manual: http://nightly.buildroot.org/manual.html#_reviewing_and_testing_patches

The bcc patch series is present in patchwork since a long time due to lack of
review, see the first submission back in January 2019:
http://patchwork.ozlabs.org/project/buildroot/patch/20190113212118.14512-1-romain.naour@gmail.com/

So, Your help to review is really important :)

Best regards,
Romain

> ---
>  package/llvm/Config.in | 6 ++++++
>  package/llvm/llvm.mk   | 5 +++++
>  2 files changed, 11 insertions(+)
> 
> diff --git a/package/llvm/Config.in b/package/llvm/Config.in
> index 1d21d879da..22d51b4e3c 100644
> --- a/package/llvm/Config.in
> +++ b/package/llvm/Config.in
> @@ -34,6 +34,12 @@ config BR2_PACKAGE_LLVM_AMDGPU
>  	  Build AMDGPU target. Select this option if you are going
>  	  to install mesa3d with llvm and use Gallium Radeon driver.
>  
> +config BR2_PACKAGE_LLVM_BPF
> +	bool "BPF backend"
> +	help
> +	  Build BPF target. Select this option if you want to use BPF tools
> +	  like BCC on the target.
> +
>  config BR2_PACKAGE_LLVM_RTTI
>  	bool "enable rtti"
>  	help
> diff --git a/package/llvm/llvm.mk b/package/llvm/llvm.mk
> index 24d033d124..48a298191c 100644
> --- a/package/llvm/llvm.mk
> +++ b/package/llvm/llvm.mk
> @@ -61,6 +61,11 @@ ifeq ($(BR2_PACKAGE_LLVM_AMDGPU),y)
>  LLVM_TARGETS_TO_BUILD += AMDGPU
>  endif
>  
> +# Build BPF backend
> +ifeq ($(BR2_PACKAGE_LLVM_BPF),y)
> +LLVM_TARGETS_TO_BUILD += BPF
> +endif
> +
>  # Use native llvm-tblgen from host-llvm (needed for cross-compilation)
>  LLVM_CONF_OPTS += -DLLVM_TABLEGEN=$(HOST_DIR)/bin/llvm-tblgen
>  
>
Qais Yousef Sept. 30, 2020, 2:38 p.m. UTC | #2
Hi Romain

On 09/29/20 21:35, Romain Naour wrote:
> Hello Qais,
> 
> Le 29/09/2020 à 12:26, Qais Yousef a écrit :
> > We need BPF backend to enable BPF Compiler Collection (BCC) and bpftrace
> > packager in later commits.
> > 
> > Signed-off-by: Qais Yousef <qais.yousef@arm.com>
> 
> There is already a pending patch to review enabling BPF backend in llvm.
> http://patchwork.ozlabs.org/project/buildroot/patch/20200824181740.12878-1-jugurtha.belkalem@smile.fr/
> 
> Your patch appears to be the same as the one we published with Jugurtha.
> You are welcome to review and tests patches available from patchwork, see the
> manual: http://nightly.buildroot.org/manual.html#_reviewing_and_testing_patches
> 
> The bcc patch series is present in patchwork since a long time due to lack of
> review, see the first submission back in January 2019:
> http://patchwork.ozlabs.org/project/buildroot/patch/20190113212118.14512-1-romain.naour@gmail.com/
> 
> So, Your help to review is really important :)

Yes sure. I actually picked it up and applied and managed to build it and test
for x86_64 and aach64 (little endian) on qemu. I had to apply the weird fix in
patch 4. And remove the dependency on compiling the kernel in buildroot as
I compile my own kernels. It did work :)

I'll add these comments to the patch once I figure out how I can comment.
I hope I don't have to create a patchwork account for this. Hopefully I can
use the message-id to respond via email.

Thanks

--
Qais Yousef

> 
> Best regards,
> Romain
> 
> > ---
> >  package/llvm/Config.in | 6 ++++++
> >  package/llvm/llvm.mk   | 5 +++++
> >  2 files changed, 11 insertions(+)
> > 
> > diff --git a/package/llvm/Config.in b/package/llvm/Config.in
> > index 1d21d879da..22d51b4e3c 100644
> > --- a/package/llvm/Config.in
> > +++ b/package/llvm/Config.in
> > @@ -34,6 +34,12 @@ config BR2_PACKAGE_LLVM_AMDGPU
> >  	  Build AMDGPU target. Select this option if you are going
> >  	  to install mesa3d with llvm and use Gallium Radeon driver.
> >  
> > +config BR2_PACKAGE_LLVM_BPF
> > +	bool "BPF backend"
> > +	help
> > +	  Build BPF target. Select this option if you want to use BPF tools
> > +	  like BCC on the target.
> > +
> >  config BR2_PACKAGE_LLVM_RTTI
> >  	bool "enable rtti"
> >  	help
> > diff --git a/package/llvm/llvm.mk b/package/llvm/llvm.mk
> > index 24d033d124..48a298191c 100644
> > --- a/package/llvm/llvm.mk
> > +++ b/package/llvm/llvm.mk
> > @@ -61,6 +61,11 @@ ifeq ($(BR2_PACKAGE_LLVM_AMDGPU),y)
> >  LLVM_TARGETS_TO_BUILD += AMDGPU
> >  endif
> >  
> > +# Build BPF backend
> > +ifeq ($(BR2_PACKAGE_LLVM_BPF),y)
> > +LLVM_TARGETS_TO_BUILD += BPF
> > +endif
> > +
> >  # Use native llvm-tblgen from host-llvm (needed for cross-compilation)
> >  LLVM_CONF_OPTS += -DLLVM_TABLEGEN=$(HOST_DIR)/bin/llvm-tblgen
> >  
> > 
>
diff mbox series

Patch

diff --git a/package/llvm/Config.in b/package/llvm/Config.in
index 1d21d879da..22d51b4e3c 100644
--- a/package/llvm/Config.in
+++ b/package/llvm/Config.in
@@ -34,6 +34,12 @@  config BR2_PACKAGE_LLVM_AMDGPU
 	  Build AMDGPU target. Select this option if you are going
 	  to install mesa3d with llvm and use Gallium Radeon driver.
 
+config BR2_PACKAGE_LLVM_BPF
+	bool "BPF backend"
+	help
+	  Build BPF target. Select this option if you want to use BPF tools
+	  like BCC on the target.
+
 config BR2_PACKAGE_LLVM_RTTI
 	bool "enable rtti"
 	help
diff --git a/package/llvm/llvm.mk b/package/llvm/llvm.mk
index 24d033d124..48a298191c 100644
--- a/package/llvm/llvm.mk
+++ b/package/llvm/llvm.mk
@@ -61,6 +61,11 @@  ifeq ($(BR2_PACKAGE_LLVM_AMDGPU),y)
 LLVM_TARGETS_TO_BUILD += AMDGPU
 endif
 
+# Build BPF backend
+ifeq ($(BR2_PACKAGE_LLVM_BPF),y)
+LLVM_TARGETS_TO_BUILD += BPF
+endif
+
 # Use native llvm-tblgen from host-llvm (needed for cross-compilation)
 LLVM_CONF_OPTS += -DLLVM_TABLEGEN=$(HOST_DIR)/bin/llvm-tblgen