[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#897667: qt4-x11: Please add support for new architecture "riscv64"



Source: qt4-x11
Version: 4:4.8.7+dfsg-15
Severity: normal
Tags: patch upstream
User: debian-riscv@lists.debian.org
Usertags: riscv64

Hello,

We need support in this package to bootstrap the riscv64 architecture.

Yes, I know that you want to get rid of Qt4 once and for all and ASAP, and I
fully agree with the goal.  However, a bazillion of packages depend on qt4-x11
indirectly, for example libsdl2 needs it (through fcitx, then
cmake-extra-modules, then qt5-qmake, then qtchooser that depends on Qt4 stuff);
many package still need it directly; etc.

So without support in this package, progress becomes impossible at an early
stage.


I am attaching a patch that adds support for the architecture.  AFAIK (please
confirm) upstream doesn't accept patches since long ago, so no point in sending
it there.  For Qt5 we're already sending it upstream, e.g. webkit stuff.

It would be great if you could include these changes and release a new version
for unstable, for the time being the patched version lives in "unreleased".


Thanks and cheers.
--
Manuel A. Fernandez Montecelo <mafm@debian.org>
diff -Nru qt4-x11-4.8.7+dfsg/debian/changelog qt4-x11-4.8.7+dfsg/debian/changelog
--- qt4-x11-4.8.7+dfsg/debian/changelog	2018-04-18 22:45:31.000000000 +0200
+++ qt4-x11-4.8.7+dfsg/debian/changelog	2018-04-27 21:01:58.000000000 +0200
@@ -1,3 +1,10 @@
+qt4-x11 (4:4.8.7+dfsg-15+0.riscv64.1) unreleased; urgency=medium
+
+  * Non-maintainer upload.
+  * riscv64 support
+
+ -- Manuel A. Fernandez Montecelo <mafm@debian.org>  Fri, 27 Apr 2018 21:01:58 +0200
+
 qt4-x11 (4:4.8.7+dfsg-15) unstable; urgency=medium
 
   * Actually upload it to unstable.
diff -Nru qt4-x11-4.8.7+dfsg/debian/patches/riscv64-support.patch qt4-x11-4.8.7+dfsg/debian/patches/riscv64-support.patch
--- qt4-x11-4.8.7+dfsg/debian/patches/riscv64-support.patch	1970-01-01 01:00:00.000000000 +0100
+++ qt4-x11-4.8.7+dfsg/debian/patches/riscv64-support.patch	2018-04-27 21:01:58.000000000 +0200
@@ -0,0 +1,86 @@
+--- a/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h
++++ b/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Platform.h
+@@ -167,6 +167,15 @@
+ #define WTF_CPU_BIG_ENDIAN 1
+ #endif
+ 
++/* CPU(RISCV64) - RISC-V 64-bit */
++#if defined(__riscv)
++#if (__riscv_xlen == 64)
++#define WTF_CPU_RISCV64 1
++#elif (__riscv_xlen == 32)
++#define WTF_CPU_RISCV32 1
++#endif
++#endif
++
+ /* CPU(SH4) - SuperH SH-4 */
+ #if defined(__SH4__)
+ #define WTF_CPU_SH4 1
+@@ -919,7 +928,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(RISCV64)
+ #define WTF_USE_JSVALUE64 1
+ #elif CPU(ARM) || CPU(PPC64)
+ #define WTF_USE_JSVALUE32 1
+--- a/src/3rdparty/webkit/Source/JavaScriptCore/wtf/Platform.h
++++ b/src/3rdparty/webkit/Source/JavaScriptCore/wtf/Platform.h
+@@ -187,6 +187,15 @@
+ #define WTF_CPU_BIG_ENDIAN 1
+ #endif
+ 
++/* CPU(RISCV64) - RISC-V 64-bit */
++#if defined(__riscv)
++#if (__riscv_xlen == 64)
++#define WTF_CPU_RISCV64 1
++#elif (__riscv_xlen == 32)
++#define WTF_CPU_RISCV32 1
++#endif
++#endif
++
+ /* CPU(SH4) - SuperH SH-4 */
+ #if defined(__SH4__)
+ #define WTF_CPU_SH4 1
+@@ -1000,6 +1009,7 @@
+ #if (CPU(X86_64) && (OS(UNIX) || OS(WINDOWS))) \
+     || (CPU(IA64) && !CPU(IA64_32)) \
+     || CPU(ALPHA) \
++    || CPU(RISCV64) \
+     || CPU(SPARC64) \
+     || CPU(S390X) \
+     || CPU(PPC64) \
+--- a/src/corelib/arch/qatomic_arch.h
++++ b/src/corelib/arch/qatomic_arch.h
+@@ -76,6 +76,8 @@
+ #  include "QtCore/qatomic_parisc.h"
+ #elif defined(QT_ARCH_POWERPC)
+ #  include "QtCore/qatomic_powerpc.h"
++#elif defined(QT_ARCH_RISCV64)
++#  include "QtCore/qatomic_generic.h"
+ #elif defined(QT_ARCH_S390)
+ #  include "QtCore/qatomic_s390.h"
+ #elif defined(QT_ARCH_SPARC)
+--- /dev/null
++++ b/src/corelib/arch/riscv64/arch.pri
+@@ -0,0 +1,8 @@
++#
++# RISC-V 64 architecture
++#
++
++unix:SOURCES += ../generic/qatomic_generic_unix.cpp
++win32:SOURCES += ../generic/qatomic_generic_windows.cpp
++
++QMAKE_CXXFLAGS += -fpermissive
+--- a/src/dbus/qdbusintegrator.cpp
++++ b/src/dbus/qdbusintegrator.cpp
+@@ -73,7 +73,7 @@
+ 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(); }
diff -Nru qt4-x11-4.8.7+dfsg/debian/patches/series qt4-x11-4.8.7+dfsg/debian/patches/series
--- qt4-x11-4.8.7+dfsg/debian/patches/series	2017-08-15 20:11:06.000000000 +0200
+++ qt4-x11-4.8.7+dfsg/debian/patches/series	2018-04-27 20:46:10.000000000 +0200
@@ -64,3 +64,4 @@
 add-mate-support.patch
 add-lxde-support.patch
 openssl_1.1.patch
+riscv64-support.patch
diff -Nru qt4-x11-4.8.7+dfsg/debian/rules qt4-x11-4.8.7+dfsg/debian/rules
--- qt4-x11-4.8.7+dfsg/debian/rules	2017-08-15 20:11:06.000000000 +0200
+++ qt4-x11-4.8.7+dfsg/debian/rules	2018-04-27 20:36:19.000000000 +0200
@@ -69,8 +69,8 @@
 ifeq ($(DEB_HOST_ARCH_OS),linux)
   ifneq (,$(filter $(DEB_HOST_ARCH),alpha ia64 mips64 mips64el))
 	platform_arg = linux-g++
-  else ifeq ($(DEB_HOST_ARCH),arm64)
-	# arm64 does not uses -m64, so avoid linux-g++-64.
+  else ifneq (,$(filter $(DEB_HOST_ARCH),arm64 riscv64))
+	# arm64 and riscv64 do not use -m64, so avoid linux-g++-64.
 	platform_arg = linux-g++
   else ifeq ($(DEB_HOST_ARCH_BITS),64)
 	platform_arg = linux-g++-64
@@ -85,7 +85,7 @@
   endif
 endif
 
-no_pch_architectures := arm64 armhf ia64 powerpc powerpcspe ppc64 ppc64el
+no_pch_architectures := arm64 armhf ia64 powerpc powerpcspe ppc64 ppc64el riscv64
 ifeq ($(DEB_HOST_ARCH),$(findstring $(DEB_HOST_ARCH), $(no_pch_architectures)))
 	extra_configure_opts += -no-pch
 endif

Reply to: