qt5-qtbase/1000-add-loongarch64-support-for-syscall_fork.patch
2023-11-02 14:52:17 +08:00

30 lines
1.5 KiB
Diff

diff --git a/src/3rdparty/forkfd/forkfd_linux.c b/src/3rdparty/forkfd/forkfd_linux.c
index ffe0e9a5..1ec9fea4 100644
--- a/src/3rdparty/forkfd/forkfd_linux.c
+++ b/src/3rdparty/forkfd/forkfd_linux.c
@@ -82,7 +82,7 @@ static int sys_clone(unsigned long cloneflags, int *ptid)
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(__loongarch64)
/* 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);
diff --git a/src/corelib/global/qprocessordetection.h b/src/corelib/global/qprocessordetection.h
index ca9d4080..6f0bc7e7 100644
--- a/src/corelib/global/qprocessordetection.h
+++ b/src/corelib/global/qprocessordetection.h
@@ -225,8 +225,9 @@
// Q_BYTE_ORDER not defined, use endianness auto-detection
#elif defined(__loongarch64)
-# define Q_PROCESSOR_LOONGARCH_64
-# define Q_PROCESSOR_WORDSIZE 8
+# define Q_PROCESSOR_LOONGARCH_64
+# define Q_PROCESSOR_WORDSIZE 8
+# define Q_BYTE_ORDER Q_LITTLE_ENDIAN
/*
MIPS family, known revisions: I, II, III, IV, 32, 64