@@ -11,31 +11,6 @@ config BR2_PACKAGE_FLUENT_BIT
https://github.com/fluent/fluent-bit
-if BR2_PACKAGE_FLUENT_BIT
-
-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.
-
-comment "wasm runtime support needs a toolchain w/ C++"
- depends on BR2_PACKAGE_FLUENT_BIT_WASM_ARCH_SUPPORTS
- depends on !BR2_INSTALL_LIBSTDCPP
-
-endif
-
comment "fluent-bit needs a toolchain w/ threads, dynamic library"
depends on BR2_TOOLCHAIN_HAS_SYNC_4
depends on !BR2_TOOLCHAIN_HAS_THREADS || BR2_STATIC_LIBS
@@ -22,8 +22,36 @@ FLUENT_BIT_CONF_OPTS += \
-DFLB_PREFER_SYSTEM_LIBS=Yes \
-DFLB_BACKTRACE=No
-ifeq ($(BR2_PACKAGE_FLUENT_BIT_WASM),y)
-FLUENT_BIT_CONF_OPTS += -DFLB_WASM=Yes
+# WASM runtime support needs a toolchain w/ C++
+ifeq ($(BR2_INSTALL_LIBSTDCPP),y)
+ifeq ($(BR2_aarch64)$(BR2_aarch64_be),y)
+FLUENT_BIT_WAMR_BUILD_TARGET = AARCH64
+else ifeq ($(BR2_arcle)$(BR2_arceb),y)
+FLUENT_BIT_WAMR_BUILD_TARGET = ARC
+else ifeq ($(BR2_arm)$(BR2_armeb),y)
+FLUENT_BIT_WAMR_BUILD_TARGET = ARM
+else ifeq ($(BR2_mips)$(BR2_mipsel)$(BR2_mips64)$(BR2_mips64el),y)
+FLUENT_BIT_WAMR_BUILD_TARGET = MIPS
+# https://github.com/bytecodealliance/wasm-micro-runtime/issues/625
+# Fix unknown opcode 'ldc1', seen on mips32r2 and mips64r2.
+FLUENT_BIT_CONF_OPTS += \
+ -DWAMR_BUILD_INVOKE_NATIVE_GENERAL=1
+else ifeq ($(BR2_riscv)$(BR2_RISCV_32),yy)
+FLUENT_BIT_WAMR_BUILD_TARGET = RISCV32
+else ifeq ($(BR2_riscv)$(BR2_RISCV_64),yy)
+FLUENT_BIT_WAMR_BUILD_TARGET = RISCV64
+else ifeq ($(BR2_i386),y)
+FLUENT_BIT_WAMR_BUILD_TARGET = X86_32
+else ifeq ($(BR2_x86_64),y)
+FLUENT_BIT_WAMR_BUILD_TARGET = X86_64
+else ifeq ($(BR2_xtensa),y)
+FLUENT_BIT_WAMR_BUILD_TARGET = XTENSA
+endif
+endif
+
+ifneq ($(FLUENT_BIT_WAMR_BUILD_TARGET),)
+FLUENT_BIT_CONF_OPTS += -DFLB_WASM=Yes \
+ -DWAMR_BUILD_TARGET=$(FLUENT_BIT_WAMR_BUILD_TARGET)
else
FLUENT_BIT_CONF_OPTS += -DFLB_WASM=No
endif