diff --git a/add-sw_64-support.patch b/add-sw_64-support.patch new file mode 100644 index 0000000000000000000000000000000000000000..8b8e369377d45202d486162f5bcc7a6193c446fe --- /dev/null +++ b/add-sw_64-support.patch @@ -0,0 +1,119 @@ +From f5658974493db0685638cfb2b2a306f50f9d484a Mon Sep 17 00:00:00 2001 +From: Hailiang +Date: Wed, 15 Oct 2025 16:41:18 +0800 +Subject: [PATCH] add sw_64 support + +--- + configure | 9 +++++++++ + .../javascriptcore/JavaScriptCore/wtf/Platform.h | 7 ++++++- + src/3rdparty/webkit/Source/JavaScriptCore/wtf/Platform.h | 6 ++++++ + src/corelib/arch/qatomic_arch.h | 2 ++ + src/corelib/arch/sw_64/arch.pri | 7 +++++++ + 5 files changed, 30 insertions(+), 1 deletion(-) + create mode 100644 src/corelib/arch/sw_64/arch.pri + +diff --git a/configure b/configure +index 718ab650..4b40a02a 100755 +--- a/configure ++++ b/configure +@@ -3263,6 +3263,12 @@ if [ -z "${CFG_HOST_ARCH}" ]; then + fi + CFG_HOST_ARCH=arm + ;; ++ *:*:sw*64*) ++ if [ "$OPT_VERBOSE" = "yes" ]; then ++ echo " SW_64" ++ fi ++ CFG_HOST_ARCH=sw_64 ++ ;; + Linux:*:sparc*) + if [ "$OPT_VERBOSE" = "yes" ]; then + echo " Linux on SPARC" +@@ -3346,6 +3352,9 @@ arm*) + mips*) + CFG_ARCH=mips + ;; ++sw_64) ++ CFG_ARCH=sw_64 ++ ;; + esac + + if [ -d "$relpath/src/corelib/arch/$CFG_ARCH" ]; then +diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h +index eca1a3cf..7698e09a 100644 +--- a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h ++++ b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h +@@ -148,6 +148,11 @@ + #define WTF_CPU_BIG_ENDIAN 1 + #endif + ++/* CPU(SW_64) - sw_64 */ ++#if defined(__sw_64__) ++#define WTF_CPU_SW_64 1 ++#endif ++ + /* CPU(PPC) - PowerPC 32-bit */ + #if defined(__ppc__) \ + || defined(__PPC__) \ +@@ -915,7 +920,7 @@ + #endif + + #if !defined(WTF_USE_JSVALUE64) && !defined(WTF_USE_JSVALUE32) && !defined(WTF_USE_JSVALUE32_64) +-#if (CPU(X86_64) && (OS(UNIX) || OS(WINDOWS) || OS(SOLARIS) || OS(HPUX))) || (CPU(IA64) && !CPU(IA64_32)) || CPU(ALPHA) || CPU(AIX64) || CPU(SPARC64) || CPU(MIPS64) || CPU(AARCH64) || CPU(S390X) ++#if (CPU(X86_64) && (OS(UNIX) || OS(WINDOWS) || OS(SOLARIS) || OS(HPUX))) || (CPU(IA64) && !CPU(IA64_32)) || CPU(ALPHA) || CPU(AIX64) || CPU(SPARC64) || CPU(MIPS64) || CPU(AARCH64) || CPU(S390X) || CPU(SW_64) + #define WTF_USE_JSVALUE64 1 + #elif CPU(ARM) || CPU(PPC64) + #define WTF_USE_JSVALUE32 1 +diff --git a/src/3rdparty/webkit/Source/JavaScriptCore/wtf/Platform.h b/src/3rdparty/webkit/Source/JavaScriptCore/wtf/Platform.h +index 4a70f638..f4e25b97 100644 +--- a/src/3rdparty/webkit/Source/JavaScriptCore/wtf/Platform.h ++++ b/src/3rdparty/webkit/Source/JavaScriptCore/wtf/Platform.h +@@ -187,6 +187,11 @@ + #define WTF_CPU_BIG_ENDIAN 1 + #endif + ++/* CPU(SW_64) - sw_64 */ ++#if defined(__sw_64__) ++#define WTF_CPU_SW_64 1 ++#endif ++ + /* CPU(SH4) - SuperH SH-4 */ + #if defined(__SH4__) + #define WTF_CPU_SH4 1 +@@ -1021,6 +1026,7 @@ + || CPU(ALPHA) \ + || CPU(SPARC64) \ + || CPU(S390X) \ ++ || CPU(SW_64) \ + || CPU(PPC64) \ + || CPU(MIPS64) || CPU(AARCH64) || CPU(RISCV64) || CPU(LOONGARCH64) + #define WTF_USE_JSVALUE64 1 +diff --git a/src/corelib/arch/qatomic_arch.h b/src/corelib/arch/qatomic_arch.h +index e64739ce..9ae84f4b 100644 +--- a/src/corelib/arch/qatomic_arch.h ++++ b/src/corelib/arch/qatomic_arch.h +@@ -100,6 +100,8 @@ QT_BEGIN_HEADER + # include "QtCore/qatomic_generic.h" + #elif defined(QT_ARCH_LOONGARCH64) + # include "QtCore/qatomic_generic.h" ++#elif defined(QT_ARCH_SW_64) ++# include "QtCore/qatomic_generic.h" + #else + # error "Qt has not been ported to this architecture" + #endif +diff --git a/src/corelib/arch/sw_64/arch.pri b/src/corelib/arch/sw_64/arch.pri +new file mode 100644 +index 00000000..1518d4fa +--- /dev/null ++++ b/src/corelib/arch/sw_64/arch.pri +@@ -0,0 +1,7 @@ ++# ++# SW_64 architecture ++# ++ ++# note: even though we use inline assembler with gcc, we always ++# include the compiled version to keep binary compatibility ++*-64:SOURCES += ../generic/qatomic_generic_unix.cpp +-- +2.20.1 + diff --git a/qt.spec b/qt.spec index 8c2d3fdcdc7279b9679a2b15bc71a8fedd7d7c8d..81426b689a0d320ebb9582d8d964f11489a43f0b 100644 --- a/qt.spec +++ b/qt.spec @@ -1,7 +1,7 @@ %if "%{?__isa_bits}" == "64" %define platform linux-g++-64 %endif -%ifarch x86_64 aarch64 riscv64 +%ifarch x86_64 aarch64 riscv64 sw_64 %define platform linux-g++ %endif %define _qt4_prefix %{_libdir}/qt4 @@ -13,7 +13,7 @@ Name: qt Epoch: 1 Version: 4.8.7 -Release: 63 +Release: 64 Summary: A software toolkit for developing applications License: (LGPLv2 with exceptions or GPLv3 with exceptions) and ASL 2.0 and BSD and FTL and MIT URL: https://www.qt.io/ @@ -75,10 +75,11 @@ Patch43: stack-protector.patch Patch44: 0001-Redo-the-Q_FOREACH-loop-control-without-GCC-statemen.patch Patch45: qt-everywhere-opensource-src-4.8.7-openssl3.patch Patch46: qt-everywhere-opensource-src-4.8.7-riscv64.patch -Patch47: fix-build-error-for-loongarch64.patch +Patch47: fix-build-error-for-loongarch64.patch Patch48: fix-build-error-about-messagemodel.patch # https://codereview.qt-project.org/c/qt/qtscript/+/308863 Patch49: fix-lto-build.patch +Patch50: add-sw_64-support.patch Patch6000: CVE-2018-19869.patch Patch6001: CVE-2018-19872.patch Patch6002: CVE-2018-19871.patch @@ -161,8 +162,8 @@ if [ "%{_lib}" == "lib64" ] ; then sed -i -e "s,/lib /usr/lib,/%{_lib} /usr/%{_lib},g" config.tests/{unix,x11}/*.test fi -# No -m64/-m32 on RISC-V and loongarch64 -%ifarch loongarch64 riscv64 +# No -m64/-m32 on RISC-V and loongarch64 and sw_64 +%ifarch loongarch64 riscv64 sw_64 sed -i -e 's,-m32,,' mkspecs/linux-g++-32/qmake.conf sed -i -e 's,-m64,,' mkspecs/linux-g++-64/qmake.conf %endif @@ -442,6 +443,9 @@ fi %{_qt4_prefix}/examples/ %changelog +* Wed Oct 15 2025 mahailiang - 1:4.8.7-64 +- add sw_64 support + * Fri Jan 24 2025 Funda Wang - 1:4.8.7-63 - fix build with icu 76