summaryrefslogtreecommitdiffstats
path: root/meta-oe
diff options
context:
space:
mode:
authorPatrick Wicki <patrick.wicki@siemens.com>2024-10-21 23:36:25 +0200
committerKhem Raj <raj.khem@gmail.com>2024-10-21 20:54:48 -0700
commit9ec451426752e3ec29649612470949594796dd11 (patch)
tree70d4e6f6157c86e14c252fb6a95967592431dbce /meta-oe
parentb2c86b47f0e77ba67dc3ed63bf9cabca64b5f879 (diff)
downloadmeta-openembedded-9ec451426752e3ec29649612470949594796dd11.tar.gz
fluentbit: fix building with wasm support
Patch the cmake config of the wasm micro runtime dependency. This fixes the build for x86 by avoiding the cmake try_run() which cannot be invoked in cross-compiling mode. Signed-off-by: Patrick Wicki <patrick.wicki@siemens.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-oe')
-rw-r--r--meta-oe/recipes-extended/fluentbit/fluentbit/0004-wasm-avoid-cmake-try_run-when-cross-compiling.patch42
-rw-r--r--meta-oe/recipes-extended/fluentbit/fluentbit_3.1.9.bb1
2 files changed, 43 insertions, 0 deletions
diff --git a/meta-oe/recipes-extended/fluentbit/fluentbit/0004-wasm-avoid-cmake-try_run-when-cross-compiling.patch b/meta-oe/recipes-extended/fluentbit/fluentbit/0004-wasm-avoid-cmake-try_run-when-cross-compiling.patch
new file mode 100644
index 0000000000..419e85903d
--- /dev/null
+++ b/meta-oe/recipes-extended/fluentbit/fluentbit/0004-wasm-avoid-cmake-try_run-when-cross-compiling.patch
@@ -0,0 +1,42 @@
1From 5b6d274664f92a6c6083f4d27a1b1604a326f22c Mon Sep 17 00:00:00 2001
2From: Patrick Wicki <patrick.wicki@siemens.com>
3Date: Sat, 5 Oct 2024 21:36:12 +0200
4Subject: [PATCH] wasm: avoid cmake try_run when cross-compiling for x86
5
6This fixes building the wasm micro runtime used when enabling wasm
7support in fluentbit.
8cmake try_run does not work when cross-compiling because the test program
9cannot be executed:
10
11| CMake Error: try_run() invoked in cross-compiling mode, please set the following cache variables appropriately:
12| TEST_WRGSBASE_RESULT (advanced)
13| For details see .../fluentbit/3.1.9/build/TryRunResults.cmake
14| Write linear memory base addr to x86 GS register disabled
15| -- Configuring incomplete, errors occurred!
16
17Since we cannot run the test program, assume that the instruction is not
18available and disable the option.
19
20This patch is no longer needed once fluentbit updates WAMR, as it's been
21fixed in https://github.com/bytecodealliance/wasm-micro-runtime/pull/3066.
22
23Upstream-Status: Pending [https://github.com/fluent/fluent-bit/pull/8744]
24
25Signed-off-by: Patrick Wicki <patrick.wicki@siemens.com>
26---
27 .../build-scripts/config_common.cmake | 2 +-
28 1 file changed, 1 insertion(+), 1 deletion(-)
29
30diff --git a/lib/wasm-micro-runtime-WAMR-1.3.0/build-scripts/config_common.cmake b/lib/wasm-micro-runtime-WAMR-1.3.0/build-scripts/config_common.cmake
31index e73ebc85f..c2504e007 100644
32--- a/lib/wasm-micro-runtime-WAMR-1.3.0/build-scripts/config_common.cmake
33+++ b/lib/wasm-micro-runtime-WAMR-1.3.0/build-scripts/config_common.cmake
34@@ -408,7 +408,7 @@ if (WAMR_BUILD_STATIC_PGO EQUAL 1)
35 add_definitions (-DWASM_ENABLE_STATIC_PGO=1)
36 message (" AOT static PGO enabled")
37 endif ()
38-if (WAMR_DISABLE_WRITE_GS_BASE EQUAL 1)
39+if (WAMR_DISABLE_WRITE_GS_BASE EQUAL 1 OR CMAKE_CROSSCOMPILING)
40 add_definitions (-DWASM_DISABLE_WRITE_GS_BASE=1)
41 message (" Write linear memory base addr to x86 GS register disabled")
42 elseif (WAMR_BUILD_TARGET STREQUAL "X86_64"
diff --git a/meta-oe/recipes-extended/fluentbit/fluentbit_3.1.9.bb b/meta-oe/recipes-extended/fluentbit/fluentbit_3.1.9.bb
index f96e1a7edc..a70534e91c 100644
--- a/meta-oe/recipes-extended/fluentbit/fluentbit_3.1.9.bb
+++ b/meta-oe/recipes-extended/fluentbit/fluentbit_3.1.9.bb
@@ -23,6 +23,7 @@ SRC_URI = "\
23 file://0001-lib-Do-not-use-private-makefile-targets-in-CMakelist.patch \ 23 file://0001-lib-Do-not-use-private-makefile-targets-in-CMakelist.patch \
24 file://0002-flb_info.h.in-Do-not-hardcode-compilation-directorie.patch \ 24 file://0002-flb_info.h.in-Do-not-hardcode-compilation-directorie.patch \
25 file://0003-CMakeLists.txt-Revise-init-manager-deduction.patch \ 25 file://0003-CMakeLists.txt-Revise-init-manager-deduction.patch \
26 file://0004-wasm-avoid-cmake-try_run-when-cross-compiling.patch \
26" 27"
27SRC_URI:append:libc-musl = "\ 28SRC_URI:append:libc-musl = "\
28 file://0004-chunkio-Link-with-fts-library-with-musl.patch \ 29 file://0004-chunkio-Link-with-fts-library-with-musl.patch \