git: 56f8ca40ae4e - main - sysutils/fluent-bit: fix build on powerpc*

From: Piotr Kubaj <pkubaj_at_FreeBSD.org>
Date: Thu, 09 Mar 2023 09:49:34 UTC
The branch main has been updated by pkubaj:

URL: https://cgit.FreeBSD.org/ports/commit/?id=56f8ca40ae4e185df5a6a022f60bfce787fd7112

commit 56f8ca40ae4e185df5a6a022f60bfce787fd7112
Author:     Piotr Kubaj <pkubaj@FreeBSD.org>
AuthorDate: 2023-03-09 09:49:11 +0000
Commit:     Piotr Kubaj <pkubaj@FreeBSD.org>
CommitDate: 2023-03-09 09:49:11 +0000

    sysutils/fluent-bit: fix build on powerpc*
    
    /wrkdirs/usr/ports/sysutils/fluent-bit/work/fluent-bit-2.0.9/lib/wasm-micro-runtime-WAMR-1.1.1/core/iwasm/common/arch/invokeNative_em64.s:63:5: error: invalid instruction, did you mean: crset, fre?
        ret
---
 .../files/patch-src_wamrc_CMakeLists.txt           | 27 ++++++++++++++++++++++
 .../fluent-bit/files/patch-src_wasm_CMakeLists.txt | 20 ++++++++++++++++
 2 files changed, 47 insertions(+)

diff --git a/sysutils/fluent-bit/files/patch-src_wamrc_CMakeLists.txt b/sysutils/fluent-bit/files/patch-src_wamrc_CMakeLists.txt
new file mode 100644
index 000000000000..c21901077dd1
--- /dev/null
+++ b/sysutils/fluent-bit/files/patch-src_wamrc_CMakeLists.txt
@@ -0,0 +1,27 @@
+--- src/wamrc/CMakeLists.txt.orig	2023-03-09 08:46:55 UTC
++++ src/wamrc/CMakeLists.txt
+@@ -32,14 +32,14 @@ if (NOT DEFINED WAMR_BUILD_TARGET)
+     set (WAMR_BUILD_TARGET "ARM")
+   elseif (CMAKE_SYSTEM_PROCESSOR STREQUAL "riscv64")
+     set (WAMR_BUILD_TARGET "RISCV64")
+-  elseif (CMAKE_SIZEOF_VOID_P EQUAL 8)
++  elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^(amd|x86_)64")
+     # Build as X86_64 by default in 64-bit platform
+     set (WAMR_BUILD_TARGET "X86_64")
+-  elseif (CMAKE_SIZEOF_VOID_P EQUAL 4)
++  elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^i.86")
+     # Build as X86_32 by default in 32-bit platform
+     set (WAMR_BUILD_TARGET "X86_32")
+   else ()
+-    message(SEND_ERROR "Unsupported build target platform!")
++    set(WAMR_BUILD_INVOKE_NATIVE_GENERAL 1)
+   endif ()
+ endif ()
+ 
+@@ -201,4 +201,4 @@ if (LLVM_FOUND)
+   endif()
+ else()
+   message(STATUS "LLVM is not found. WAMRC won't be built.")
+-endif ()
+\ No newline at end of file
++endif ()
diff --git a/sysutils/fluent-bit/files/patch-src_wasm_CMakeLists.txt b/sysutils/fluent-bit/files/patch-src_wasm_CMakeLists.txt
new file mode 100644
index 000000000000..e173a8cabc6a
--- /dev/null
+++ b/sysutils/fluent-bit/files/patch-src_wasm_CMakeLists.txt
@@ -0,0 +1,20 @@
+--- src/wasm/CMakeLists.txt.orig	2023-03-08 22:58:52 UTC
++++ src/wasm/CMakeLists.txt
+@@ -30,14 +30,14 @@ if (NOT DEFINED WAMR_BUILD_TARGET)
+     set (WAMR_BUILD_TARGET "ARM")
+   elseif (CMAKE_SYSTEM_PROCESSOR STREQUAL "riscv64")
+     set (WAMR_BUILD_TARGET "RISCV64")
+-  elseif (CMAKE_SIZEOF_VOID_P EQUAL 8)
++  elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^(amd|x86_)64")
+     # Build as X86_64 by default in 64-bit platform
+     set (WAMR_BUILD_TARGET "X86_64")
+-  elseif (CMAKE_SIZEOF_VOID_P EQUAL 4)
++  elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^i.86")
+     # Build as X86_32 by default in 32-bit platform
+     set (WAMR_BUILD_TARGET "X86_32")
+   else ()
+-    message(SEND_ERROR "Unsupported build target platform!")
++    set(WAMR_BUILD_INVOKE_NATIVE_GENERAL 1)
+   endif ()
+ endif ()
+