git: 036d56435f8a - main - x11-toolkits/qt6-declarative: Fix build on arm

From: Mikael Urankar <mikael_at_FreeBSD.org>
Date: Thu, 27 Jul 2023 08:33:47 UTC
The branch main has been updated by mikael:

URL: https://cgit.FreeBSD.org/ports/commit/?id=036d56435f8ae5209e4bd4bcf5d8c5f9bcca6307

commit 036d56435f8ae5209e4bd4bcf5d8c5f9bcca6307
Author:     Mikael Urankar <mikael@FreeBSD.org>
AuthorDate: 2023-07-26 17:32:15 +0000
Commit:     Mikael Urankar <mikael@FreeBSD.org>
CommitDate: 2023-07-27 08:33:38 +0000

    x11-toolkits/qt6-declarative: Fix build on arm
    
    Add the missing bits to build on arm.
    
    Reported by:    fluffy
    Tested by:      fluffy,mikael
    Approved by:    tcberner
---
 .../patch-src_3rdparty_masm_assembler_ARM64Assembler.h  | 11 +++++++++++
 .../patch-src_3rdparty_masm_assembler_ARMv7Assembler.h  | 11 +++++++++++
 .../files/patch-src_3rdparty_masm_wtf_Platform.h        | 17 +++++++++++++++++
 .../qt6-declarative/files/patch-src_qml_configure.cmake | 11 +++++++++++
 4 files changed, 50 insertions(+)

diff --git a/x11-toolkits/qt6-declarative/files/patch-src_3rdparty_masm_assembler_ARM64Assembler.h b/x11-toolkits/qt6-declarative/files/patch-src_3rdparty_masm_assembler_ARM64Assembler.h
new file mode 100644
index 000000000000..78aedc0e0026
--- /dev/null
+++ b/x11-toolkits/qt6-declarative/files/patch-src_3rdparty_masm_assembler_ARM64Assembler.h
@@ -0,0 +1,11 @@
+--- src/3rdparty/masm/assembler/ARM64Assembler.h.orig	2018-06-15 11:30:15 UTC
++++ src/3rdparty/masm/assembler/ARM64Assembler.h
+@@ -3036,6 +3036,8 @@ class ARM64Assembler { (public)
+             linuxPageFlush(current, current + page);
+ 
+         linuxPageFlush(current, end);
++#elif OS(FREEBSD)
++        __clear_cache(code, reinterpret_cast<char*>(code) + size);
+ #elif OS(QNX)
+ #if !ENABLE(ASSEMBLER_WX_EXCLUSIVE)
+         msync(code, size, MS_INVALIDATE_ICACHE);
diff --git a/x11-toolkits/qt6-declarative/files/patch-src_3rdparty_masm_assembler_ARMv7Assembler.h b/x11-toolkits/qt6-declarative/files/patch-src_3rdparty_masm_assembler_ARMv7Assembler.h
new file mode 100644
index 000000000000..29c5396f24f0
--- /dev/null
+++ b/x11-toolkits/qt6-declarative/files/patch-src_3rdparty_masm_assembler_ARMv7Assembler.h
@@ -0,0 +1,11 @@
+--- src/3rdparty/masm/assembler/ARMv7Assembler.h.orig	2018-06-15 11:30:15 UTC
++++ src/3rdparty/masm/assembler/ARMv7Assembler.h
+@@ -2372,6 +2372,8 @@ class ARMv7Assembler { (public)
+         UNUSED_PARAM(code);
+         UNUSED_PARAM(size);
+ #endif
++#elif OS(FREEBSD) && COMPILER(CLANG)
++	__clear_cache(code, reinterpret_cast<char*>(code) + size);
+ #else
+ #error "The cacheFlush support is missing on this platform."
+ #endif
diff --git a/x11-toolkits/qt6-declarative/files/patch-src_3rdparty_masm_wtf_Platform.h b/x11-toolkits/qt6-declarative/files/patch-src_3rdparty_masm_wtf_Platform.h
new file mode 100644
index 000000000000..d27be5097978
--- /dev/null
+++ b/x11-toolkits/qt6-declarative/files/patch-src_3rdparty_masm_wtf_Platform.h
@@ -0,0 +1,17 @@
+Due to a misspelling in GCC [1] (probably) the check for the ARMv6KZ platform
+used __ARM_ARCH_6ZK__ instead of __ARM_ARCH_6KZ__.
+
+Append the correct spellings to the checks for __ARM_ARCH_6ZK__.
+
+[1] https://gcc.gnu.org/ml/gcc-patches/2015-06/msg01679.html
+
+--- src/3rdparty/masm/wtf/Platform.h.orig	2018-06-15 11:30:15 UTC
++++ src/3rdparty/masm/wtf/Platform.h
+@@ -221,6 +221,7 @@
+ #elif defined(__ARM_ARCH_6__) \
+     || defined(__ARM_ARCH_6J__) \
+     || defined(__ARM_ARCH_6K__) \
++    || defined(__ARM_ARCH_6KZ__) \
+     || defined(__ARM_ARCH_6Z__) \
+     || defined(__ARM_ARCH_6ZK__) \
+     || defined(__ARM_ARCH_6T2__) \
diff --git a/x11-toolkits/qt6-declarative/files/patch-src_qml_configure.cmake b/x11-toolkits/qt6-declarative/files/patch-src_qml_configure.cmake
new file mode 100644
index 000000000000..c2f2bd6291a7
--- /dev/null
+++ b/x11-toolkits/qt6-declarative/files/patch-src_qml_configure.cmake
@@ -0,0 +1,11 @@
+--- src/qml/configure.cmake.orig	2023-07-26 19:30:31 UTC
++++ src/qml/configure.cmake
+@@ -117,7 +117,7 @@ qt_feature("qml-jit" PRIVATE
+     LABEL "QML just-in-time compiler"
+     PURPOSE "Provides a JIT for QML and JavaScript"
+     AUTODETECT NOT IOS AND NOT TVOS
+-    CONDITION ( ( ( TEST_architecture_arch STREQUAL i386 ) AND TEST_pointer_32bit AND QT_FEATURE_sse2 ) OR ( ( TEST_architecture_arch STREQUAL x86_64 ) AND TEST_pointer_64bit AND QT_FEATURE_sse2 ) OR ( ( TEST_architecture_arch STREQUAL arm ) AND TEST_pointer_32bit AND TEST_arm_fp AND TEST_arm_thumb AND ( ANDROID OR LINUX OR IOS OR TVOS OR QNX ) ) OR ( ( TEST_architecture_arch STREQUAL arm64 ) AND TEST_pointer_64bit AND TEST_arm_fp AND ( ANDROID OR LINUX OR IOS OR TVOS OR QNX OR INTEGRITY ) ) )
++    CONDITION ( ( ( TEST_architecture_arch STREQUAL i386 ) AND TEST_pointer_32bit AND QT_FEATURE_sse2 ) OR ( ( TEST_architecture_arch STREQUAL x86_64 ) AND TEST_pointer_64bit AND QT_FEATURE_sse2 ) OR ( ( TEST_architecture_arch STREQUAL arm ) AND TEST_pointer_32bit AND TEST_arm_fp AND TEST_arm_thumb AND ( FREEBSD OR ANDROID OR LINUX OR IOS OR TVOS OR QNX ) ) OR ( ( TEST_architecture_arch STREQUAL arm64 ) AND TEST_pointer_64bit AND TEST_arm_fp AND ( FREEBSD OR ANDROID OR LINUX OR IOS OR TVOS OR QNX OR INTEGRITY ) ) )
+ )
+ # special case begin
+ # When doing macOS universal builds, JIT needs to be disabled for the ARM slice.