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

Bug#1054569: qtbase-opensource-src: FTBFS: Please add support for loongarch64



Source: qtbase-opensource-src
Version: 5.15.10+dfsg-4
Severity: wishlist
Tags: ftbfs patch
User: debian-loongarch@lists.debian.org
Usertags: loong64

Dear maintainers,

We need to add architectural support for qtbase-opensource-src.
Otherwise it will cause test cases failures for other packages which depend qtbase-opensource-src. For example, the kpackage now has a build status of Build-Attempted. Please see the detail message at [1].

BTW, A recent query revealed that LoongArch architecture is now supported by the upstream [2]. Please consider the patch I have attached. Or pull full support from upstream. Would it be possible to include the support for LoongArch in the next upload?
If you have any questions, you can contact me at any time.

[1]:https://buildd.debian.org/status/package.php?p=kpackage&suite=sid
[2]:https://github.com/qt/qtbase

thanks,
Dandan Zhang
Description: Add support for loongarch64. 
---
Last-Update: 2023-10-07

--- qtbase-opensource-src-5.15.10+dfsg.orig/src/3rdparty/double-conversion/include/double-conversion/utils.h
+++ qtbase-opensource-src-5.15.10+dfsg/src/3rdparty/double-conversion/include/double-conversion/utils.h
@@ -93,6 +93,7 @@ int main(int argc, char** argv) {
 #if defined(_M_X64) || defined(__x86_64__) || \
     defined(__ARMEL__) || defined(__avr32__) || defined(_M_ARM) || defined(_M_ARM64) || \
     defined(__hppa__) || defined(__ia64__) || \
+    defined(__loongarch__) || \
     defined(__mips__) || \
     defined(__powerpc__) || defined(__ppc__) || defined(__ppc64__) || \
     defined(_POWER) || defined(_ARCH_PPC) || defined(_ARCH_PPC64) || \
--- qtbase-opensource-src-5.15.10+dfsg.orig/src/3rdparty/forkfd/forkfd_linux.c
+++ qtbase-opensource-src-5.15.10+dfsg/src/3rdparty/forkfd/forkfd_linux.c
@@ -82,7 +82,7 @@ static int sys_clone(unsigned long clone
     return syscall(__NR_clone, cloneflags, child_stack, stack_size, ptid, newtls, ctid);
 #elif defined(__arc__) || defined(__arm__) || defined(__aarch64__) || defined(__mips__) || \
     defined(__nds32__) || defined(__hppa__) || defined(__powerpc__) || defined(__i386__) || \
-    defined(__x86_64__) || defined(__xtensa__) || defined(__alpha__) || defined(__riscv)
+    defined(__x86_64__) || defined(__xtensa__) || defined(__alpha__) || defined(__riscv) || defined(__loongarch__)
     /* ctid and newtls are inverted on CONFIG_CLONE_BACKWARDS architectures,
      * but since both values are 0, there's no harm. */
     return syscall(__NR_clone, cloneflags, child_stack, ptid, ctid, newtls);
--- qtbase-opensource-src-5.15.10+dfsg.orig/src/corelib/global/archdetect.cpp
+++ qtbase-opensource-src-5.15.10+dfsg/src/corelib/global/archdetect.cpp
@@ -71,6 +71,8 @@
 #  define ARCH_PROCESSOR "riscv32"
 #elif defined(Q_PROCESSOR_RISCV_64)
 #  define ARCH_PROCESSOR "riscv64"
+#elif defined(Q_PROCESSOR_LOONGARCH_64)
+#  define ARCH_PROCESSOR "loongarch64"
 #elif defined(Q_PROCESSOR_S390_X)
 #  define ARCH_PROCESSOR "s390x"
 #elif defined(Q_PROCESSOR_S390)
--- qtbase-opensource-src-5.15.10+dfsg.orig/src/corelib/global/qglobal.cpp
+++ qtbase-opensource-src-5.15.10+dfsg/src/corelib/global/qglobal.cpp
@@ -1967,6 +1967,29 @@ bool qSharedBuild() noexcept
 */
 
 /*!
+    \macro Q_PROCESSOR_LOONGARCH
+    \relates <QtGlobal>
+    \since 5.13
+
+    Defined if the application is compiled for LoongArch processors. Qt currently
+    supports one LoongArch variants: \l Q_PROCESSOR_LOONGARCH_64.
+
+    \sa QSysInfo::buildCpuArchitecture()
+*/
+
+/*!
+    \macro Q_PROCESSOR_LOONGARCH_64
+    \relates <QtGlobal>
+    \since 5.13
+
+    Defined if the application is compiled for 64-bit LoongArch processors. The \l
+    Q_PROCESSOR_LOONGARCH macro is also defined when Q_PROCESSOR_LOONGARCH_64 is
+    defined.
+
+    \sa QSysInfo::buildCpuArchitecture()
+*/
+
+/*!
     \macro Q_PROCESSOR_S390
     \relates <QtGlobal>
 
--- qtbase-opensource-src-5.15.10+dfsg.orig/src/corelib/global/qprocessordetection.h
+++ qtbase-opensource-src-5.15.10+dfsg/src/corelib/global/qprocessordetection.h
@@ -300,6 +300,15 @@
 #  endif
 #  define Q_BYTE_ORDER Q_LITTLE_ENDIAN
 
+#elif defined(__loongarch__)
+#  define Q_PROCESSOR_LOONGARCH
+#  if __loongarch_grlen == 64
+#    define Q_PROCESSOR_LOONGARCH_64
+#  else
+#    define Q_PROCESSOR_LOONGARCH_32
+#  endif
+#  define Q_BYTE_ORDER Q_LITTLE_ENDIAN
+
 /*
     S390 family, known variant: S390X (64-bit)
 

Reply to: