diff mbox series

[v2,3/3] package/fluent-bit: needs arch support for wasm

Message ID 20230129094530.884944-3-thomas.devoogdt@barco.com
State Changes Requested
Headers show
Series [v2,1/3] package/fluent-bit: needs C++ | expand

Commit Message

Thomas Devoogdt Jan. 29, 2023, 9:45 a.m. UTC
From: Thomas Devoogdt <thomas.devoogdt@gmail.com>

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.

Signed-off-by: Thomas Devoogdt <thomas.devoogdt@gmail.com>
---
v1 --> v2:
 - added package/ prefix to the git message

 package/fluent-bit/Config.in     | 11 +++++++++++
 package/fluent-bit/fluent-bit.mk |  6 ++++++
 2 files changed, 17 insertions(+)

Comments

Yann E. MORIN Jan. 29, 2023, 4:01 p.m. UTC | #1
\Thomas, All,

On 2023-01-29 10:45 +0100, Thomas Devoogdt spake thusly:
> From: Thomas Devoogdt <thomas.devoogdt@gmail.com>
> 
> 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.
> 
> Signed-off-by: Thomas Devoogdt <thomas.devoogdt@gmail.com>
> ---
> v1 --> v2:
>  - added package/ prefix to the git message
> 
>  package/fluent-bit/Config.in     | 11 +++++++++++
>  package/fluent-bit/fluent-bit.mk |  6 ++++++
>  2 files changed, 17 insertions(+)
> 
> diff --git a/package/fluent-bit/Config.in b/package/fluent-bit/Config.in
> index bd89c05faa..0ed69e09ce 100644
> --- a/package/fluent-bit/Config.in
> +++ b/package/fluent-bit/Config.in
> @@ -11,3 +11,14 @@ config BR2_PACKAGE_FLUENT_BIT
>  
>  comment "fluent-bit needs a glibc toolchain w/ C++"
>  	depends on !BR2_TOOLCHAIN_USES_GLIBC || !BR2_INSTALL_LIBSTDCPP
> +
> +if BR2_PACKAGE_FLUENT_BIT
> +
> +config BR2_PACKAGE_FLUENT_BIT_WASM
> +	bool "Build with WASM runtime support"
> +	default y
> +	# see lib/wasm-micro-runtime-WAMR-1.1.1/README.md#supported-architectures-and-platforms
> +	depends on BR2_i386 || BR2_x86_64 || BR2_arm || BR2_armeb || BR2_aarch64 || BR2_aarch64_be || \
> +		(BR2_riscv && BR2_RISCV_64) || BR2_xtensa || BR2_arc

Long lists are not nice. You can achieve a better look with;

    config BR2_PACKAGE_FLUENT_BIT_WASM
        bool "WASM runtime support"
        depends in BR2_INSTALL_LIBSTDCPP
        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

Note that the C++ dependency from my review on patch 1/3 should fit
here.

Also, BR2_RISCV_64 can only be set if BR2_riscv is already set, so
"BR2_riscv && BR2_RISCV_64 == BR2_RISCV_64".

Regards,
Yann E. MORIN.

> +endif
> diff --git a/package/fluent-bit/fluent-bit.mk b/package/fluent-bit/fluent-bit.mk
> index c84042a0fa..6e9a33e02e 100644
> --- a/package/fluent-bit/fluent-bit.mk
> +++ b/package/fluent-bit/fluent-bit.mk
> @@ -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
> -- 
> 2.39.0
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
diff mbox series

Patch

diff --git a/package/fluent-bit/Config.in b/package/fluent-bit/Config.in
index bd89c05faa..0ed69e09ce 100644
--- a/package/fluent-bit/Config.in
+++ b/package/fluent-bit/Config.in
@@ -11,3 +11,14 @@  config BR2_PACKAGE_FLUENT_BIT
 
 comment "fluent-bit needs a glibc toolchain w/ C++"
 	depends on !BR2_TOOLCHAIN_USES_GLIBC || !BR2_INSTALL_LIBSTDCPP
+
+if BR2_PACKAGE_FLUENT_BIT
+
+config BR2_PACKAGE_FLUENT_BIT_WASM
+	bool "Build with WASM runtime support"
+	default y
+	# see lib/wasm-micro-runtime-WAMR-1.1.1/README.md#supported-architectures-and-platforms
+	depends on BR2_i386 || BR2_x86_64 || BR2_arm || BR2_armeb || BR2_aarch64 || BR2_aarch64_be || \
+		(BR2_riscv && BR2_RISCV_64) || BR2_xtensa || BR2_arc
+
+endif
diff --git a/package/fluent-bit/fluent-bit.mk b/package/fluent-bit/fluent-bit.mk
index c84042a0fa..6e9a33e02e 100644
--- a/package/fluent-bit/fluent-bit.mk
+++ b/package/fluent-bit/fluent-bit.mk
@@ -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