Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Angelo Compagnucci <angelo.compagnucci@gmail.com>
To: buildroot@buildroot.org
Cc: Francis Laniel <flaniel@linux.microsoft.com>,
	Angelo Compagnucci <angelo.compagnucci@gmail.com>
Subject: [Buildroot] [PATCH 8/9] package/falcosecurity-libs: add falcosecurity-libs-legacy
Date: Fri, 30 Oct 2026 14:59:15 +0100	[thread overview]
Message-ID: <20261030135916.3599219-8-angelo.compagnucci@gmail.com> (raw)
In-Reply-To: <20261030135916.3599219-1-angelo.compagnucci@gmail.com>

Add falcosecurity-libs-legacy, providing falcosecurity-libs 0.10.5 on
32-bit architectures. It is the last version whose userspace libraries
support them, as they get the system call numbers from the C library
headers, instead of tables which only exist for 64-bit architectures.

Like the former falcosecurity-libs package, falcosecurity-libs-legacy
only provides the sources of the userspace libraries, which are built by
sysdig, with the dependencies listed here, and builds the kernel module,
generating its Makefile and driver_config.h, as the driver
CMakeLists.txt doesn't work well with the kernel-module infrastructure.
The driver API and schema versions are read from driver/API_VERSION and
driver/SCHEMA_VERSION.

The dependencies are the ones of the minimal build, which will be used
by sysdig, so grpc, protobuf, c-ares, libcurl, openssl and elfutils are
not needed.

Patches:
- backport the upstream fixes adding the missing <cstdint> includes, for
  gcc >= 13 and musl
- add the missing <cstdint> include to scap_open_exception.h, for musl

falcosecurity-libs-legacy can't be selected yet: the 32-bit
architectures are enabled when adding sysdig-legacy, in the following
commit.

Signed-off-by: Angelo Compagnucci <angelo.compagnucci@gmail.com>
---
 package/falcosecurity-libs/Config.in          |  9 ++--
 .../falcosecurity-libs-latest/Config.in       |  2 +
 .../0001-Add-cstdint-for-uintXX_t-types.patch | 46 +++++++++++++++++
 ...bsinsp-explicitly-include-cstdint-to.patch | 31 ++++++++++++
 ...tdint-include-to-fix-build-on-Alpine.patch | 27 ++++++++++
 ...sp-scap_open_exception.h-include-cst.patch | 32 ++++++++++++
 .../falcosecurity-libs-legacy/Config.in       | 12 +++++
 .../falcosecurity-libs-legacy.hash            |  5 ++
 .../falcosecurity-libs-legacy.mk              | 50 +++++++++++++++++++
 .../falcosecurity-libs/falcosecurity-libs.mk  |  5 +-
 10 files changed, 215 insertions(+), 4 deletions(-)
 create mode 100644 package/falcosecurity-libs/falcosecurity-libs-legacy/0001-Add-cstdint-for-uintXX_t-types.patch
 create mode 100644 package/falcosecurity-libs/falcosecurity-libs-legacy/0002-fix-userspace-libsinsp-explicitly-include-cstdint-to.patch
 create mode 100644 package/falcosecurity-libs/falcosecurity-libs-legacy/0003-fix-missing-cstdint-include-to-fix-build-on-Alpine.patch
 create mode 100644 package/falcosecurity-libs/falcosecurity-libs-legacy/0004-userspace-libsinsp-scap_open_exception.h-include-cst.patch
 create mode 100644 package/falcosecurity-libs/falcosecurity-libs-legacy/Config.in
 create mode 100644 package/falcosecurity-libs/falcosecurity-libs-legacy/falcosecurity-libs-legacy.hash
 create mode 100644 package/falcosecurity-libs/falcosecurity-libs-legacy/falcosecurity-libs-legacy.mk

diff --git a/package/falcosecurity-libs/Config.in b/package/falcosecurity-libs/Config.in
index 495dd2b8ca..079dc1f376 100644
--- a/package/falcosecurity-libs/Config.in
+++ b/package/falcosecurity-libs/Config.in
@@ -15,11 +15,12 @@ config BR2_PACKAGE_FALCOSECURITY_LIBS
 	depends on BR2_LINUX_KERNEL
 	depends on BR2_INSTALL_LIBSTDCPP # jsoncpp, re2, tbb, valijson
 	depends on BR2_TOOLCHAIN_GCC_AT_LEAST_10 # re2
-	depends on BR2_TOOLCHAIN_HAS_THREADS # re2, tbb
+	depends on BR2_TOOLCHAIN_HAS_THREADS # jq, re2, tbb
 	depends on !BR2_STATIC_LIBS # re2, tbb
 	depends on !BR2_TOOLCHAIN_USES_UCLIBC # tbb
 	depends on !BR2_TOOLCHAIN_HAS_GCC_BUG_64735 # tbb
-	select BR2_PACKAGE_FALCOSECURITY_LIBS_LATEST
+	select BR2_PACKAGE_FALCOSECURITY_LIBS_LATEST if BR2_ARCH_IS_64
+	select BR2_PACKAGE_FALCOSECURITY_LIBS_LEGACY if !BR2_ARCH_IS_64
 	help
 	  falcosecurity/libs provides libsinsp, libscap, the kernel
 	  module driver and the eBPF driver sources.
@@ -31,6 +32,8 @@ config BR2_PACKAGE_HAS_FALCOSECURITY_LIBS
 
 config BR2_PACKAGE_PROVIDES_FALCOSECURITY_LIBS
 	string
-	default "falcosecurity-libs-latest"
+	default "falcosecurity-libs-latest" if BR2_PACKAGE_FALCOSECURITY_LIBS_LATEST
+	default "falcosecurity-libs-legacy" if BR2_PACKAGE_FALCOSECURITY_LIBS_LEGACY
 
 source "package/falcosecurity-libs/falcosecurity-libs-latest/Config.in"
+source "package/falcosecurity-libs/falcosecurity-libs-legacy/Config.in"
diff --git a/package/falcosecurity-libs/falcosecurity-libs-latest/Config.in b/package/falcosecurity-libs/falcosecurity-libs-latest/Config.in
index 2115e9a928..b020146107 100644
--- a/package/falcosecurity-libs/falcosecurity-libs-latest/Config.in
+++ b/package/falcosecurity-libs/falcosecurity-libs-latest/Config.in
@@ -1,3 +1,5 @@
+# falcosecurity-libs for 64-bit architectures, selected by
+# BR2_PACKAGE_FALCOSECURITY_LIBS
 config BR2_PACKAGE_FALCOSECURITY_LIBS_LATEST
 	bool
 	select BR2_PACKAGE_HAS_FALCOSECURITY_LIBS
diff --git a/package/falcosecurity-libs/falcosecurity-libs-legacy/0001-Add-cstdint-for-uintXX_t-types.patch b/package/falcosecurity-libs/falcosecurity-libs-legacy/0001-Add-cstdint-for-uintXX_t-types.patch
new file mode 100644
index 0000000000..627ba24ff2
--- /dev/null
+++ b/package/falcosecurity-libs/falcosecurity-libs-legacy/0001-Add-cstdint-for-uintXX_t-types.patch
@@ -0,0 +1,46 @@
+From 19de5426a76727e89c7e69ad2badec2ab57f0cf8 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 2 Feb 2023 20:18:27 -0800
+Subject: [PATCH] Add <cstdint> for uintXX_t types
+
+gcc 13 moved some includes around and as a result <cstdint> is no
+longer transitively included [1]. Explicitly include it
+for uintXX_t.
+
+[1] https://gcc.gnu.org/gcc-13/porting_to.html#header-dep-changes
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream: https://github.com/falcosecurity/libs/commit/1406858fa5223d980e66e2a5fb2c1b014c9db5c8
+Signed-off-by: Angelo Compagnucci <angelo.compagnucci@gmail.com>
+---
+ userspace/libsinsp/filter/parser.h | 1 +
+ userspace/libsinsp/filter_value.h  | 1 +
+ 2 files changed, 2 insertions(+)
+
+diff --git a/userspace/libsinsp/filter/parser.h b/userspace/libsinsp/filter/parser.h
+index 46cc9dd..88aed54 100644
+--- a/userspace/libsinsp/filter/parser.h
++++ b/userspace/libsinsp/filter/parser.h
+@@ -18,6 +18,7 @@ limitations under the License.
+ #pragma once
+ 
+ #include "ast.h"
++#include <cstdint>
+ 
+ namespace re2 { class RE2; };
+ 
+diff --git a/userspace/libsinsp/filter_value.h b/userspace/libsinsp/filter_value.h
+index 47f5367..bd5f202 100644
+--- a/userspace/libsinsp/filter_value.h
++++ b/userspace/libsinsp/filter_value.h
+@@ -18,6 +18,7 @@ limitations under the License.
+ #pragma once
+ 
+ #include <string.h>
++#include <cstdint>
+ #include <utility>
+ 
+ // Used for CO_IN/CO_PMATCH filterchecks using PT_CHARBUFs to allow
+-- 
+2.34.1
+
diff --git a/package/falcosecurity-libs/falcosecurity-libs-legacy/0002-fix-userspace-libsinsp-explicitly-include-cstdint-to.patch b/package/falcosecurity-libs/falcosecurity-libs-legacy/0002-fix-userspace-libsinsp-explicitly-include-cstdint-to.patch
new file mode 100644
index 0000000000..6cfd263853
--- /dev/null
+++ b/package/falcosecurity-libs/falcosecurity-libs-legacy/0002-fix-userspace-libsinsp-explicitly-include-cstdint-to.patch
@@ -0,0 +1,31 @@
+From 428a2cc72d8c0cc138808f019b834b69c3f54f06 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Holger=20Hoffst=C3=A4tte?= <holger@applied-asynchrony.com>
+Date: Tue, 20 Aug 2024 12:22:01 +0200
+Subject: [PATCH] fix(userspace/libsinsp): explicitly include <cstdint> to fix
+ build with gcc-15
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Holger Hoffstätte <holger@applied-asynchrony.com>
+Upstream: https://github.com/falcosecurity/libs/commit/9d76298020e9dbde6b5d8e4f36b17c1ad6a4a4c7
+Signed-off-by: Angelo Compagnucci <angelo.compagnucci@gmail.com>
+---
+ userspace/libsinsp/filter/ast.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/userspace/libsinsp/filter/ast.h b/userspace/libsinsp/filter/ast.h
+index ad9060e..73fce2e 100644
+--- a/userspace/libsinsp/filter/ast.h
++++ b/userspace/libsinsp/filter/ast.h
+@@ -17,6 +17,7 @@ limitations under the License.
+ 
+ #pragma once
+ 
++#include <cstdint>
+ #include <vector>
+ #include <string>
+ #include <algorithm>
+-- 
+2.34.1
+
diff --git a/package/falcosecurity-libs/falcosecurity-libs-legacy/0003-fix-missing-cstdint-include-to-fix-build-on-Alpine.patch b/package/falcosecurity-libs/falcosecurity-libs-legacy/0003-fix-missing-cstdint-include-to-fix-build-on-Alpine.patch
new file mode 100644
index 0000000000..6cf29aa8df
--- /dev/null
+++ b/package/falcosecurity-libs/falcosecurity-libs-legacy/0003-fix-missing-cstdint-include-to-fix-build-on-Alpine.patch
@@ -0,0 +1,27 @@
+From 911bdda4f2ca69135b98dd11fdc40123ee83fb8f Mon Sep 17 00:00:00 2001
+From: Stefan Reimer <stefan@zero-downtime.net>
+Date: Mon, 11 Mar 2024 16:45:55 +0000
+Subject: [PATCH] fix: missing cstdint include to fix build on Alpine
+
+Signed-off-by: Stefan Reimer <stefan@zero-downtime.net>
+Upstream: https://github.com/falcosecurity/libs/commit/2514b509ac873102b9266586e458c2f732ca9485
+Signed-off-by: Angelo Compagnucci <angelo.compagnucci@gmail.com>
+---
+ userspace/libsinsp/procfs_utils.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/userspace/libsinsp/procfs_utils.h b/userspace/libsinsp/procfs_utils.h
+index 4059d4d..1df956e 100644
+--- a/userspace/libsinsp/procfs_utils.h
++++ b/userspace/libsinsp/procfs_utils.h
+@@ -1,6 +1,7 @@
+ #pragma once
+ 
+ #include <istream>
++#include <cstdint>
+ #include <string>
+ 
+ namespace libsinsp {
+-- 
+2.34.1
+
diff --git a/package/falcosecurity-libs/falcosecurity-libs-legacy/0004-userspace-libsinsp-scap_open_exception.h-include-cst.patch b/package/falcosecurity-libs/falcosecurity-libs-legacy/0004-userspace-libsinsp-scap_open_exception.h-include-cst.patch
new file mode 100644
index 0000000000..291694bf33
--- /dev/null
+++ b/package/falcosecurity-libs/falcosecurity-libs-legacy/0004-userspace-libsinsp-scap_open_exception.h-include-cst.patch
@@ -0,0 +1,32 @@
+From c732d3db36a617d3a335cd42d94e78c5ac5cfcc9 Mon Sep 17 00:00:00 2001
+From: Angelo Compagnucci <angelo.compagnucci@gmail.com>
+Date: Fri, 30 Oct 2026 13:25:57 +0100
+Subject: [PATCH] userspace/libsinsp: scap_open_exception.h: include <cstdint>
+
+scap_open_exception.h uses int32_t without including <cstdint>, which
+fails to build with musl, where it isn't included by other headers:
+
+  scap_open_exception.h:28:65: error: 'int32_t' does not name a type
+
+Upstream: https://github.com/falcosecurity/libs/pull/3154
+Signed-off-by: Angelo Compagnucci <angelo.compagnucci@gmail.com>
+---
+ userspace/libsinsp/scap_open_exception.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/userspace/libsinsp/scap_open_exception.h b/userspace/libsinsp/scap_open_exception.h
+index 6877456..1614da9 100644
+--- a/userspace/libsinsp/scap_open_exception.h
++++ b/userspace/libsinsp/scap_open_exception.h
+@@ -16,6 +16,8 @@ limitations under the License.
+ */
+ #pragma once
+ 
++#include <cstdint>
++
+ #include "sinsp_exception.h"
+ 
+ /*!
+-- 
+2.34.1
+
diff --git a/package/falcosecurity-libs/falcosecurity-libs-legacy/Config.in b/package/falcosecurity-libs/falcosecurity-libs-legacy/Config.in
new file mode 100644
index 0000000000..546e8183a8
--- /dev/null
+++ b/package/falcosecurity-libs/falcosecurity-libs-legacy/Config.in
@@ -0,0 +1,12 @@
+# falcosecurity-libs for 32-bit architectures, selected by
+# BR2_PACKAGE_FALCOSECURITY_LIBS
+config BR2_PACKAGE_FALCOSECURITY_LIBS_LEGACY
+	bool
+	select BR2_PACKAGE_HAS_FALCOSECURITY_LIBS
+	select BR2_PACKAGE_JQ
+	select BR2_PACKAGE_JSONCPP
+	select BR2_PACKAGE_LIBB64
+	select BR2_PACKAGE_RE2
+	select BR2_PACKAGE_TBB
+	select BR2_PACKAGE_VALIJSON
+	select BR2_PACKAGE_ZLIB
diff --git a/package/falcosecurity-libs/falcosecurity-libs-legacy/falcosecurity-libs-legacy.hash b/package/falcosecurity-libs/falcosecurity-libs-legacy/falcosecurity-libs-legacy.hash
new file mode 100644
index 0000000000..ef805cbcf6
--- /dev/null
+++ b/package/falcosecurity-libs/falcosecurity-libs-legacy/falcosecurity-libs-legacy.hash
@@ -0,0 +1,5 @@
+# sha256 locally computed
+sha256  2a4b37c08bec4ba81326314831f341385aff267062e8d4483437958689662936  falcosecurity-libs-0.10.5.tar.gz
+sha256  21ec9433a87459b3477faf542bacec419dc03af841309eac35edeffe481cf10b  COPYING
+sha256  8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643  driver/GPL2.txt
+sha256  f17d3f2c2d565a74a7d5bf96f880c43701e141897e8dff0c8aa13e5d07aaf226  driver/MIT.txt
diff --git a/package/falcosecurity-libs/falcosecurity-libs-legacy/falcosecurity-libs-legacy.mk b/package/falcosecurity-libs/falcosecurity-libs-legacy/falcosecurity-libs-legacy.mk
new file mode 100644
index 0000000000..1d3bfd15a7
--- /dev/null
+++ b/package/falcosecurity-libs/falcosecurity-libs-legacy/falcosecurity-libs-legacy.mk
@@ -0,0 +1,50 @@
+################################################################################
+#
+# falcosecurity-libs-legacy
+#
+################################################################################
+
+FALCOSECURITY_LIBS_LEGACY_VERSION = 0.10.5
+FALCOSECURITY_LIBS_LEGACY_SITE = $(call github,falcosecurity,libs,$(FALCOSECURITY_LIBS_LEGACY_VERSION))
+FALCOSECURITY_LIBS_LEGACY_SOURCE = falcosecurity-libs-$(FALCOSECURITY_LIBS_LEGACY_VERSION).tar.gz
+FALCOSECURITY_LIBS_LEGACY_DL_SUBDIR = falcosecurity-libs
+FALCOSECURITY_LIBS_LEGACY_LICENSE = $(FALCOSECURITY_LIBS_LICENSE)
+FALCOSECURITY_LIBS_LEGACY_LICENSE_FILES = $(FALCOSECURITY_LIBS_LICENSE_FILES)
+FALCOSECURITY_LIBS_LEGACY_PROVIDES = falcosecurity-libs
+
+# The userspace components are not built here: sysdig builds them from
+# these sources, with these dependencies.
+FALCOSECURITY_LIBS_LEGACY_DEPENDENCIES = \
+	jq \
+	jsoncpp \
+	libb64 \
+	re2 \
+	tbb \
+	valijson \
+	zlib
+
+FALCOSECURITY_LIBS_LEGACY_MODULE_SUBDIRS = driver
+FALCOSECURITY_LIBS_LEGACY_MODULE_MAKE_OPTS = $(FALCOSECURITY_LIBS_MODULE_MAKE_OPTS)
+
+# The driver Makefile and driver_config.h are normally generated by the
+# driver CMakeLists.txt, which doesn't work well with the kernel-module
+# infrastructure, so generate them here. The API and schema versions
+# come from driver/API_VERSION and driver/SCHEMA_VERSION.
+define FALCOSECURITY_LIBS_LEGACY_GEN_DRIVER_FILES
+	sed 's/@KBUILD_FLAGS@//;s/@DRIVER_NAME@/$(FALCOSECURITY_LIBS_DRIVER_NAME)/' \
+		$(@D)/driver/Makefile.in > $(@D)/driver/Makefile
+	$(INSTALL) -m 0644 $(@D)/driver/driver_config.h.in $(@D)/driver/driver_config.h
+	for v in API SCHEMA; do \
+		IFS=. read -r major minor patch < $(@D)/driver/$${v}_VERSION; \
+		$(SED) "s/\$${PPM_$${v}_CURRENT_VERSION_MAJOR}/$${major}/;s/\$${PPM_$${v}_CURRENT_VERSION_MINOR}/$${minor}/;s/\$${PPM_$${v}_CURRENT_VERSION_PATCH}/$${patch}/" \
+			$(@D)/driver/driver_config.h; \
+	done
+	$(SED) 's/\$${DRIVER_VERSION}/$(FALCOSECURITY_LIBS_LEGACY_VERSION)/;s/\$${GIT_COMMIT}/$(FALCOSECURITY_LIBS_LEGACY_VERSION)/' \
+		$(@D)/driver/driver_config.h
+	$(SED) 's/\$${DRIVER_NAME}/$(FALCOSECURITY_LIBS_DRIVER_NAME)/;s/\$${DRIVER_DEVICE_NAME}/$(FALCOSECURITY_LIBS_DRIVER_NAME)/' \
+		$(@D)/driver/driver_config.h
+endef
+FALCOSECURITY_LIBS_LEGACY_POST_PATCH_HOOKS += FALCOSECURITY_LIBS_LEGACY_GEN_DRIVER_FILES
+
+$(eval $(kernel-module))
+$(eval $(generic-package))
diff --git a/package/falcosecurity-libs/falcosecurity-libs.mk b/package/falcosecurity-libs/falcosecurity-libs.mk
index 0437648383..f4303a3cdd 100644
--- a/package/falcosecurity-libs/falcosecurity-libs.mk
+++ b/package/falcosecurity-libs/falcosecurity-libs.mk
@@ -4,7 +4,10 @@
 #
 ################################################################################
 
-# falcosecurity-libs is provided by falcosecurity-libs-latest.
+# Since version 0.11.0, the userspace libraries only support 64-bit
+# architectures: falcosecurity-libs-latest provides falcosecurity-libs on
+# them, and falcosecurity-libs-legacy, the last version supporting
+# 32-bit architectures, on the others.
 
 FALCOSECURITY_LIBS_LICENSE = Apache-2.0 (userspace), MIT or GPL-2.0 (driver)
 FALCOSECURITY_LIBS_LICENSE_FILES = COPYING driver/MIT.txt driver/GPL2.txt
-- 
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  parent reply	other threads:[~2026-10-30 13:59 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-30 13:59 [Buildroot] [PATCH 1/9] package/uthash: new package Angelo Compagnucci
2026-10-30 13:59 ` [Buildroot] [PATCH 2/9] package/webrtc-audio-processing: fix build with musl Angelo Compagnucci
2026-10-30 13:59 ` [Buildroot] [PATCH 3/9] package/libabseil-cpp: allow building " Angelo Compagnucci
2026-10-30 13:59 ` [Buildroot] [PATCH 4/9] package/falcosecurity-libs: bump to version 0.21.0 Angelo Compagnucci
2026-10-30 13:59 ` [Buildroot] [PATCH 5/9] package/sysdig: bump to version 0.41.4 Angelo Compagnucci
2026-10-30 13:59 ` [Buildroot] [PATCH 6/9] package/falcosecurity-libs: convert to a virtual package Angelo Compagnucci
2026-10-30 13:59 ` [Buildroot] [PATCH 7/9] package/sysdig: " Angelo Compagnucci
2026-10-30 13:59 ` Angelo Compagnucci [this message]
2026-10-30 13:59 ` [Buildroot] [PATCH 9/9] package/sysdig: add sysdig-legacy Angelo Compagnucci
  -- strict thread matches above, loose matches on Subject: below --
2026-10-30 15:24 [Buildroot] [PATCH 1/9] package/uthash: new package Angelo Compagnucci
2026-10-30 15:24 ` [Buildroot] [PATCH 8/9] package/falcosecurity-libs: add falcosecurity-libs-legacy Angelo Compagnucci

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261030135916.3599219-8-angelo.compagnucci@gmail.com \
    --to=angelo.compagnucci@gmail.com \
    --cc=buildroot@buildroot.org \
    --cc=flaniel@linux.microsoft.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox