Skip to contentSkip to conversation

Fix sysdig build errors

RFC PATCH In review Francis Laniel 2 participants 7 messages Apr 7, 2022 – Apr 11, 2022

lore
Share & tools
lore
#0 lore raw

cover Fix sysdig build errors

Hi.

First of all, I hope you are fine and the same for your relatives.

When building a system with recent kernel with BR2_PACKAGE_SYSDIG, I got some
compilation errors when building sysdig libsinsp:
.../sysdig-0.23.1/userspace/libsinsp/chisel.cpp:99:30: error: elements of array ‘const luaL_reg ll_sysdig []’ have incomplete type
99 | const static struct luaL_reg ll_sysdig [] =
After that, an error when building modules occurs:
.../sysdig-0.23.1/driver/ppm.h:62:18: error: field ‘last_print_time’ has incomplete type
62 | struct timespec last_print_time;
And finally an error during link time occurs:
.../sysdig-0.23.1/userspace/libsinsp.a(cri.grpc.pb.cc.o): undefined reference to symbol '_ZN4absl12lts_202103245MutexD1Ev'

Concerning the error in libsinsp, a patch was added to sysdig recipe. This patch is based on Minikube patch, which is in turn based on sysdig CMakeLists.txt PATCH_COMMAND [1, 2].
The modules errors were fixed upstream, so I bumped sysdig version to 0.27.1 [3, 4].
For the linking one, a patch already exist to fix this buggy behavior [5].

Sysdig 0.27.1 relies on tbb, so a recipe for this library was added. Note that, this recipe was originally written by Bradford Barr and I just bumped its version to suit sysdig case [6].

With the two patches applied, I was able to build and boot an image within qemu:

$ make qemu_x86_64_defconfig
$ make menuconfig
# Set glibc as library, enable c++, enable luajit and enable sysdig.
$ make linux-menuconfig
# Enable FTRACE
$ make -j$(nproc)
...
$ bash start-qemu.sh
...
Welcome to Buildroot
buildroot login: root
# insmod /lib/modules/5.15.18/extra/sysdig-probe.ko
sysdig_probe: loading out-of-tree module taints kernel.
sysdig_probe: driver loading, sysdig-probe 0.1.1dev
# sysdig --version
sysdig version 0.1.1dev

If you see any way to improve this contribution, feel free to share it!

Francis Laniel (1):
package/sysdig: bump version to 0.27.1.

bradford barr (1):
tbb: new package

 DEVELOPERS                                    |  1 +
 package/Config.in                             |  1 +
 ...ATCH_COMMAND-to-fix-lua-types-and-fu.patch | 82 +++++++++++++++++++
 ...gainst-libabseil-cpp-which-grpc-uses.patch | 45 ++++++++++
 package/sysdig/Config.in                      |  5 ++
 package/sysdig/sysdig.hash                    |  1 +
 package/sysdig/sysdig.mk                      |  7 +-
 .../0001-tbb-Enable-cross-compilation.patch   | 55 +++++++++++++
 package/tbb/Config.in                         | 16 ++++
 package/tbb/tbb.hash                          |  2 +
 package/tbb/tbb.mk                            | 39 +++++++++
 11 files changed, 253 insertions(+), 1 deletion(-)
 create mode 100644 package/sysdig/0001-libsinsp-Apply-PATCH_COMMAND-to-fix-lua-types-and-fu.patch
 create mode 100644 package/sysdig/0002-Link-against-libabseil-cpp-which-grpc-uses.patch
 create mode 100644 package/tbb/0001-tbb-Enable-cross-compilation.patch
 create mode 100644 package/tbb/Config.in
 create mode 100644 package/tbb/tbb.hash
 create mode 100644 package/tbb/tbb.mk

Best regards and thank you in advance for your reviews.

P.S.: If you are interested, this bug was spotted while trying to bump Minikube kernel to 5.10.57 [7].

---
[1] https://github.com/kubernetes/minikube/commit/f036c279bc598cf59affb0fc538c017d83afb7ab
[2] https://github.com/draios/sysdig/commit/a064440394c93a7579dc6e1db13c8378d5eecd6f
[3] https://github.com/draios/sysdig/commit/938986890291c126f9b8f3a050bc3edc95fb6f5a
[4] https://github.com/draios/sysdig/commit/2691cbc66c7faa973333d65a69909be06be21c18
[5] https://github.com/hhoffstaette/portage/blob/8d047247719a15c5a63001f65ba348514706277d/dev-util/sysdig/files/0.27.1-grpc-absl-sync.patch
[6] https://patchwork.ozlabs.org/project/buildroot/patch/[email protected]/
[7] https://github.com/kubernetes/minikube/pull/12707

Signature · 5 lines
2.25.1
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

RFC PATCH 1/2 tbb: new package

From: bradford barr <[email protected]>

Intel Threading Building Blocks (TBB), is a C++ library to help developers write highly parallelized applications. OpenCV uses it to accelerate some of it's more heavy weight procedures.

---
 DEVELOPERS                                    |  1 +
 package/Config.in                             |  1 +
 .../0001-tbb-Enable-cross-compilation.patch   | 55 +++++++++++++++++++
 package/tbb/Config.in                         | 16 ++++++
 package/tbb/tbb.hash                          |  2 +
 package/tbb/tbb.mk                            | 39 +++++++++++++
 6 files changed, 114 insertions(+)
 create mode 100644 package/tbb/0001-tbb-Enable-cross-compilation.patch
 create mode 100644 package/tbb/Config.in
 create mode 100644 package/tbb/tbb.hash
 create mode 100644 package/tbb/tbb.mk
DEVELOPERS +1 -0
index a66b9d7eee..ef4ddcab50 100644
@@ -970,6 +970,7 @@ F:	package/odhcploc/
 
 N:	Francis Laniel <[email protected]>
 F:	package/pahole/
+F:	package/tbb/
 
 N:	Francisco Gonzalez <[email protected]>
 F:	package/ser2net/
package/Config.in +1 -0
index 0d5d763180..24f7af5ea8 100644
@@ -2044,6 +2044,7 @@ endif
 	source "package/skalibs/Config.in"
 	source "package/sphinxbase/Config.in"
 	source "package/startup-notification/Config.in"
+	source "package/tbb/Config.in"
 	source "package/tinycbor/Config.in"
 	source "package/tz/Config.in"
 	source "package/tzdata/Config.in"
package/tbb/0001-tbb-Enable-cross-compilation.patch new file +55 -0

55 lines not on this page · raw message

package/tbb/Config.in new file +16 -0
new file mode 100644
index 0000000000..0f40b74d31
@@ -0,0 +1,16 @@
+config BR2_PACKAGE_TBB
+	bool "tbb"
+	depends on BR2_TOOLCHAIN_USES_GLIBC
+	depends on !BR2_STATIC_LIBS
+	depends on BR2_TOOLCHAIN_HAS_THREADS
+	depends on BR2_INSTALL_LIBSTDCPP
+	help
+	  Intel(R) Threading Building Blocks (Intel(R) TBB) lets you
+	  easily write parallel C++ programs that take full advantage
+	  of multicore performance, that are portable, composable and
+	  have future-proof scalability.
+
+	  https://www.threadingbuildingblocks.org/
+
+comment "tbb needs a glibc toolchain w/ dynamic library, threads, C++"
+	depends on !BR2_TOOLCHAIN_USES_GLIBC || BR2_STATIC_LIBS || !BR2_TOOLCHAIN_HAS_THREADS || !BR2_INSTALL_LIBSTDCPP
package/tbb/tbb.hash new file +2 -0
new file mode 100644
index 0000000000..e9fb7511b8
@@ -0,0 +1,2 @@
+# Locally calculated
+sha256  b8dbab5aea2b70cf07844f86fa413e549e099aa3205b6a04059ca92ead93a372  tbb-2018_U5.tar.gz
package/tbb/tbb.mk new file +39 -0
new file mode 100644
index 0000000000..cf06579b98
@@ -0,0 +1,39 @@
+################################################################################
+#
+# tbb
+#
+################################################################################
+
+TBB_VERSION = 2018_U5
+TBB_SITE = $(call github,01org,tbb,$(TBB_VERSION))
+TBB_INSTALL_STAGING = YES
+TBB_LICENSE = Apache-2.0
+TBB_LICENSE_FILES = LICENSE
+
+TBB_SO_VERSION = 2
+TBB_LIBS = libtbb libtbbmalloc libtbbmalloc_proxy
+TBB_BIN_PATH = $(@D)/build/linux_*
+
+define TBB_BUILD_CMDS
+	$(MAKE) $(TARGET_CONFIGURE_OPTS) arch=$(BR2_ARCH) -C $(@D)
+endef
+
+define TBB_INSTALL_LIBS
+	$(foreach lib,$(TBB_LIBS),
+		$(INSTALL) -D -m 0755 $(TBB_BIN_PATH)/$(lib).so.$(TBB_SO_VERSION) \
+			$(1)/usr/lib/$(lib).so.$(TBB_SO_VERSION) ;
+		ln -sf $(lib).so.$(TBB_SO_VERSION) $(1)/usr/lib/$(lib).so
+	)
+endef
+
+define TBB_INSTALL_STAGING_CMDS
+	mkdir -p $(STAGING_DIR)/usr/include/
+	cp -a $(@D)/include/* $(STAGING_DIR)/usr/include/
+	$(call TBB_INSTALL_LIBS,$(STAGING_DIR))
+endef
+
+define TBB_INSTALL_TARGET_CMDS
+	$(call TBB_INSTALL_LIBS,$(TARGET_DIR))
+endef
+
+$(eval $(generic-package))
Signature · 6 lines
2.25.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw

Re: [Buildroot] [RFC PATCH v1 1/2] tbb: new package

Hi Francis,

Thank you for this patch. I applied to master but with quite a few changes.

Quoted 74 lines · Francis Laniel

From: bradford barr <[email protected]>

Intel Threading Building Blocks (TBB), is a C++ library to help developers write highly parallelized applications. OpenCV uses it to accelerate some of it's more heavy weight procedures.

---
  DEVELOPERS                                    |  1 +
  package/Config.in                             |  1 +
  .../0001-tbb-Enable-cross-compilation.patch   | 55 +++++++++++++++++++
  package/tbb/Config.in                         | 16 ++++++
  package/tbb/tbb.hash                          |  2 +
  package/tbb/tbb.mk                            | 39 +++++++++++++
  6 files changed, 114 insertions(+)

create mode 100644 package/tbb/0001-tbb-Enable-cross-compilation.patch create mode 100644 package/tbb/Config.in
create mode 100644 package/tbb/tbb.hash
create mode 100644 package/tbb/tbb.mk

DEVELOPERS +1 -0
index a66b9d7eee..ef4ddcab50 100644
@@ -970,6 +970,7 @@ F:	package/odhcploc/
 
  N:	Francis Laniel <[email protected]>
  F:	package/pahole/
+F:	package/tbb/
 
  N:	Francisco Gonzalez <[email protected]>
  F:	package/ser2net/
package/Config.in +1 -0
index 0d5d763180..24f7af5ea8 100644
@@ -2044,6 +2044,7 @@ endif
  	source "package/skalibs/Config.in"
  	source "package/sphinxbase/Config.in"
  	source "package/startup-notification/Config.in"
+	source "package/tbb/Config.in"
  	source "package/tinycbor/Config.in"
  	source "package/tz/Config.in"
  	source "package/tzdata/Config.in"
package/tbb/0001-tbb-Enable-cross-compilation.patch new file +23 -0
new file mode 100644
index 0000000000..652d59c47b
@@ -0,0 +1,55 @@
+From 42c3faff14917f687aab405d8f571e352ffdf3f5 Mon Sep 17 00:00:00 2001
+From: Francis Laniel <[email protected]>
+Date: Wed, 6 Apr 2022 15:58:02 +0100
+Subject: [PATCH] tbb: Enable cross-compilation.
+
+This patch replaces hardcoded value for CPLUS and CONLY with $(CXX) and $(CC).
+So, by defining CC= it is possible to cross compile this library using a
+cross-compiler.
+
+This patch was originally written by:
+Marcin Juszkiewicz <[email protected]>
+and taken from:
+https://github.com/intel/luv-yocto/blob/3b0688bc9a5e8d52b6ca461b15fb4abd3eaaf7a8/meta-oe/recipes-support/tbb/tbb/cross-compile.patch
+
+Signed-off-by: Francis Laniel <[email protected]>
+---
+ build/linux.clang.inc | 5 +++--
+ build/linux.gcc.inc   | 5 +++--
+ 2 files changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/build/linux.clang.inc b/build/linux.clang.inc
+index 5a459ef5..a0777db5 100644
+--- a/build/linux.clang.inc

package/tbb/0001-tbb-Enable-cross-compilation.patch line 33

Quoted 10 lines
package/tbb/0001-tbb-Enable-cross-compilation.patch new file +10 -0
++++ b/build/linux.clang.inc
+@@ -31,8 +31,9 @@ DYLIB_KEY = -shared
+ EXPORT_KEY = -Wl,--version-script,
+ LIBDL = -ldl
+
+-CPLUS = clang++
+-CONLY = clang
++CPLUS = $(CXX)
++CONLY = $(CC)
++CPLUS_FLAGS = $(CXXFLAGS)

I dropped this patch. Instead, I simply passed CPLUS, CONLY and CPLUS_FLAGS in
the $(MAKE) call.

Quoted 50 lines
package/tbb/0001-tbb-Enable-cross-compilation.patch new file +22 -0
+ LIB_LINK_FLAGS = $(DYLIB_KEY) -Wl,-soname=$(BUILDING_LIBRARY)
+ LIBS += -lpthread -lrt
+ LINK_FLAGS = -Wl,-rpath-link=. -rdynamic
+diff --git a/build/linux.gcc.inc b/build/linux.gcc.inc
+index 786c4153..30242a82 100644
+--- a/build/linux.gcc.inc
++++ b/build/linux.gcc.inc
+@@ -32,8 +32,9 @@ DYLIB_KEY = -shared
+ EXPORT_KEY = -Wl,--version-script,
+ LIBDL = -ldl
+
+-CPLUS = g++
+-CONLY = gcc
++CPLUS = $(CXX)
++CONLY = $(CC)
++CPLUS_FLAGS = $(CXXFLAGS)
+ LIB_LINK_FLAGS = $(DYLIB_KEY) -Wl,-soname=$(BUILDING_LIBRARY)
+ LIBS += -lpthread -lrt
+ LINK_FLAGS = -Wl,-rpath-link=. -rdynamic
+--
+2.25.1
+
package/tbb/Config.in new file +16 -0
new file mode 100644
index 0000000000..0f40b74d31
@@ -0,0 +1,16 @@
+config BR2_PACKAGE_TBB
+	bool "tbb"
+	depends on BR2_TOOLCHAIN_USES_GLIBC
+	depends on !BR2_STATIC_LIBS
+	depends on BR2_TOOLCHAIN_HAS_THREADS
+	depends on BR2_INSTALL_LIBSTDCPP
+	help
+	  Intel(R) Threading Building Blocks (Intel(R) TBB) lets you
+	  easily write parallel C++ programs that take full advantage
+	  of multicore performance, that are portable, composable and
+	  have future-proof scalability.
+
+	  https://www.threadingbuildingblocks.org/
+
+comment "tbb needs a glibc toolchain w/ dynamic library, threads, C++"
+	depends on !BR2_TOOLCHAIN_USES_GLIBC || BR2_STATIC_LIBS || !BR2_TOOLCHAIN_HAS_THREADS || !BR2_INSTALL_LIBSTDCPP
package/tbb/tbb.hash new file +0 -0
new file mode 100644
index 0000000000..e9fb7511b8

package/tbb/tbb.hash line 2

Quoted 2 lines
package/tbb/tbb.hash new file +2 -0
@@ -0,0 +1,2 @@
+# Locally calculated
+sha256  b8dbab5aea2b70cf07844f86fa413e549e099aa3205b6a04059ca92ead93a372  tbb-2018_U5.tar.gz

You also need to include a hash for the license file.

Quoted 14 lines
package/tbb/tbb.mk new file +8 -0
new file mode 100644
index 0000000000..cf06579b98
@@ -0,0 +1,39 @@
+################################################################################
+#
+# tbb
+#
+################################################################################
+
+TBB_VERSION = 2018_U5
+TBB_SITE = $(call github,01org,tbb,$(TBB_VERSION))

package/tbb/tbb.mk line 18

Quoted 10 lines
package/tbb/tbb.mk new file +10 -0
+TBB_INSTALL_STAGING = YES
+TBB_LICENSE = Apache-2.0
+TBB_LICENSE_FILES = LICENSE
+
+TBB_SO_VERSION = 2
+TBB_LIBS = libtbb libtbbmalloc libtbbmalloc_proxy
+TBB_BIN_PATH = $(@D)/build/linux_*
+
+define TBB_BUILD_CMDS
+	$(MAKE) $(TARGET_CONFIGURE_OPTS) arch=$(BR2_ARCH) -C $(@D)

The values for arch that are used by tbb are different from the values that
BR2_ARCH has. I studied this in more detail:

# arch is normally set based on uname -m with some conversions. However,
# it is not really used for much:
# - to decide between 32 or 64-bit files (based on '64' in the name)
# - to decide on some arch-specific CFLAGS like -m32, which we don't actually want
# - to set DO_ITT_NOTIFY if it's x86 (32 or 64 bit)
# - to include assembler source, but it only exists for ia64
# The only thing we actually want from the above is the 32/64-bit, and
# DO_ITT_NOTIFY. Therefore, set arch to a fixed value which is unknown to
# the tbb build system, and set DO_ITT_NOTIFY explicitly.

Regards,
Arnout

Quoted 11 lines
package/tbb/tbb.mk new file +11 -0
+endef
+
+define TBB_INSTALL_LIBS
+	$(foreach lib,$(TBB_LIBS),
+		$(INSTALL) -D -m 0755 $(TBB_BIN_PATH)/$(lib).so.$(TBB_SO_VERSION) \
+			$(1)/usr/lib/$(lib).so.$(TBB_SO_VERSION) ;
+		ln -sf $(lib).so.$(TBB_SO_VERSION) $(1)/usr/lib/$(lib).so
+	)
+endef
+
+define TBB_INSTALL_STAGING_CMDS

package/tbb/tbb.mk line 39

Quoted 10 lines
package/tbb/tbb.mk new file +10 -0
+	mkdir -p $(STAGING_DIR)/usr/include/
+	cp -a $(@D)/include/* $(STAGING_DIR)/usr/include/
+	$(call TBB_INSTALL_LIBS,$(STAGING_DIR))
+endef
+
+define TBB_INSTALL_TARGET_CMDS
+	$(call TBB_INSTALL_LIBS,$(TARGET_DIR))
+endef
+
+$(eval $(generic-package))

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#3 lore raw

Re: [Buildroot] [RFC PATCH v1 1/2] tbb: new package

Quoted 1 line · Le samedi 9 avril 2022, 14:42:59 BST Arnout Vandecappelle a écrit :

Hi Francis,

Hi

Quoted 2 lines

Thank you for this patch. I applied to master but with quite a few
changes.

You are welcome and thank you for the modifications, they made the contribution better and I learnt some few tricks to make better buildroot contribution!

Quoted 191 lines · Francis Laniel
Quoted 82 lines

From: bradford barr <[email protected]>

Intel Threading Building Blocks (TBB), is a C++ library to help developers write highly parallelized applications. OpenCV uses it to accelerate some of it's more heavy weight procedures.

---

  DEVELOPERS                                    |  1 +
  package/Config.in                             |  1 +
  .../0001-tbb-Enable-cross-compilation.patch   | 55 +++++++++++++++++++
  package/tbb/Config.in                         | 16 ++++++
  package/tbb/tbb.hash                          |  2 +
  package/tbb/tbb.mk                            | 39 +++++++++++++
  6 files changed, 114 insertions(+)

create mode 100644 package/tbb/0001-tbb-Enable-cross-compilation.patch create mode 100644 package/tbb/Config.in
create mode 100644 package/tbb/tbb.hash
create mode 100644 package/tbb/tbb.mk

DEVELOPERS +1 -0
index a66b9d7eee..ef4ddcab50 100644
@@ -970,6 +970,7 @@ F:	package/odhcploc/
 
  N:	Francis Laniel <[email protected]>
  F:	package/pahole/
 
+F:	package/tbb/
 
  N:	Francisco Gonzalez <[email protected]>

F: package/ser2net/

package/Config.in +1 -0
index 0d5d763180..24f7af5ea8 100644
@@ -2044,6 +2044,7 @@ endif
 
  	source "package/skalibs/Config.in"
  	source "package/sphinxbase/Config.in"
  	source "package/startup-notification/Config.in"
 
+	source "package/tbb/Config.in"
 

source "package/tinycbor/Config.in"
source "package/tz/Config.in"
source "package/tzdata/Config.in"

(quoted diff) +0 -0

b/package/tbb/0001-tbb-Enable-cross-compilation.patch new file mode 100644
index 0000000000..652d59c47b

package/tbb/0001-tbb-Enable-cross-compilation.patch new file +6 -0
@@ -0,0 +1,55 @@
+From 42c3faff14917f687aab405d8f571e352ffdf3f5 Mon Sep 17 00:00:00 2001
+From: Francis Laniel <[email protected]>
+Date: Wed, 6 Apr 2022 15:58:02 +0100
+Subject: [PATCH] tbb: Enable cross-compilation.
+
+This patch replaces hardcoded value for CPLUS and CONLY with $(CXX) and

$(CC). +So, by defining CC= it is possible to cross compile this library using a +cross-compiler.

package/tbb/0001-tbb-Enable-cross-compilation.patch new file +5 -0
+
+This patch was originally written by:
+Marcin Juszkiewicz <[email protected]>
+and taken from:
+https://github.com/intel/luv-yocto/blob/3b0688bc9a5e8d52b6ca461b15fb4abd3

eaaf7a8/meta-oe/recipes-support/tbb/tbb/cross-compile.patch +

package/tbb/0001-tbb-Enable-cross-compilation.patch new file +9 -0
+Signed-off-by: Francis Laniel <[email protected]>
+---
+ build/linux.clang.inc | 5 +++--
+ build/linux.gcc.inc   | 5 +++--
+ 2 files changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/build/linux.clang.inc b/build/linux.clang.inc
+index 5a459ef5..a0777db5 100644
+--- a/build/linux.clang.inc

package/tbb/0001-tbb-Enable-cross-compilation.patch line 33

Quoted 10 lines
package/tbb/0001-tbb-Enable-cross-compilation.patch new file +10 -0
++++ b/build/linux.clang.inc
+@@ -31,8 +31,9 @@ DYLIB_KEY = -shared
+ EXPORT_KEY = -Wl,--version-script,
+ LIBDL = -ldl
+
+-CPLUS = clang++
+-CONLY = clang
++CPLUS = $(CXX)
++CONLY = $(CC)
++CPLUS_FLAGS = $(CXXFLAGS)

I dropped this patch. Instead, I simply passed CPLUS, CONLY and
CPLUS_FLAGS in the $(MAKE) call.

Quoted 53 lines

+ LIB_LINK_FLAGS = $(DYLIB_KEY) -Wl,-soname=$(BUILDING_LIBRARY)
+ LIBS += -lpthread -lrt
+ LINK_FLAGS = -Wl,-rpath-link=. -rdynamic

package/tbb/0001-tbb-Enable-cross-compilation.patch new file +19 -0
+diff --git a/build/linux.gcc.inc b/build/linux.gcc.inc
+index 786c4153..30242a82 100644
+--- a/build/linux.gcc.inc
++++ b/build/linux.gcc.inc
+@@ -32,8 +32,9 @@ DYLIB_KEY = -shared
+ EXPORT_KEY = -Wl,--version-script,
+ LIBDL = -ldl
+
+-CPLUS = g++
+-CONLY = gcc
++CPLUS = $(CXX)
++CONLY = $(CC)
++CPLUS_FLAGS = $(CXXFLAGS)
+ LIB_LINK_FLAGS = $(DYLIB_KEY) -Wl,-soname=$(BUILDING_LIBRARY)
+ LIBS += -lpthread -lrt
+ LINK_FLAGS = -Wl,-rpath-link=. -rdynamic
+--
+2.25.1
+
package/tbb/Config.in new file +16 -0
new file mode 100644
index 0000000000..0f40b74d31
@@ -0,0 +1,16 @@
+config BR2_PACKAGE_TBB
+	bool "tbb"
+	depends on BR2_TOOLCHAIN_USES_GLIBC
+	depends on !BR2_STATIC_LIBS
+	depends on BR2_TOOLCHAIN_HAS_THREADS
+	depends on BR2_INSTALL_LIBSTDCPP
+	help
+	  Intel(R) Threading Building Blocks (Intel(R) TBB) lets you
+	  easily write parallel C++ programs that take full advantage
+	  of multicore performance, that are portable, composable and
+	  have future-proof scalability.
+
+	  https://www.threadingbuildingblocks.org/
+
+comment "tbb needs a glibc toolchain w/ dynamic library, threads, C++"
+	depends on !BR2_TOOLCHAIN_USES_GLIBC || BR2_STATIC_LIBS ||

!BR2_TOOLCHAIN_HAS_THREADS || !BR2_INSTALL_LIBSTDCPP diff --git a/package/tbb/tbb.hash b/package/tbb/tbb.hash
new file mode 100644
index 0000000000..e9fb7511b8

package/tbb/tbb.hash new file +2 -0
@@ -0,0 +1,2 @@
+# Locally calculated
+sha256  b8dbab5aea2b70cf07844f86fa413e549e099aa3205b6a04059ca92ead93a372 
Quoted 1 line

tbb-2018_U5.tar.gz

You also need to include a hash for the license file.

Quoted 14 lines
package/tbb/tbb.mk new file +1 -0
new file mode 100644
index 0000000000..cf06579b98
@@ -0,0 +1,39 @@
+#########################################################################

####### +#

package/tbb/tbb.mk new file +3 -0
+# tbb
+#
+#########################################################################

####### +

package/tbb/tbb.mk new file +2 -0
+TBB_VERSION = 2018_U5
+TBB_SITE = $(call github,01org,tbb,$(TBB_VERSION))

package/tbb/tbb.mk line 18

Quoted 10 lines
package/tbb/tbb.mk new file +10 -0
+TBB_INSTALL_STAGING = YES
+TBB_LICENSE = Apache-2.0
+TBB_LICENSE_FILES = LICENSE
+
+TBB_SO_VERSION = 2
+TBB_LIBS = libtbb libtbbmalloc libtbbmalloc_proxy
+TBB_BIN_PATH = $(@D)/build/linux_*
+
+define TBB_BUILD_CMDS
+	$(MAKE) $(TARGET_CONFIGURE_OPTS) arch=$(BR2_ARCH) -C $(@D)

The values for arch that are used by tbb are different from the values
that BR2_ARCH has. I studied this in more detail:

# arch is normally set based on uname -m with some conversions. However,
# it is not really used for much:
# - to decide between 32 or 64-bit files (based on '64' in the name)
# - to decide on some arch-specific CFLAGS like -m32, which we don't
actually want # - to set DO_ITT_NOTIFY if it's x86 (32 or 64 bit)
# - to include assembler source, but it only exists for ia64
# The only thing we actually want from the above is the 32/64-bit, and
# DO_ITT_NOTIFY. Therefore, set arch to a fixed value which is unknown to
# the tbb build system, and set DO_ITT_NOTIFY explicitly.
Quoted 8 lines

Regards,
Arnout

package/tbb/tbb.mk

Quoted 5 lines
package/tbb/tbb.mk new file +5 -0
+endef
+
+define TBB_INSTALL_LIBS
+	$(foreach lib,$(TBB_LIBS),
+		$(INSTALL) -D -m 0755 $(TBB_BIN_PATH)/$(lib).so.$

(TBB_SO_VERSION) \

Quoted 8 lines
Quoted 8 lines
package/tbb/tbb.mk new file +8 -0
+			$(1)/usr/lib/$(lib).so.$(TBB_SO_VERSION) ;
+		ln -sf $(lib).so.$(TBB_SO_VERSION) $(1)/usr/lib/$(lib).so
+	)
+endef
+
+define TBB_INSTALL_STAGING_CMDS
+	mkdir -p $(STAGING_DIR)/usr/include/
+	cp -a $(@D)/include/* $(STAGING_DIR)/usr/include/
Quoted 8 lines

package/tbb/tbb.mk line 39

Quoted 8 lines
package/tbb/tbb.mk new file +8 -0
+	$(call TBB_INSTALL_LIBS,$(STAGING_DIR))
+endef
+
+define TBB_INSTALL_TARGET_CMDS
+	$(call TBB_INSTALL_LIBS,$(TARGET_DIR))
+endef
+
+$(eval $(generic-package))

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#4 lore raw

RFC PATCH 2/2 package/sysdig: bump version to 0.27.1.

In reply to Francis Laniel

0.23.1 has compilation errors with recent kernels.

---
 ...ATCH_COMMAND-to-fix-lua-types-and-fu.patch | 82 +++++++++++++++++++
 ...gainst-libabseil-cpp-which-grpc-uses.patch | 45 ++++++++++
 package/sysdig/Config.in                      |  5 ++
 package/sysdig/sysdig.hash                    |  1 +
 package/sysdig/sysdig.mk                      |  7 +-
 5 files changed, 139 insertions(+), 1 deletion(-)
 create mode 100644 package/sysdig/0001-libsinsp-Apply-PATCH_COMMAND-to-fix-lua-types-and-fu.patch
 create mode 100644 package/sysdig/0002-Link-against-libabseil-cpp-which-grpc-uses.patch
package/sysdig/0001-libsinsp-Apply-PATCH_COMMAND-to-fix-lua-types-and-fu.patch new file +82 -0
new file mode 100644
index 0000000000..7873210281
@@ -0,0 +1,82 @@
+From cc8bccc3ebb90103900a7f0f2b085ddb723b8792 Mon Sep 17 00:00:00 2001
+From: Francis Laniel <[email protected]>
+Date: Wed, 6 Apr 2022 16:54:37 +0100
+Subject: [PATCH] libsinsp: Apply PATCH_COMMAND to fix lua types and function.
+
+Buildroot luajit 5.1 seems to not have compatibility between luaL_reg and
+luaL_Reg.
+So, we apply sysdig CMakeLists.txt PATCH_COMMAND to fix this and lua function
+call as well.
+Note that, this PATCH_COMMAND was added in sysdig in:
+a064440394c9 ("Adding power support to Travis builds (#1566)")
+
+This patch is also present in kubernetes/minikube in:
+f036c279bc59 ("Add patch for compiling sysdig with system luajit")
+
+Signed-off-by: Francis Laniel <[email protected]>
+---
+ userspace/libsinsp/chisel.cpp         | 6 +++---
+ userspace/libsinsp/lua_parser.cpp     | 2 +-
+ userspace/libsinsp/lua_parser_api.cpp | 2 +-
+ 3 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/userspace/libsinsp/chisel.cpp b/userspace/libsinsp/chisel.cpp
+index 0a6e3cf8..0c2e255a 100644
+--- a/userspace/libsinsp/chisel.cpp
++++ b/userspace/libsinsp/chisel.cpp
+@@ -98,7 +98,7 @@ void lua_stackdump(lua_State *L)
+ // Lua callbacks
+ ///////////////////////////////////////////////////////////////////////////////
+ #ifdef HAS_LUA_CHISELS
+-const static struct luaL_reg ll_sysdig [] =
++const static struct luaL_Reg ll_sysdig [] =
+ {
+ 	{"set_filter", &lua_cbacks::set_global_filter},
+ 	{"set_snaplen", &lua_cbacks::set_snaplen},
+@@ -134,7 +134,7 @@ const static struct luaL_reg ll_sysdig [] =
+ 	{NULL,NULL}
+ };
+ 
+-const static struct luaL_reg ll_chisel [] =
++const static struct luaL_Reg ll_chisel [] =
+ {
+ 	{"request_field", &lua_cbacks::request_field},
+ 	{"set_filter", &lua_cbacks::set_filter},
+@@ -146,7 +146,7 @@ const static struct luaL_reg ll_chisel [] =
+ 	{NULL,NULL}
+ };
+ 
+-const static struct luaL_reg ll_evt [] =
++const static struct luaL_Reg ll_evt [] =
+ {
+ 	{"field", &lua_cbacks::field},
+ 	{"get_num", &lua_cbacks::get_num},
+diff --git a/userspace/libsinsp/lua_parser.cpp b/userspace/libsinsp/lua_parser.cpp
+index 0e26617d..78810d96 100644
+--- a/userspace/libsinsp/lua_parser.cpp
++++ b/userspace/libsinsp/lua_parser.cpp
+@@ -32,7 +32,7 @@ extern "C" {
+ #include "lauxlib.h"
+ }
+ 
+-const static struct luaL_reg ll_filter [] =
++const static struct luaL_Reg ll_filter [] =
+ {
+ 	{"rel_expr", &lua_parser_cbacks::rel_expr},
+ 	{"bool_op", &lua_parser_cbacks::bool_op},
+diff --git a/userspace/libsinsp/lua_parser_api.cpp b/userspace/libsinsp/lua_parser_api.cpp
+index c89e9126..c3d8008a 100644
+--- a/userspace/libsinsp/lua_parser_api.cpp
++++ b/userspace/libsinsp/lua_parser_api.cpp
+@@ -266,7 +266,7 @@ int lua_parser_cbacks::rel_expr(lua_State *ls)
+ 					string err = "Got non-table as in-expression operand\n";
+ 					throw sinsp_exception("parser API error");
+ 				}
+-				int n = luaL_getn(ls, 4);  /* get size of table */
++				int n = lua_objlen (ls, 4);  /* get size of table */
+ 				for (i=1; i<=n; i++)
+ 				{
+ 					lua_rawgeti(ls, 4, i);
+-- 
+2.25.1
+
package/sysdig/0002-Link-against-libabseil-cpp-which-grpc-uses.patch new file +45 -0

45 lines not on this page · raw message

package/sysdig/Config.in +5 -0
index 06d20c7f7b..5a7fbb50e0 100644
@@ -8,13 +8,18 @@ config BR2_PACKAGE_SYSDIG
 	depends on BR2_USE_WCHAR # elfutils
 	depends on BR2_TOOLCHAIN_USES_UCLIBC || BR2_TOOLCHAIN_USES_GLIBC # elfutils
 	depends on BR2_PACKAGE_LUAINTERPRETER_ABI_VERSION_5_1
+	select BR2_PACKAGE_C_ARES
 	select BR2_PACKAGE_ELFUTILS
+	select BR2_PACKAGE_GRPC
+	select BR2_PACKAGE_GTEST
 	select BR2_PACKAGE_JQ
 	select BR2_PACKAGE_JSONCPP
 	select BR2_PACKAGE_LIBB64
 	select BR2_PACKAGE_LIBCURL
 	select BR2_PACKAGE_NCURSES
 	select BR2_PACKAGE_OPENSSL
+	select BR2_PACKAGE_PROTOBUF
+	select BR2_PACKAGE_TBB
 	select BR2_PACKAGE_ZLIB
 	help
 	  Sysdig is open source, system-level exploration:
package/sysdig/sysdig.hash +1 -0
index 565b1e9828..4bce674f3e 100644
@@ -1,3 +1,4 @@
 # sha256 locally computed
+sha256  b9d05854493d245a7a7e75f77fc654508f720aab5e5e8a3a932bd8eb54e49bda  sysdig-0.27.1.tar.gz
 sha256  57d5b713b875eba35546a1408bf3f20c2703904a17d956be115ee55272db4cfa  sysdig-0.23.1.tar.gz
 sha256  8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643  COPYING
package/sysdig/sysdig.mk +6 -1
index 08d93750ae..d497c7c381 100644
@@ -4,7 +4,7 @@
 #
 ################################################################################
 
-SYSDIG_VERSION = 0.23.1
+SYSDIG_VERSION = 0.27.1
 SYSDIG_SITE = $(call github,draios,sysdig,$(SYSDIG_VERSION))
 SYSDIG_LICENSE = GPL-2.0
 SYSDIG_LICENSE_FILES = COPYING
@@ -13,7 +13,10 @@ SYSDIG_CONF_OPTS = -DENABLE_DKMS=OFF -DUSE_BUNDLED_DEPS=OFF
 SYSDIG_SUPPORTS_IN_SOURCE_BUILD = NO
 
 SYSDIG_DEPENDENCIES = \
+	c-ares \
 	elfutils \
+	gtest \
+	grpc \
 	jq \
 	jsoncpp \
 	libb64 \
@@ -21,6 +24,8 @@ SYSDIG_DEPENDENCIES = \
 	luainterpreter \
 	ncurses \
 	openssl \
+	protobuf \
+	tbb \
 	zlib
 
 # sysdig creates the module Makefile from a template, which contains a
Signature · 6 lines
2.25.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#5 lore raw

Re: [Buildroot] [RFC PATCH v1 2/2] package/sysdig: bump version to 0.27.1.

Hi Francis,

Quoted 3 lines · Francis Laniel

0.23.1 has compilation errors with recent kernels.

I've applied to master, with a number of changes.

I've noticed that it doesn't build on e.g. aarch64, because it uses syscalls
like open(2) that simply don't exist on aarch64. Fixing that would be quite a big undertaking, and upstream has simply removed the syscall-handling code. So a better solution would be to update to 0.29.1. However, *that* is a fairly big change again because they also got rid of the kernel driver. It's easy enough to remove the kernel-module part on the buildroot side, but I wouldn't know if it still behaves correctly at runtime. So, Francis, would you care to look into updating to 0.29.1?

If you do that, please also check if it requires a minimum kernel version. I
think it uses all kinds of tracepoint or other kernel features which may not exist in older kernels. If it does have a minimum kernel version, please add a BR2_TOOLCHAIN_HEADERS_AT_LEAST_X_Y dependency (with explanation in the commit message how you got to that conclusion).

Also, I added you to DEVELOPERS for this package. It won't have much effect
other than being Cc'ed on patches, because sysdig isn't built in the autobuilders (since it depends on a kernel to be built and we don't do that in autobuilders).

Quoted 22 lines
---
  ...ATCH_COMMAND-to-fix-lua-types-and-fu.patch | 82 +++++++++++++++++++
  ...gainst-libabseil-cpp-which-grpc-uses.patch | 45 ++++++++++
  package/sysdig/Config.in                      |  5 ++
  package/sysdig/sysdig.hash                    |  1 +
  package/sysdig/sysdig.mk                      |  7 +-
  5 files changed, 139 insertions(+), 1 deletion(-)

create mode 100644 package/sysdig/0001-libsinsp-Apply-PATCH_COMMAND-to-fix-lua-types-and-fu.patch create mode 100644 package/sysdig/0002-Link-against-libabseil-cpp-which-grpc-uses.patch

package/sysdig/0001-libsinsp-Apply-PATCH_COMMAND-to-fix-lua-types-and-fu.patch new file +6 -0
new file mode 100644
index 0000000000..7873210281
@@ -0,0 +1,82 @@
+From cc8bccc3ebb90103900a7f0f2b085ddb723b8792 Mon Sep 17 00:00:00 2001
+From: Francis Laniel <[email protected]>
+Date: Wed, 6 Apr 2022 16:54:37 +0100
+Subject: [PATCH] libsinsp: Apply PATCH_COMMAND to fix lua types and function.
+
+Buildroot luajit 5.1 seems to not have compatibility between luaL_reg and

package/sysdig/0001-libsinsp-Apply-PATCH_COMMAND-to-fix-lua-types-and-fu.patch line 16

Quoted 10 lines
package/sysdig/0001-libsinsp-Apply-PATCH_COMMAND-to-fix-lua-types-and-fu.patch new file +10 -0
+luaL_Reg.
+So, we apply sysdig CMakeLists.txt PATCH_COMMAND to fix this and lua function
+call as well.
+Note that, this PATCH_COMMAND was added in sysdig in:
+a064440394c9 ("Adding power support to Travis builds (#1566)")
+
+This patch is also present in kubernetes/minikube in:
+f036c279bc59 ("Add patch for compiling sysdig with system luajit")
+
+Signed-off-by: Francis Laniel <[email protected]>

Would it be possible to send this patch upstream, so we don't need to maintain
it going forward? Obviously, it's best to first bump to the latest version (and check if the patch is still needed).

[snip]

package/sysdig/0002-Link-against-libabseil-cpp-which-grpc-uses.patch line 4

Quoted 10 lines
package/sysdig/0002-Link-against-libabseil-cpp-which-grpc-uses.patch new file +4 -0
new file mode 100644
index 0000000000..60c3d31a3e
@@ -0,0 +1,45 @@
+From a7fb3b863c3574470c45fdf6084dcc40931ca017 Mon Sep 17 00:00:00 2001
+From: Francis Laniel <[email protected]>
+Date: Thu, 7 Apr 2022 18:30:23 +0100
+Subject: [PATCH 2/2] Link against libabseil-cpp which grpc uses.

Don't include the 2/2 part (use git format-patch -N). check-package reports this.

package/sysdig/0002-Link-against-libabseil-cpp-which-grpc-uses.patch line 8

Quoted 4 lines
package/sysdig/0002-Link-against-libabseil-cpp-which-grpc-uses.patch new file +4 -0
+
+This patch was taken from:
+55c96b61f7b9 ("sysdig: make extra linking against abseil conditional")
+from hhoffstaette/portage.

I've changed this to include the full URL of where you've taken it from. I
should have done that for th other patch as well, but I forgot.

Also please send this patch upstream.

Quoted 42 lines
package/sysdig/0002-Link-against-libabseil-cpp-which-grpc-uses.patch new file +37 -0
+
+Signed-off-by: Francis Laniel <[email protected]>
+---
+ CMakeLists.txt                    | 1 +
+ userspace/libsinsp/CMakeLists.txt | 4 ++++
+ 2 files changed, 5 insertions(+)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 1f34f1d6..c0354b29 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -552,6 +552,7 @@ if(NOT WIN32 AND NOT APPLE)
+ 			else()
+ 				message(FATAL_ERROR "Couldn't find system grpc")
+ 			endif()
++			find_library(ABSL_SYNC_LIB NAMES absl_synchronization)
+ 			find_program(GRPC_CPP_PLUGIN grpc_cpp_plugin)
+ 			if(NOT GRPC_CPP_PLUGIN)
+ 				message(FATAL_ERROR "System grpc_cpp_plugin not found")
+diff --git a/userspace/libsinsp/CMakeLists.txt b/userspace/libsinsp/CMakeLists.txt
+index d72f9115..d1b7ea02 100644
+--- a/userspace/libsinsp/CMakeLists.txt
++++ b/userspace/libsinsp/CMakeLists.txt
+@@ -214,6 +214,10 @@ if(NOT WIN32)
+ 				"${JQ_LIB}"
+ 				"${B64_LIB}")
+
++			if(ABSL_SYNC_LIB)
++				target_link_libraries(sinsp "${ABSL_SYNC_LIB}")
++			endif()
++
+ 			if(NOT MUSL_OPTIMIZED_BUILD)
+ 			target_link_libraries(sinsp
+ 				rt
+--
+2.25.1
+
package/sysdig/Config.in +0 -0
index 06d20c7f7b..5a7fbb50e0 100644

package/sysdig/Config.in config BR2_PACKAGE_SYSDIG · line 13

Quoted 6 lines
package/sysdig/Config.in +2 -0
@@ -8,13 +8,18 @@ config BR2_PACKAGE_SYSDIG
  	depends on BR2_USE_WCHAR # elfutils
  	depends on BR2_TOOLCHAIN_USES_UCLIBC || BR2_TOOLCHAIN_USES_GLIBC # elfutils
  	depends on BR2_PACKAGE_LUAINTERPRETER_ABI_VERSION_5_1
+	select BR2_PACKAGE_C_ARES
  	select BR2_PACKAGE_ELFUTILS
+	select BR2_PACKAGE_GRPC

You also need to propagate the dependencies of grpc. For grpc, that's just a
matter of adding grpc to the comments above, but some other packages have stricter dependencies.

package/sysdig/Config.in config BR2_PACKAGE_SYSDIG · line 14

Quoted 1 line
package/sysdig/Config.in +1 -0
+	select BR2_PACKAGE_GTEST

gtest is only required if tests are enabled, so I added the conf opt to
disable tests instead.

Quoted 16 lines
package/sysdig/Config.in +2 -0
  	select BR2_PACKAGE_JQ
  	select BR2_PACKAGE_JSONCPP
  	select BR2_PACKAGE_LIBB64
  	select BR2_PACKAGE_LIBCURL
  	select BR2_PACKAGE_NCURSES
  	select BR2_PACKAGE_OPENSSL
+	select BR2_PACKAGE_PROTOBUF
+	select BR2_PACKAGE_TBB
  	select BR2_PACKAGE_ZLIB
  	help
  	  Sysdig is open source, system-level exploration:
package/sysdig/sysdig.hash +0 -0
index 565b1e9828..4bce674f3e 100644

package/sysdig/sysdig.hash line 4

Quoted 4 lines
package/sysdig/sysdig.hash +1 -0
@@ -1,3 +1,4 @@
  # sha256 locally computed
+sha256  b9d05854493d245a7a7e75f77fc654508f720aab5e5e8a3a932bd8eb54e49bda  sysdig-0.27.1.tar.gz
  sha256  57d5b713b875eba35546a1408bf3f20c2703904a17d956be115ee55272db4cfa  sysdig-0.23.1.tar.gz
  sha256  8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643  COPYING

The COPYING file has changed, as shown by 'make legal-info'. Turns out that
the license changed to Apache-2.0, except for the driver which is GPLv2 or MIT. So I updated the license hash and added the new license files.

package/sysdig/sysdig.mk line 10

Quoted 13 lines
package/sysdig/sysdig.mk +1 -1
index 08d93750ae..d497c7c381 100644
@@ -4,7 +4,7 @@
  #
  ################################################################################
 
-SYSDIG_VERSION = 0.23.1
+SYSDIG_VERSION = 0.27.1
  SYSDIG_SITE = $(call github,draios,sysdig,$(SYSDIG_VERSION))
  SYSDIG_LICENSE = GPL-2.0
  SYSDIG_LICENSE_FILES = COPYING

This needed to be updated as well for the license change, of course.

Regards,
Arnout

Quoted 12 lines
package/sysdig/sysdig.mk +3 -0
@@ -13,7 +13,10 @@ SYSDIG_CONF_OPTS = -DENABLE_DKMS=OFF -DUSE_BUNDLED_DEPS=OFF
  SYSDIG_SUPPORTS_IN_SOURCE_BUILD = NO
 
  SYSDIG_DEPENDENCIES = \
+	c-ares \
  	elfutils \
+	gtest \
+	grpc \
  	jq \
  	jsoncpp \
  	libb64 \

package/sysdig/sysdig.mk SYSDIG_DEPENDENCIES = \ · line 31

Quoted 8 lines
package/sysdig/sysdig.mk +2 -0
@@ -21,6 +24,8 @@ SYSDIG_DEPENDENCIES = \
  	luainterpreter \
  	ncurses \
  	openssl \
+	protobuf \
+	tbb \
  	zlib
 
  # sysdig creates the module Makefile from a template, which contains a

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#6 lore raw

Re: [Buildroot] [RFC PATCH v1 2/2] package/sysdig: bump version to 0.27.1.

Quoted 1 line · Le samedi 9 avril 2022, 15:40:20 BST Arnout Vandecappelle a écrit :

Hi Francis,

Hi.

Quoted 6 lines · Francis Laniel
Quoted 3 lines

0.23.1 has compilation errors with recent kernels.

I've applied to master, with a number of changes.

Thank you for it.

Quoted 8 lines

I've noticed that it doesn't build on e.g. aarch64, because it uses
syscalls like open(2) that simply don't exist on aarch64. Fixing that would be quite a big undertaking, and upstream has simply removed the syscall-handling code. So a better solution would be to update to 0.29.1. However, *that* is a fairly big change again because they also got rid of the kernel driver. It's easy enough to remove the kernel-module part on the buildroot side, but I wouldn't know if it still behaves correctly at runtime. So, Francis, would you care to look into updating to 0.29.1?

I will try to update sysdig to this version but I sadly cannot give any date of delivery.
Indeed, I am bit worried is that after 0.27.1 sysdig depends of falco/libs and I do not really know how to handle this.

Quoted 79 lines

If you do that, please also check if it requires a minimum kernel version.
I think it uses all kinds of tracepoint or other kernel features which may not exist in older kernels. If it does have a minimum kernel version, please add a BR2_TOOLCHAIN_HEADERS_AT_LEAST_X_Y dependency (with explanation in the commit message how you got to that conclusion).

Also, I added you to DEVELOPERS for this package. It won't have much
effect other than being Cc'ed on patches, because sysdig isn't built in the autobuilders (since it depends on a kernel to be built and we don't do that in autobuilders).

Quoted 31 lines

---

  ...ATCH_COMMAND-to-fix-lua-types-and-fu.patch | 82 +++++++++++++++++++
  ...gainst-libabseil-cpp-which-grpc-uses.patch | 45 ++++++++++
  package/sysdig/Config.in                      |  5 ++
  package/sysdig/sysdig.hash                    |  1 +
  package/sysdig/sysdig.mk                      |  7 +-
  5 files changed, 139 insertions(+), 1 deletion(-)

create mode 100644 package/sysdig/0001-libsinsp-Apply-PATCH_COMMAND-to-fix-lua-types-and-f u.patch create mode 100644 package/sysdig/0002-Link-against-libabseil-cpp-which-grpc-uses.patch>
diff --git a/package/sysdig/0001-libsinsp-Apply-PATCH_COMMAND-to-fix-lua-types-and-f u.patch b/package/sysdig/0001-libsinsp-Apply-PATCH_COMMAND-to-fix-lua-types-and-f u.patch new file mode 100644
index 0000000000..7873210281
--- /dev/null
+++
b/package/sysdig/0001-libsinsp-Apply-PATCH_COMMAND-to-fix-lua-types-and-f u.patch @@ -0,0 +1,82 @@

package/sysdig/0001-libsinsp-Apply-PATCH_COMMAND-to-fix-lua-types-and-fu.patch new file +4 -0
+From cc8bccc3ebb90103900a7f0f2b085ddb723b8792 Mon Sep 17 00:00:00 2001
+From: Francis Laniel <[email protected]>
+Date: Wed, 6 Apr 2022 16:54:37 +0100
+Subject: [PATCH] libsinsp: Apply PATCH_COMMAND to fix lua types and

function. +

package/sysdig/0001-libsinsp-Apply-PATCH_COMMAND-to-fix-lua-types-and-fu.patch new file +3 -0
+Buildroot luajit 5.1 seems to not have compatibility between luaL_reg and
+luaL_Reg.
+So, we apply sysdig CMakeLists.txt PATCH_COMMAND to fix this and lua

function +call as well.

package/sysdig/0001-libsinsp-Apply-PATCH_COMMAND-to-fix-lua-types-and-fu.patch line 16

Quoted 7 lines
package/sysdig/0001-libsinsp-Apply-PATCH_COMMAND-to-fix-lua-types-and-fu.patch new file +7 -0
+Note that, this PATCH_COMMAND was added in sysdig in:
+a064440394c9 ("Adding power support to Travis builds (#1566)")
+
+This patch is also present in kubernetes/minikube in:
+f036c279bc59 ("Add patch for compiling sysdig with system luajit")
+
+Signed-off-by: Francis Laniel <[email protected]>

Would it be possible to send this patch upstream, so we don't need to
maintain it going forward? Obviously, it's best to first bump to the latest version (and check if the patch is still needed).

[snip]

package/sysdig/0002-Link-against-libabseil-cpp-which-grpc-uses.patch line 4

Quoted 12 lines

diff --git a/package/sysdig/0002-Link-against-libabseil-cpp-which-grpc-uses.patch b/package/sysdig/0002-Link-against-libabseil-cpp-which-grpc-uses.patch new file mode 100644
index 0000000000..60c3d31a3e

package/sysdig/0002-Link-against-libabseil-cpp-which-grpc-uses.patch new file +4 -0
@@ -0,0 +1,45 @@
+From a7fb3b863c3574470c45fdf6084dcc40931ca017 Mon Sep 17 00:00:00 2001
+From: Francis Laniel <[email protected]>
+Date: Thu, 7 Apr 2022 18:30:23 +0100
+Subject: [PATCH 2/2] Link against libabseil-cpp which grpc uses.

Don't include the 2/2 part (use git format-patch -N). check-package
reports this.

package/sysdig/0002-Link-against-libabseil-cpp-which-grpc-uses.patch line 8

Quoted 4 lines
package/sysdig/0002-Link-against-libabseil-cpp-which-grpc-uses.patch new file +4 -0
+
+This patch was taken from:
+55c96b61f7b9 ("sysdig: make extra linking against abseil conditional")
+from hhoffstaette/portage.

I've changed this to include the full URL of where you've taken it from. I
should have done that for th other patch as well, but I forgot.

Quoted 1 line

Also please send this patch upstream.

For the luajit and abseil patch, I will first check if 0.29.1 still needs them. If so, I will for sure send these patches upstream!

Quoted 11 lines
Quoted 11 lines
package/sysdig/0002-Link-against-libabseil-cpp-which-grpc-uses.patch new file +11 -0
+
+Signed-off-by: Francis Laniel <[email protected]>
+---
+ CMakeLists.txt                    | 1 +
+ userspace/libsinsp/CMakeLists.txt | 4 ++++
+ 2 files changed, 5 insertions(+)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 1f34f1d6..c0354b29 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
Quoted 8 lines

package/sysdig/0002-Link-against-libabseil-cpp-which-grpc-uses.patch

Quoted 8 lines
package/sysdig/0002-Link-against-libabseil-cpp-which-grpc-uses.patch new file +8 -0
+@@ -552,6 +552,7 @@ if(NOT WIN32 AND NOT APPLE)
+ 			else()
+ 				message(FATAL_ERROR "Couldn't find system grpc")
+ 			endif()
++			find_library(ABSL_SYNC_LIB NAMES absl_synchronization)
+ 			find_program(GRPC_CPP_PLUGIN grpc_cpp_plugin)
+ 			if(NOT GRPC_CPP_PLUGIN)
+ 				message(FATAL_ERROR "System grpc_cpp_plugin not 

found")

Quoted 121 lines
Quoted 24 lines
package/sysdig/0002-Link-against-libabseil-cpp-which-grpc-uses.patch new file +1 -0
+diff --git a/userspace/libsinsp/CMakeLists.txt

b/userspace/libsinsp/CMakeLists.txt +index d72f9115..d1b7ea02 100644 +--- a/userspace/libsinsp/CMakeLists.txt
++++ b/userspace/libsinsp/CMakeLists.txt
+@@ -214,6 +214,10 @@ if(NOT WIN32)

package/sysdig/0002-Link-against-libabseil-cpp-which-grpc-uses.patch new file +13 -0
+ 				"${JQ_LIB}"
+ 				"${B64_LIB}")
+
++			if(ABSL_SYNC_LIB)
++				target_link_libraries(sinsp "${ABSL_SYNC_LIB}")
++			endif()
++
+ 			if(NOT MUSL_OPTIMIZED_BUILD)
+ 			target_link_libraries(sinsp
+ 				rt
+--
+2.25.1
+
package/sysdig/Config.in +0 -0
index 06d20c7f7b..5a7fbb50e0 100644
@@ -8,13 +8,18 @@ config BR2_PACKAGE_SYSDIG
 

package/sysdig/Config.in config BR2_PACKAGE_SYSDIG · line 18

Quoted 10 lines
package/sysdig/Config.in +2 -0
  	depends on BR2_USE_WCHAR # elfutils
  	depends on BR2_TOOLCHAIN_USES_UCLIBC || BR2_TOOLCHAIN_USES_GLIBC #
  	elfutils
  	depends on BR2_PACKAGE_LUAINTERPRETER_ABI_VERSION_5_1
 
+	select BR2_PACKAGE_C_ARES
 
  	select BR2_PACKAGE_ELFUTILS
 
+	select BR2_PACKAGE_GRPC

You also need to propagate the dependencies of grpc. For grpc, that's just
a matter of adding grpc to the comments above, but some other packages have stricter dependencies.

package/sysdig/Config.in config BR2_PACKAGE_SYSDIG · line 14

Quoted 1 line
package/sysdig/Config.in +1 -0
+	select BR2_PACKAGE_GTEST

gtest is only required if tests are enabled, so I added the conf opt to
disable tests instead.

Quoted 23 lines
package/sysdig/Config.in +2 -0
  	select BR2_PACKAGE_JQ
  	select BR2_PACKAGE_JSONCPP
  	select BR2_PACKAGE_LIBB64
  	select BR2_PACKAGE_LIBCURL
  	select BR2_PACKAGE_NCURSES
  	select BR2_PACKAGE_OPENSSL
 
+	select BR2_PACKAGE_PROTOBUF
+	select BR2_PACKAGE_TBB
 
  	select BR2_PACKAGE_ZLIB
  	help
 
  	  Sysdig is open source, system-level exploration:
package/sysdig/sysdig.hash +1 -0
index 565b1e9828..4bce674f3e 100644
@@ -1,3 +1,4 @@
 
  # sha256 locally computed
 
+sha256  b9d05854493d245a7a7e75f77fc654508f720aab5e5e8a3a932bd8eb54e49bda 
Quoted 5 lines

sysdig-0.27.1.tar.gz>
sha256 57d5b713b875eba35546a1408bf3f20c2703904a17d956be115ee55272db4cfa
sysdig-0.23.1.tar.gz sha256
8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643 COPYING

The COPYING file has changed, as shown by 'make legal-info'. Turns out
that the license changed to Apache-2.0, except for the driver which is GPLv2 or MIT. So I updated the license hash and added the new license files.

Quoted 13 lines
package/sysdig/sysdig.mk +1 -1
index 08d93750ae..d497c7c381 100644
@@ -4,7 +4,7 @@
 
  #
  ########################################################################
  ########> 
-SYSDIG_VERSION = 0.23.1
+SYSDIG_VERSION = 0.27.1
 
  SYSDIG_SITE = $(call github,draios,sysdig,$(SYSDIG_VERSION))
Quoted 2 lines

SYSDIG_LICENSE = GPL-2.0
SYSDIG_LICENSE_FILES = COPYING

This needed to be updated as well for the license change, of course.

Regards,
Arnout

Quoted 23 lines
package/sysdig/sysdig.mk +3 -1
@@ -13,7 +13,10 @@ SYSDIG_CONF_OPTS = -DENABLE_DKMS=OFF
-DUSE_BUNDLED_DEPS=OFF> 
  SYSDIG_SUPPORTS_IN_SOURCE_BUILD = NO
 
  SYSDIG_DEPENDENCIES = \
 
+	c-ares \
 
  	elfutils \
 
+	gtest \
+	grpc \
 
  	jq \
  	jsoncpp \
  	libb64 \
@@ -21,6 +24,8 @@ SYSDIG_DEPENDENCIES = \
 
  	luainterpreter \
  	ncurses \
  	openssl \
 
Quoted 6 lines
Quoted 6 lines
package/sysdig/sysdig.mk +2 -0
+	protobuf \
+	tbb \
 

zlib

  # sysdig creates the module Makefile from a template, which contains a

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot