add loongarch64 support for qt
This commit is contained in:
parent
921eb87858
commit
6f0f36347a
127
fix-build-error-for-loongarch64.patch
Normal file
127
fix-build-error-for-loongarch64.patch
Normal file
@ -0,0 +1,127 @@
|
|||||||
|
From a4ee1523dbcbd2e26e5c92298a612d60b204fd75 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Wenlong Zhang <zhangwenlong@loongson.cn>
|
||||||
|
Date: Wed, 17 May 2023 07:59:00 +0000
|
||||||
|
Subject: [PATCH] fix build error for loongarch64 test000
|
||||||
|
|
||||||
|
---
|
||||||
|
configure | 6 ++++++
|
||||||
|
mkspecs/linux-g++-64/qmake.conf | 4 ++--
|
||||||
|
mkspecs/solaris-g++-64/qmake.conf | 2 +-
|
||||||
|
src/3rdparty/webkit/Source/JavaScriptCore/wtf/Platform.h | 7 ++++++-
|
||||||
|
src/corelib/arch/loongarch64/arch.pri | 6 ++++++
|
||||||
|
src/corelib/arch/qatomic_arch.h | 2 ++
|
||||||
|
src/dbus/qdbusintegrator.cpp | 2 +-
|
||||||
|
7 files changed, 24 insertions(+), 5 deletions(-)
|
||||||
|
create mode 100644 src/corelib/arch/loongarch64/arch.pri
|
||||||
|
|
||||||
|
diff --git a/configure b/configure
|
||||||
|
index 226a602f..d3f10f08 100755
|
||||||
|
--- a/configure
|
||||||
|
+++ b/configure
|
||||||
|
@@ -3273,6 +3273,12 @@ if [ -z "${CFG_HOST_ARCH}" ]; then
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
+ *:*:loongarch64**)
|
||||||
|
+ if [ "$OPT_VERBOSE" = "yes" ]; then
|
||||||
|
+ echo " LoongArch64 (loongarch64)"
|
||||||
|
+ fi
|
||||||
|
+ CFG_HOST_ARCH=loongarch64
|
||||||
|
+ ;;
|
||||||
|
*:*:*)
|
||||||
|
if [ "$OPT_VERBOSE" = "yes" ]; then
|
||||||
|
echo " Trying '$UNAME_MACHINE'..."
|
||||||
|
diff --git a/mkspecs/linux-g++-64/qmake.conf b/mkspecs/linux-g++-64/qmake.conf
|
||||||
|
index 222f6b7e..dd129afd 100644
|
||||||
|
--- a/mkspecs/linux-g++-64/qmake.conf
|
||||||
|
+++ b/mkspecs/linux-g++-64/qmake.conf
|
||||||
|
@@ -12,8 +12,8 @@ CONFIG += qt warn_on release incremental link_prl gdb_dwarf_index
|
||||||
|
QT += core gui
|
||||||
|
QMAKE_INCREMENTAL_STYLE = sublib
|
||||||
|
|
||||||
|
-QMAKE_CFLAGS = -m64
|
||||||
|
-QMAKE_LFLAGS = -m64
|
||||||
|
+QMAKE_CFLAGS =
|
||||||
|
+QMAKE_LFLAGS =
|
||||||
|
|
||||||
|
include(../common/linux.conf)
|
||||||
|
include(../common/gcc-base-unix.conf)
|
||||||
|
diff --git a/mkspecs/solaris-g++-64/qmake.conf b/mkspecs/solaris-g++-64/qmake.conf
|
||||||
|
index 7bc7b9fd..2ecbaac8 100644
|
||||||
|
--- a/mkspecs/solaris-g++-64/qmake.conf
|
||||||
|
+++ b/mkspecs/solaris-g++-64/qmake.conf
|
||||||
|
@@ -36,7 +36,7 @@ QMAKE_LEX = flex
|
||||||
|
QMAKE_LEXFLAGS =
|
||||||
|
QMAKE_YACC = yacc
|
||||||
|
QMAKE_YACCFLAGS = -d
|
||||||
|
-QMAKE_CFLAGS = -m64 -D_XOPEN_SOURCE=500 -D__EXTENSIONS__
|
||||||
|
+QMAKE_CFLAGS = -D_XOPEN_SOURCE=500 -D__EXTENSIONS__
|
||||||
|
QMAKE_CFLAGS_DEPS = -M
|
||||||
|
QMAKE_CFLAGS_WARN_ON = -Wall -W
|
||||||
|
QMAKE_CFLAGS_WARN_OFF = -w
|
||||||
|
diff --git a/src/3rdparty/webkit/Source/JavaScriptCore/wtf/Platform.h b/src/3rdparty/webkit/Source/JavaScriptCore/wtf/Platform.h
|
||||||
|
index 635df39e..a9def901 100644
|
||||||
|
--- a/src/3rdparty/webkit/Source/JavaScriptCore/wtf/Platform.h
|
||||||
|
+++ b/src/3rdparty/webkit/Source/JavaScriptCore/wtf/Platform.h
|
||||||
|
@@ -236,6 +236,11 @@
|
||||||
|
#define WTF_CPU_X86_64 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
+/* CPU(LOONGARCH64) - LOONGARCH64 */
|
||||||
|
+#if defined(__loongarch64)
|
||||||
|
+#define WTF_CPU_LOONGARCH64 1
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
/* CPU(ARM) - ARM, any version*/
|
||||||
|
#if defined(arm) \
|
||||||
|
|| defined(__arm__) \
|
||||||
|
@@ -1012,7 +1017,7 @@
|
||||||
|
|| CPU(SPARC64) \
|
||||||
|
|| CPU(S390X) \
|
||||||
|
|| CPU(PPC64) \
|
||||||
|
- || CPU(MIPS64) || CPU(AARCH64)
|
||||||
|
+ || CPU(MIPS64) || CPU(AARCH64) || CPU(LOONGARCH64)
|
||||||
|
#define WTF_USE_JSVALUE64 1
|
||||||
|
#else
|
||||||
|
#define WTF_USE_JSVALUE32_64 1
|
||||||
|
diff --git a/src/corelib/arch/loongarch64/arch.pri b/src/corelib/arch/loongarch64/arch.pri
|
||||||
|
new file mode 100644
|
||||||
|
index 00000000..7fe8c602
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/src/corelib/arch/loongarch64/arch.pri
|
||||||
|
@@ -0,0 +1,6 @@
|
||||||
|
+#
|
||||||
|
+# LoongArch 64 architecture
|
||||||
|
+#
|
||||||
|
+
|
||||||
|
+unix:SOURCES += ../generic/qatomic_generic_unix.cpp
|
||||||
|
+win32:SOURCES += ../generic/qatomic_generic_windows.cpp
|
||||||
|
diff --git a/src/corelib/arch/qatomic_arch.h b/src/corelib/arch/qatomic_arch.h
|
||||||
|
index c91c20b3..d8b5a308 100644
|
||||||
|
--- a/src/corelib/arch/qatomic_arch.h
|
||||||
|
+++ b/src/corelib/arch/qatomic_arch.h
|
||||||
|
@@ -96,6 +96,8 @@ QT_BEGIN_HEADER
|
||||||
|
# include "QtCore/qatomic_generic.h"
|
||||||
|
#elif defined(QT_ARCH_AARCH64)
|
||||||
|
# include "QtCore/qatomic_aarch64.h"
|
||||||
|
+#elif defined(QT_ARCH_LOONGARCH64)
|
||||||
|
+# include "QtCore/qatomic_generic.h"
|
||||||
|
#else
|
||||||
|
# error "Qt has not been ported to this architecture"
|
||||||
|
#endif
|
||||||
|
diff --git a/src/dbus/qdbusintegrator.cpp b/src/dbus/qdbusintegrator.cpp
|
||||||
|
index eaf3e291..10b246ca 100644
|
||||||
|
--- a/src/dbus/qdbusintegrator.cpp
|
||||||
|
+++ b/src/dbus/qdbusintegrator.cpp
|
||||||
|
@@ -73,7 +73,7 @@ QT_BEGIN_NAMESPACE
|
||||||
|
static bool isDebugging;
|
||||||
|
#define qDBusDebug if (!::isDebugging); else qDebug
|
||||||
|
|
||||||
|
-Q_GLOBAL_STATIC_WITH_ARGS(const QString, orgFreedesktopDBusString, (QLatin1String(DBUS_SERVICE_DBUS)))
|
||||||
|
+Q_GLOBAL_STATIC_WITH_ARGS(QString, orgFreedesktopDBusString, (QLatin1String(DBUS_SERVICE_DBUS)))
|
||||||
|
|
||||||
|
static inline QString dbusServiceString()
|
||||||
|
{ return *orgFreedesktopDBusString(); }
|
||||||
|
--
|
||||||
|
2.33.0
|
||||||
|
|
||||||
13
qt.spec
13
qt.spec
@ -13,7 +13,7 @@
|
|||||||
Name: qt
|
Name: qt
|
||||||
Epoch: 1
|
Epoch: 1
|
||||||
Version: 4.8.7
|
Version: 4.8.7
|
||||||
Release: 53
|
Release: 54
|
||||||
Summary: A software toolkit for developing applications
|
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
|
License: (LGPLv2 with exceptions or GPLv3 with exceptions) and ASL 2.0 and BSD and FTL and MIT
|
||||||
URL: http://qt-project.org/
|
URL: http://qt-project.org/
|
||||||
@ -77,6 +77,9 @@ Patch45: qt-everywhere-opensource-src-4.8.7-openssl3.patch
|
|||||||
%ifarch riscv64
|
%ifarch riscv64
|
||||||
Patch46: qt-everywhere-opensource-src-4.8.7-riscv64.patch
|
Patch46: qt-everywhere-opensource-src-4.8.7-riscv64.patch
|
||||||
%endif
|
%endif
|
||||||
|
%ifarch loongarch64
|
||||||
|
Patch47: fix-build-error-for-loongarch64.patch
|
||||||
|
%endif
|
||||||
Patch6000: CVE-2018-19869.patch
|
Patch6000: CVE-2018-19869.patch
|
||||||
Patch6001: CVE-2018-19872.patch
|
Patch6001: CVE-2018-19872.patch
|
||||||
Patch6002: CVE-2018-19871.patch
|
Patch6002: CVE-2018-19871.patch
|
||||||
@ -169,8 +172,13 @@ RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS | sed 's|-fexceptions||g'`
|
|||||||
CXXFLAGS="$CXXFLAGS -std=gnu++98 -Wno-deprecated"
|
CXXFLAGS="$CXXFLAGS -std=gnu++98 -Wno-deprecated"
|
||||||
|
|
||||||
export LD_LIBRARY_PATH=$PWD/lib/
|
export LD_LIBRARY_PATH=$PWD/lib/
|
||||||
|
%ifarch loongarch64
|
||||||
|
export CXXFLAGS="$CXXFLAGS $RPM_OPT_FLAGS -fpermissive"
|
||||||
|
export CFLAGS="$CFLAGS $RPM_OPT_FLAGS -fpermissive"
|
||||||
|
%else
|
||||||
export CXXFLAGS="$CXXFLAGS $RPM_OPT_FLAGS"
|
export CXXFLAGS="$CXXFLAGS $RPM_OPT_FLAGS"
|
||||||
export CFLAGS="$CFLAGS $RPM_OPT_FLAGS"
|
export CFLAGS="$CFLAGS $RPM_OPT_FLAGS"
|
||||||
|
%endif
|
||||||
export LDFLAGS="$LDFLAGS $RPM_LD_FLAGS"
|
export LDFLAGS="$LDFLAGS $RPM_LD_FLAGS"
|
||||||
export PATH=$PWD/bin:$PATH
|
export PATH=$PWD/bin:$PATH
|
||||||
export QTDIR=$PWD
|
export QTDIR=$PWD
|
||||||
@ -456,6 +464,9 @@ fi
|
|||||||
%{_qt4_prefix}/examples/
|
%{_qt4_prefix}/examples/
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Mon May 8 2023 Wenlong Zhang <zhangwenlong@loongson.cn> - 1:4.8.7-54
|
||||||
|
- add loongarch64 support for qt
|
||||||
|
|
||||||
* Thu Feb 23 2023 misaka00251 <liuxin@iscas.ac.cn> - 1:4.8.7-53
|
* Thu Feb 23 2023 misaka00251 <liuxin@iscas.ac.cn> - 1:4.8.7-53
|
||||||
- Add riscv64 support
|
- Add riscv64 support
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user