From 73d1c07658fb1ec8e9b2ef73814f31ec909256e3 Mon Sep 17 00:00:00 2001 From: Yihao Yan Date: Tue, 28 Oct 2025 22:59:02 -0400 Subject: [PATCH] fix the known error of gcc14 --- fix-the-known-error-of-gcc14.patch | 100 +++++++++++++++++++++++++++++ webkitgtk.spec | 13 +++- 2 files changed, 112 insertions(+), 1 deletion(-) create mode 100644 fix-the-known-error-of-gcc14.patch diff --git a/fix-the-known-error-of-gcc14.patch b/fix-the-known-error-of-gcc14.patch new file mode 100644 index 0000000..70dc91e --- /dev/null +++ b/fix-the-known-error-of-gcc14.patch @@ -0,0 +1,100 @@ +From ad207d4d83d755e6a5a29a290167916e051b18b0 Mon Sep 17 00:00:00 2001 +From: Laing Jian +Date: Sun, 28 Sep 2025 20:32:13 +0800 +Subject: [PATCH] RDC:ZXOS-1150157 Fix the known error of gcc14 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +[修复]修复gcc14编译webkitgtk组件时SIMD::bitAnd函数参数类型不匹配 + +Change-Id: Ib8ca7dc9b225f3623264c57c4a534c511b608d27 +--- + .../parser/HTMLDocumentParserFastPath.cpp | 22 +++++++++++++++++++ + .../inline/text/TextUtil.cpp | 8 +++++++ + 2 files changed, 30 insertions(+) + +diff --git a/Source/WebCore/html/parser/HTMLDocumentParserFastPath.cpp b/Source/WebCore/html/parser/HTMLDocumentParserFastPath.cpp +index 880abf6b..fea817fc 100644 +--- a/Source/WebCore/html/parser/HTMLDocumentParserFastPath.cpp ++++ b/Source/WebCore/html/parser/HTMLDocumentParserFastPath.cpp +@@ -491,7 +491,12 @@ private: + // '\r' => 0000 1101 + constexpr simde_uint8x16_t lowNibbleMask { '\0', 0, 0, 0, 0, 0, '&', 0, 0, 0, 0, 0, '<', '\r', 0, 0 }; + constexpr simde_uint8x16_t v0f = SIMD::splat8(0x0f); ++#if defined(SIMDE_RISCV_V_NATIVE) ++ auto inputConverted = simde_vandq_u8(input, v0f); ++ return SIMD::equal(simde_vqtbl1q_u8(lowNibbleMask, inputConverted), input); ++#else + return SIMD::equal(simde_vqtbl1q_u8(lowNibbleMask, SIMD::bitAnd(input, v0f)), input); ++#endif + }; + + std::span cursor; +@@ -505,7 +510,13 @@ private: + WTF_ALLOW_UNSAFE_BUFFER_USAGE_BEGIN + auto vectorMatch = [&](auto input) ALWAYS_INLINE_LAMBDA { + constexpr simde_uint8x16_t zeros = SIMD::splat8(0); ++#if defined(SIMDE_RISCV_V_NATIVE) ++ auto firstVector = vectorEquals8Bit(input.val[0]); ++ auto secondVector = SIMD::equal(input.val[1], zeros); ++ return SIMD::findFirstNonZeroIndex(SIMD::bitAnd(firstVector, secondVector)); ++#else + return SIMD::findFirstNonZeroIndex(SIMD::bitAnd(vectorEquals8Bit(input.val[0]), SIMD::equal(input.val[1], zeros))); ++#endif + }; + WTF_ALLOW_UNSAFE_BUFFER_USAGE_END + auto* it = SIMD::findInterleaved(start, vectorMatch, scalarMatch); +@@ -653,7 +664,12 @@ WTF_ALLOW_UNSAFE_BUFFER_USAGE_END + // '\r' => 0000 1101 + constexpr auto lowNibbleMask = quoteChar == '\'' ? simde_uint8x16_t { '\0', 0, 0, 0, 0, 0, '&', '\'', 0, 0, 0, 0, 0, '\r', 0, 0 } : simde_uint8x16_t { '\0', 0, '"', 0, 0, 0, '&', 0, 0, 0, 0, 0, 0, '\r', 0, 0 }; + constexpr auto v0f = SIMD::splat8(0x0f); ++#if defined(SIMDE_RISCV_V_NATIVE) ++ auto inputConverted = simde_vandq_u8(input, v0f); ++ return SIMD::equal(simde_vqtbl1q_u8(lowNibbleMask, inputConverted), input); ++#else + return SIMD::equal(simde_vqtbl1q_u8(lowNibbleMask, SIMD::bitAnd(input, v0f)), input); ++#endif + }; + + if constexpr (sizeof(CharacterType) == 1) { +@@ -666,7 +682,13 @@ WTF_ALLOW_UNSAFE_BUFFER_USAGE_END + WTF_ALLOW_UNSAFE_BUFFER_USAGE_BEGIN + auto vectorMatch = [&](auto input) ALWAYS_INLINE_LAMBDA { + constexpr simde_uint8x16_t zeros = SIMD::splat8(0); ++#if defined(SIMDE_RISCV_V_NATIVE) ++ auto firstVector = vectorEquals8Bit(input.val[0]); ++ auto secondVector = SIMD::equal(input.val[1], zeros); ++ return SIMD::findFirstNonZeroIndex(SIMD::bitAnd(firstVector, secondVector)); ++#else + return SIMD::findFirstNonZeroIndex(SIMD::bitAnd(vectorEquals8Bit(input.val[0]), SIMD::equal(input.val[1], zeros))); ++#endif + }; + WTF_ALLOW_UNSAFE_BUFFER_USAGE_END + auto* it = SIMD::findInterleaved(span, vectorMatch, scalarMatch); +diff --git a/Source/WebCore/layout/formattingContexts/inline/text/TextUtil.cpp b/Source/WebCore/layout/formattingContexts/inline/text/TextUtil.cpp +index ff021918..71b118f8 100644 +--- a/Source/WebCore/layout/formattingContexts/inline/text/TextUtil.cpp ++++ b/Source/WebCore/layout/formattingContexts/inline/text/TextUtil.cpp +@@ -545,10 +545,18 @@ bool TextUtil::containsStrongDirectionalityText(StringView text) + auto cond0 = SIMD::lessThan(input, c0590); + // General Punctuation such as curly quotes. + // ch >= 0x2010 && ch <= 0x2029 ++#if defined(SIMDE_RISCV_V_NATIVE) ++ auto cond1 = simde_vandq_u16(SIMD::greaterThanOrEqual(input, c2010), SIMD::lessThanOrEqual(input, c2029)); ++#else + auto cond1 = SIMD::bitAnd(SIMD::greaterThanOrEqual(input, c2010), SIMD::lessThanOrEqual(input, c2029)); ++#endif + // CJK etc., up to Surrogate Pairs. + // ch >= 0x206A && ch <= 0xD7FF ++#if defined(SIMDE_RISCV_V_NATIVE) ++ auto cond2 = simde_vandq_u16(SIMD::greaterThanOrEqual(input, c206A), SIMD::lessThanOrEqual(input, cD7FF)); ++#else + auto cond2 = SIMD::bitAnd(SIMD::greaterThanOrEqual(input, c206A), SIMD::lessThanOrEqual(input, cD7FF)); ++#endif + // Common in CJK. + // ch >= 0xFF00 && ch <= 0xFFFF + auto cond3 = SIMD::greaterThanOrEqual(input, cFF00); +-- +2.41.0 + diff --git a/webkitgtk.spec b/webkitgtk.spec index b916f83..fa92cbc 100644 --- a/webkitgtk.spec +++ b/webkitgtk.spec @@ -1,4 +1,4 @@ -%define anolis_release 1 +%define anolis_release 2 ## NOTE: Lots of files in various subdirectories have the same name (such as ## "LICENSE") so this short macro allows us to distinguish them by using their @@ -26,6 +26,7 @@ Source0: https://webkitgtk.org/releases/webkitgtk-%{version}.tar.xz Source1: https://webkitgtk.org/releases/webkitgtk-%{version}.tar.xz.asc Patch01: riscv-use-unknown-cpu.patch +Patch02: fix-the-known-error-of-gcc14.patch BuildRequires: bison @@ -259,6 +260,13 @@ files for developing applications that use JavaScript engine from webkit2gtk-4.1 %global optflags %(echo %{optflags} | sed 's/-mbranch-protection=standard /-mbranch-protection=pac-ret /') %endif +%ifarch riscv64 +%define gcc_version %(gcc -dumpversion | cut -d. -f1) +%if "%{gcc_version}" == "14" +%global optflags %(echo '%{optflags}' | sed 's/-O2/-O1/g; s/-O3/-O1/g') -D__riscv_v_fixed_vlen=128 -mrvv-vector-bits=zvl +%endif +%endif + %define _vpath_builddir %{_vendor}-%{_target_os}-build/webkitgtk-6.0 %cmake \ -GNinja \ @@ -455,6 +463,9 @@ export NINJA_STATUS="[2/2][%f/%t %es] " %endif %changelog +* Wed Oct 29 2025 Yihao Yan - 2.48.3-2 +- fix the known error of gcc14 + * Thu Jul 31 2025 tomcruiseqi - 2.48.3-1 - Update to 2.48.3 to fix CVE-2024-54658 CVE-2024-40794 CVE-2024-27856 -- Gitee