Skip to contentSkip to conversation

package/fluent-bit: only require a C compiler

PATCH In review Thomas Devoogdt 2 participants 7 messages Jan 30, 2023 – Feb 1, 2023

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/3 package/fluent-bit: only require a C compiler

From: Thomas Devoogdt <[email protected]>

Fixes:
- http://autobuild.buildroot.net/results/007/007c7c69e54b8ff663891da4535e2e95d40c42a2/build-end.log
- http://autobuild.buildroot.net/results/ede/ede6f9fb67c0c26ff02e71a3d20e3d4344ea59f0/build-end.log

---
 ...eLists.txt-only-require-a-C-compiler.patch | 27 +++++++++++++++++++
 1 file changed, 27 insertions(+)
 create mode 100644 package/fluent-bit/0001-CMakeLists.txt-only-require-a-C-compiler.patch
package/fluent-bit/0001-CMakeLists.txt-only-require-a-C-compiler.patch new file +27 -0
new file mode 100644
index 0000000000..6f2bf36e9b
@@ -0,0 +1,27 @@
+From 9559c23121c7eee94fe2d7bb37ad9505ee03327e Mon Sep 17 00:00:00 2001
+From: Thomas Devoogdt <[email protected]>
+Date: Mon, 30 Jan 2023 09:10:37 +0100
+Subject: [PATCH] CMakeLists.txt: only require a C compiler
+
+Fluent-bit is mostly written in C,
+so don't require CXX in the top-level project.
+
+Signed-off-by: Thomas Devoogdt <[email protected]>
+---
+ CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index ac1b9cd75..45f7bb85d 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -1,5 +1,5 @@
+ cmake_minimum_required(VERSION 3.12)
+-project(fluent-bit)
++project(fluent-bit C)
+ 
+ # CMP0069 ensures that LTO is enabled for all compilers
+ cmake_policy(SET CMP0069 NEW)
+-- 
+2.39.0
+
Signature · 6 lines
2.39.0

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

PATCH v3 2/3 package/fluent-bit: fix -latomic on various platforms

From: Thomas Devoogdt <[email protected]>

/home/thomas/br-test-pkg/bootlin-nios2-glibc/host/opt/ext-toolchain/bin/../lib/gcc/nios2-buildroot-linux-gnu/10.3.0/../../../../nios2-buildroot-linux-gnu/bin/ld: /tmp/fluent-bit.6F9rEA.ltrans28.ltrans.o: undefined reference to symbol '__atomic_compare_exchange_8@@LIBATOMIC_1.0' /home/thomas/br-test-pkg/bootlin-nios2-glibc/host/opt/ext-toolchain/bin/../lib/gcc/nios2-buildroot-linux-gnu/10.3.0/../../../../nios2-buildroot-linux-gnu/bin/ld: /home/thomas/br-test-pkg/bootlin-nios2-glibc/host/nios2-buildroot-linux-gnu/sysroot/lib/libatomic.so.1: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status

---
 package/fluent-bit/fluent-bit.mk | 6 ++++++
 1 file changed, 6 insertions(+)
package/fluent-bit/fluent-bit.mk +6 -0
index f7727834dd..c84042a0fa 100644
@@ -41,6 +41,12 @@ FLUENT_BIT_CONF_OPTS += \
 	-DCMAKE_C_FLAGS="$(TARGET_CFLAGS) -U_FILE_OFFSET_BITS" \
 	-DCMAKE_CXX_FLAGS="$(TARGET_CXXFLAGS) -U_FILE_OFFSET_BITS"
 
+# Uses __atomic_compare_exchange_8
+ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
+FLUENT_BIT_CONF_OPTS += \
+	-DCMAKE_EXE_LINKER_FLAGS=-latomic
+endif
+
 define FLUENT_BIT_INSTALL_INIT_SYSV
 	$(INSTALL) -D -m 0755 package/fluent-bit/S99fluent-bit \
 		$(TARGET_DIR)/etc/init.d/S99fluent-bit
Signature · 6 lines
2.39.0

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

Re: [Buildroot] [PATCH v3 2/3] package/fluent-bit: fix -latomic on various platforms

Quoted 11 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Devoogdt <[email protected]> writes:

From: Thomas Devoogdt <[email protected]> /home/thomas/br-test-pkg/bootlin-nios2-glibc/host/opt/ext-toolchain/bin/../lib/gcc/nios2-buildroot-linux-gnu/10.3.0/../../../../nios2-buildroot-linux-gnu/bin/ld:
/tmp/fluent-bit.6F9rEA.ltrans28.ltrans.o: undefined reference to
symbol '__atomic_compare_exchange_8@@LIBATOMIC_1.0' /home/thomas/br-test-pkg/bootlin-nios2-glibc/host/opt/ext-toolchain/bin/../lib/gcc/nios2-buildroot-linux-gnu/10.3.0/../../../../nios2-buildroot-linux-gnu/bin/ld:
/home/thomas/br-test-pkg/bootlin-nios2-glibc/host/nios2-buildroot-linux-gnu/sysroot/lib/libatomic.so.1:
error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status

Quoted 1 line

Committed, thanks.

Signature · 5 lines
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#3 lore raw

PATCH v3 3/3 package/fluent-bit: needs arch support and C++ for wasm

In reply to Thomas Devoogdt

From: Thomas Devoogdt <[email protected]>

See:
https://github.com/fluent/fluent-bit/tree/master/lib/wasm-micro-runtime-WAMR-1.1.1#supported-architectures-and-platforms

MIPS & RISCV32 are mentioned in the supported list, but that seems to be wrong, so excluded those.

Fixes:
- http://autobuild.buildroot.org/results/dfb/dfb8f71d7e016cdfd3beb4b8196081898bd49ae2/build-end.log
- http://autobuild.buildroot.org/results/ecf/ecfe7b67af68cd7f397a50360900cd9a7afc830e/build-end.log

---
 package/fluent-bit/Config.in     | 15 +++++++++++++++
 package/fluent-bit/fluent-bit.mk |  6 ++++++
 2 files changed, 21 insertions(+)
package/fluent-bit/Config.in +15 -0
index 11ceb55d4f..50437cab60 100644
@@ -10,3 +10,18 @@ config BR2_PACKAGE_FLUENT_BIT
 
 comment "fluent-bit needs a glibc toolchain"
 	depends on !BR2_TOOLCHAIN_USES_GLIBC
+
+if BR2_PACKAGE_FLUENT_BIT
+
+config BR2_PACKAGE_FLUENT_BIT_WASM
+	bool "Build with WASM runtime support"
+	depends on BR2_INSTALL_LIBSTDCPP
+	# see lib/wasm-micro-runtime-WAMR-1.1.1/README.md#supported-architectures-and-platforms
+	default y if BR2_arc
+	default y if BR2_arm || BR2_armeb
+	default y if BR2_aarch64 || BR2_aarch64_be
+	default y if BR2_i386 || BR2_x86_64
+	default y if BR2_RISCV_64
+	default y if BR2_xtensa
+
+endif
package/fluent-bit/fluent-bit.mk +6 -0
index c84042a0fa..6e9a33e02e 100644
@@ -17,6 +17,12 @@ FLUENT_BIT_CONF_OPTS += \
 	-DFLB_CHUNK_TRACE=No \
 	-DFLB_BACKTRACE=No
 
+ifeq ($(BR2_PACKAGE_FLUENT_BIT_WASM),y)
+FLUENT_BIT_CONF_OPTS += -DFLB_WASM=Yes
+else
+FLUENT_BIT_CONF_OPTS += -DFLB_WASM=No
+endif
+
 ifeq ($(BR2_PACKAGE_LUAJIT),y)
 FLUENT_BIT_CONF_OPTS += -DFLB_LUAJIT=Yes
 FLUENT_BIT_DEPENDENCIES += luajit
Signature · 6 lines
2.39.0

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

Re: [Buildroot] [PATCH v3 3/3] package/fluent-bit: needs arch support and C++ for wasm

Quoted 30 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Devoogdt <[email protected]> writes:

From: Thomas Devoogdt <[email protected]>
See:
https://github.com/fluent/fluent-bit/tree/master/lib/wasm-micro-runtime-WAMR-1.1.1#supported-architectures-and-platforms

MIPS & RISCV32 are mentioned in the supported list, but that seems to be wrong, so excluded those.

Fixes:
- http://autobuild.buildroot.org/results/dfb/dfb8f71d7e016cdfd3beb4b8196081898bd49ae2/build-end.log
- http://autobuild.buildroot.org/results/ecf/ecfe7b67af68cd7f397a50360900cd9a7afc830e/build-end.log

---
 package/fluent-bit/Config.in     | 15 +++++++++++++++
 package/fluent-bit/fluent-bit.mk |  6 ++++++
 2 files changed, 21 insertions(+)
package/fluent-bit/Config.in +3 -0
index 11ceb55d4f..50437cab60 100644
@@ -10,3 +10,18 @@ config BR2_PACKAGE_FLUENT_BIT
 
 comment "fluent-bit needs a glibc toolchain"
 	depends on !BR2_TOOLCHAIN_USES_GLIBC
+
+if BR2_PACKAGE_FLUENT_BIT
+

package/fluent-bit/Config.in config BR2_PACKAGE_FLUENT_BIT · line 25

Quoted 10 lines
package/fluent-bit/Config.in +10 -0
+config BR2_PACKAGE_FLUENT_BIT_WASM
+	bool "Build with WASM runtime support"
+	depends on BR2_INSTALL_LIBSTDCPP
+	# see lib/wasm-micro-runtime-WAMR-1.1.1/README.md#supported-architectures-and-platforms
+	default y if BR2_arc
+	default y if BR2_arm || BR2_armeb
+	default y if BR2_aarch64 || BR2_aarch64_be
+	default y if BR2_i386 || BR2_x86_64
+	default y if BR2_RISCV_64
+	default y if BR2_xtensa

I know that Yann suggested this, but it doesn't work. We cannot mix the arch dependencies like this with an option with a prompt, because the user can still manually enable the option on an unsupported architecture.

You were also missing some help text and I think this "filters written in WASM" feature is quite unlikely to be used, so I changed it to default off with:

config BR2_PACKAGE_FLUENT_BIT_WASM_ARCH_SUPPORTS
bool
# see lib/wasm-micro-runtime-WAMR-1.1.1/README.md#supported-architectures-and-platforms default y if BR2_arc
default y if BR2_arm || BR2_armeb
default y if BR2_aarch64 || BR2_aarch64_be
default y if BR2_i386 || BR2_x86_64
default y if BR2_RISCV_64
default y if BR2_xtensa

config BR2_PACKAGE_FLUENT_BIT_WASM
bool "wasm runtime support"
depends on BR2_INSTALL_LIBSTDCPP
depends on BR2_PACKAGE_FLUENT_BIT_WASM_ARCH_SUPPORTS help
Support for WASM-based plugins.

And committed, thanks.

Signature · 5 lines
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#5 lore raw

Re: [Buildroot] [PATCH v3 3/3] package/fluent-bit: needs arch support and C++ for wasm

Hi,

There was indeed a reason why I first did it otherwise, I was a little bit confused at first, but the solution with a blind option indeed seems to be the only right solution. Thx for fixing this up!

kr,

Thomas Devoogdt

Op wo 1 feb. 2023 om 08:23 schreef Peter Korsgaard <[email protected]>:

Quoted 68 lines
Quoted 31 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

"Thomas" == Thomas Devoogdt <[email protected]> writes:

From: Thomas Devoogdt <[email protected]>
See:
https://github.com/fluent/fluent-bit/tree/master/lib/wasm-micro-runtime-WAMR-1.1.1#supported-architectures-and-platforms

MIPS & RISCV32 are mentioned in the supported list, but that seems to be wrong, so excluded those.

Fixes:
- http://autobuild.buildroot.org/results/dfb/dfb8f71d7e016cdfd3beb4b8196081898bd49ae2/build-end.log
- http://autobuild.buildroot.org/results/ecf/ecfe7b67af68cd7f397a50360900cd9a7afc830e/build-end.log

---
 package/fluent-bit/Config.in     | 15 +++++++++++++++
 package/fluent-bit/fluent-bit.mk |  6 ++++++
 2 files changed, 21 insertions(+)
package/fluent-bit/Config.in +3 -0
index 11ceb55d4f..50437cab60 100644
@@ -10,3 +10,18 @@ config BR2_PACKAGE_FLUENT_BIT
 
 comment "fluent-bit needs a glibc toolchain"
     depends on !BR2_TOOLCHAIN_USES_GLIBC
+
+if BR2_PACKAGE_FLUENT_BIT
+

package/fluent-bit/Config.in config BR2_PACKAGE_FLUENT_BIT · line 25

Quoted 10 lines
package/fluent-bit/Config.in +10 -0
+config BR2_PACKAGE_FLUENT_BIT_WASM
+    bool "Build with WASM runtime support"
+    depends on BR2_INSTALL_LIBSTDCPP
+    # see lib/wasm-micro-runtime-WAMR-1.1.1/README.md#supported-architectures-and-platforms
+    default y if BR2_arc
+    default y if BR2_arm || BR2_armeb
+    default y if BR2_aarch64 || BR2_aarch64_be
+    default y if BR2_i386 || BR2_x86_64
+    default y if BR2_RISCV_64
+    default y if BR2_xtensa

I know that Yann suggested this, but it doesn't work. We cannot mix the arch dependencies like this with an option with a prompt, because the user can still manually enable the option on an unsupported architecture.

You were also missing some help text and I think this "filters written in WASM" feature is quite unlikely to be used, so I changed it to default off with:

config BR2_PACKAGE_FLUENT_BIT_WASM_ARCH_SUPPORTS
bool
# see lib/wasm-micro-runtime-WAMR-1.1.1/README.md#supported-architectures-and-platforms default y if BR2_arc
default y if BR2_arm || BR2_armeb
default y if BR2_aarch64 || BR2_aarch64_be
default y if BR2_i386 || BR2_x86_64
default y if BR2_RISCV_64
default y if BR2_xtensa

config BR2_PACKAGE_FLUENT_BIT_WASM
bool "wasm runtime support"
depends on BR2_INSTALL_LIBSTDCPP
depends on BR2_PACKAGE_FLUENT_BIT_WASM_ARCH_SUPPORTS help
Support for WASM-based plugins.

Quoted 4 lines

And committed, thanks.

--
Bye, Peter Korsgaard

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

#6 lore raw
In reply to Thomas Devoogdt
Quoted 8 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Devoogdt <[email protected]> writes:

From: Thomas Devoogdt <[email protected]>
Fixes:
- http://autobuild.buildroot.net/results/007/007c7c69e54b8ff663891da4535e2e95d40c42a2/build-end.log
- http://autobuild.buildroot.net/results/ede/ede6f9fb67c0c26ff02e71a3d20e3d4344ea59f0/build-end.log

This has now been merged, so I've replaced this with the upstream commit and committed, thanks.

Signature · 5 lines
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot