From: Thomas Devoogdt <thomas@devoogdt.com>
To: buildroot@buildroot.org
Cc: Thomas Devoogdt <thomas@devoogdt.com>,
Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Subject: [Buildroot] [PATCH v4] package/fluent-bit: rework wasm handling
Date: Mon, 24 Jul 2023 14:04:42 +0200 [thread overview]
Message-ID: <20230724120442.191703-1-thomas@devoogdt.com> (raw)
In-Reply-To: <20230723092314.129079-4-thomas@devoogdt.com>
Fluent-bit isn't very great at supporting the various architectures,
so help a little bit by defining the WAMR_BUILD_TARGET ourselves.
Two failures for MIPS while executing ./utils/test-pkg:
- sourcery-mips64:
core/iwasm/common/arch/invokeNative_mips.s: Assembler messages:
core/iwasm/common/arch/invokeNative_mips.s:58: Error: opcode not supported on this processor: mips64r2 (mips64r2) `ldc1 $f12,0($sp)'
core/iwasm/common/arch/invokeNative_mips.s:59: Error: opcode not supported on this processor: mips64r2 (mips64r2) `ldc1 $f14,8($sp)'
make[4]: *** [src/wasm/CMakeFiles/vmlib-static.dir/build.make:495: src/wasm/CMakeFiles/vmlib-static.dir/__/__/lib/wasm-micro-runtime-WAMR-1.1.1/core/iwasm/common/arch/invokeNative_mips.s.o] Error 1
make[4]: *** Waiting for unfinished jobs....
- sourcery-mips:
core/iwasm/common/arch/invokeNative_mips.s: Assembler messages:
core/iwasm/common/arch/invokeNative_mips.s:58: Error: opcode not supported on this processor: mips32r2 (mips32r2) `ldc1 $f12,0($sp)'
core/iwasm/common/arch/invokeNative_mips.s:59: Error: opcode not supported on this processor: mips32r2 (mips32r2) `ldc1 $f14,8($sp)'
make[4]: *** [src/wasm/CMakeFiles/vmlib-static.dir/build.make:495: src/wasm/CMakeFiles/vmlib-static.dir/__/__/lib/wasm-micro-runtime-WAMR-1.1.1/core/iwasm/common/arch/invokeNative_mips.s.o] Error 1
make[4]: *** Waiting for unfinished jobs....
Which are fixed by setting the obscure flag "WAMR_BUILD_INVOKE_NATIVE_GENERAL".
See https://github.com/bytecodealliance/wasm-micro-runtime/issues/625 for more info:
“Hi, building the invokeNative_general.c explicitly is supported now, please pull the latest code and use
Signed-off-by: Thomas Devoogdt <thomas@devoogdt.com>
---
v2: No change.
v3: No change.
v4: Restore the BR2_PACKAGE_FLUENT_BIT_WASM_ARCH_SUPPORTS KConfig.
---
package/fluent-bit/Config.in | 20 +++++++++++++-------
package/fluent-bit/fluent-bit.mk | 12 +++++++++++-
2 files changed, 24 insertions(+), 8 deletions(-)
diff --git a/package/fluent-bit/Config.in b/package/fluent-bit/Config.in
index bfdea895b0..9ffde5b315 100644
--- a/package/fluent-bit/Config.in
+++ b/package/fluent-bit/Config.in
@@ -13,15 +13,21 @@ config BR2_PACKAGE_FLUENT_BIT
if BR2_PACKAGE_FLUENT_BIT
+config BR2_PACKAGE_FLUENT_BIT_WASM_ARCH
+ string
+ default "AARCH64" if BR2_aarch64 || BR2_aarch64be
+ default "ARC" if BR2_arcle || BR2_arceb
+ default "ARM" if BR2_arm || BR2_armeb
+ default "MIPS" if BR2_mips || BR2_mipsel || BR2_mips64 || BR2_mips64el
+ default "RISCV32" if BR2_riscv && BR2_RISCV_32
+ default "RISCV64" if BR2_riscv && BR2_RISCV_64
+ default "X86_32" if BR2_i386
+ default "X86_64" if BR2_x86_64
+ default "XTENSA" if BR2_xtensa
+
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
+ default y if BR2_PACKAGE_FLUENT_BIT_WASM_ARCH != ""
config BR2_PACKAGE_FLUENT_BIT_WASM
bool "wasm runtime support"
diff --git a/package/fluent-bit/fluent-bit.mk b/package/fluent-bit/fluent-bit.mk
index cd8f347768..1185860661 100644
--- a/package/fluent-bit/fluent-bit.mk
+++ b/package/fluent-bit/fluent-bit.mk
@@ -23,7 +23,17 @@ FLUENT_BIT_CONF_OPTS += \
-DFLB_BACKTRACE=No
ifeq ($(BR2_PACKAGE_FLUENT_BIT_WASM),y)
-FLUENT_BIT_CONF_OPTS += -DFLB_WASM=Yes
+FLUENT_BIT_WAMR_ARCH = $(call qstrip,$(BR2_PACKAGE_FLUENT_BIT_WASM_ARCH))
+
+# https://github.com/bytecodealliance/wasm-micro-runtime/issues/625
+# Fix unknown opcode 'ldc1', seen on mips32r2 and mips64r2.
+ifeq ($(FLUENT_BIT_WAMR_ARCH),MIPS)
+FLUENT_BIT_CONF_OPTS += \
+ -DWAMR_BUILD_INVOKE_NATIVE_GENERAL=1
+endif
+
+FLUENT_BIT_CONF_OPTS += -DFLB_WASM=Yes \
+ -DWAMR_BUILD_TARGET=$(FLUENT_BIT_WAMR_ARCH)
else
FLUENT_BIT_CONF_OPTS += -DFLB_WASM=No
endif
--
2.34.1
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
next prev parent reply other threads:[~2023-07-24 12:04 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-10 13:32 [Buildroot] [PATCH v2 1/4] package/fluent-bit: bump to version 2.1.4 Thomas Devoogdt
2023-06-10 13:32 ` [Buildroot] [PATCH v2 2/4] package/fluent-bit: use the system provided LuaJIT Thomas Devoogdt
2023-06-10 13:32 ` [Buildroot] [PATCH v2 3/4] package/fluent-bit: drop cxx handling Thomas Devoogdt
2023-06-10 13:32 ` [Buildroot] [PATCH v2 4/4] package/fluent-bit: rework wasm handling Thomas Devoogdt
2023-07-23 9:23 ` [Buildroot] [PATCH v3 1/4] package/fluent-bit: bump to version 2.1.7 Thomas Devoogdt
2023-07-23 9:23 ` [Buildroot] [PATCH v3 2/4] package/fluent-bit: use the system provided LuaJIT Thomas Devoogdt
2023-07-23 9:23 ` [Buildroot] [PATCH v3 3/4] package/fluent-bit: drop cxx handling Thomas Devoogdt
2023-07-23 9:23 ` [Buildroot] [PATCH v3 4/4] package/fluent-bit: rework wasm handling Thomas Devoogdt
2023-07-23 10:06 ` Thomas Petazzoni via buildroot
2023-07-24 8:29 ` Thomas Devoogdt
2023-07-24 8:45 ` Thomas Petazzoni via buildroot
2023-07-24 12:04 ` Thomas Devoogdt [this message]
2023-07-25 16:38 ` [Buildroot] [PATCH v4] " Thomas Petazzoni via buildroot
2023-07-23 10:01 ` [Buildroot] [PATCH v3 1/4] package/fluent-bit: bump to version 2.1.7 Thomas Petazzoni via buildroot
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=20230724120442.191703-1-thomas@devoogdt.com \
--to=thomas@devoogdt.com \
--cc=buildroot@buildroot.org \
--cc=thomas.petazzoni@bootlin.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