From 24d38498dcbf535a5490c255dd8784852d5e0119 Mon Sep 17 00:00:00 2001 From: Jingyun Hua Date: Mon, 12 Dec 2022 01:53:49 +0000 Subject: [PATCH] add loongarch64 support Signed-off-by: Jingyun Hua --- add-loongarch64-support.patch | 40 +++++++++++++++++++++++++++++++++++ qt5-qtbase.spec | 7 +++++- 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 add-loongarch64-support.patch diff --git a/add-loongarch64-support.patch b/add-loongarch64-support.patch new file mode 100644 index 0000000..7f5bef0 --- /dev/null +++ b/add-loongarch64-support.patch @@ -0,0 +1,40 @@ +diff --git a/src/3rdparty/double-conversion/include/double-conversion/utils.h b/src/3rdparty/double-conversion/include/double-conversion/utils.h +index 70e697ca..9be294a2 100644 +--- a/src/3rdparty/double-conversion/include/double-conversion/utils.h ++++ b/src/3rdparty/double-conversion/include/double-conversion/utils.h +@@ -102,6 +102,7 @@ int main(int argc, char** argv) { + defined(__AARCH64EL__) || defined(__aarch64__) || defined(__AARCH64EB__) || \ + defined(__riscv) || \ + defined(__or1k__) || defined(__arc__) || \ ++ defined(__loongarch64) || \ + defined(__EMSCRIPTEN__) + #define DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS 1 + #elif defined(__mc68000__) || \ +diff --git a/src/corelib/global/archdetect.cpp b/src/corelib/global/archdetect.cpp +index 1d00b7f5..74f3c8fc 100644 +--- a/src/corelib/global/archdetect.cpp ++++ b/src/corelib/global/archdetect.cpp +@@ -59,6 +59,8 @@ + # define ARCH_PROCESSOR "x86_64" + #elif defined(Q_PROCESSOR_IA64) + # define ARCH_PROCESSOR "ia64" ++#elif defined(Q_PROCESSOR_LOONGARCH_64) ++# define ARCH_PROCESSOR "loongarch64" + #elif defined(Q_PROCESSOR_MIPS_64) + # define ARCH_PROCESSOR "mips64" + #elif defined(Q_PROCESSOR_MIPS) +diff --git a/src/corelib/global/qprocessordetection.h b/src/corelib/global/qprocessordetection.h +index 8d657208..69f84a15 100644 +--- a/src/corelib/global/qprocessordetection.h ++++ b/src/corelib/global/qprocessordetection.h +@@ -223,6 +223,10 @@ + # define Q_PROCESSOR_WORDSIZE 8 + // Q_BYTE_ORDER not defined, use endianness auto-detection + ++#elif defined(__loongarch64) ++# define Q_PROCESSOR_LOONGARCH_64 ++# define Q_PROCESSOR_WORDSIZE 8 ++ + /* + MIPS family, known revisions: I, II, III, IV, 32, 64 + diff --git a/qt5-qtbase.spec b/qt5-qtbase.spec index 86d5173..8f64cf4 100644 --- a/qt5-qtbase.spec +++ b/qt5-qtbase.spec @@ -34,7 +34,7 @@ BuildRequires: pkgconfig(libsystemd) Name: qt5-qtbase Summary: Qt5 - QtBase components Version: 5.15.2 -Release: 4 +Release: 5 # See LGPL_EXCEPTIONS.txt, for exception details @@ -113,6 +113,7 @@ Patch0018: 0001-modify-kwin_5.18-complier-error.patch Patch0019: CVE-2021-38593.patch Patch0020: CVE-2022-25255.patch Patch0021: qt5-qtbase-Add-sw64-architecture.patch +Patch0022: add-loongarch64-support.patch # Do not check any files in %%{_qt5_plugindir}/platformthemes/ for requires. # Those themes are there for platform integration. If the required libraries are # not there, the platform to integrate with isn't either. Then Qt will just @@ -369,6 +370,7 @@ Qt5 libraries used for drawing widgets and OpenGL items. %patch0019 -p1 %patch0020 -p1 %patch0021 -p1 +%patch0022 -p1 # move some bundled libs to ensure they're not accidentally used pushd src/3rdparty mkdir UNUSED @@ -1010,6 +1012,9 @@ fi %changelog +* Mon Dec 12 2022 huajingyun - 5.15.2-5 +- add loongarch64 support + * Tue Oct 25 2022 wuzx - 5.15.2-4 - Add sw64 architecture -- Gitee