|
Line 0
Link Here
|
|
|
1 |
diff --git a/src/corelib/global/archdetect.cpp b/src/corelib/global/archdetect.cpp |
| 2 |
index a0ce5baa..5bbc75e4 100644 |
| 3 |
--- a/src/corelib/global/archdetect.cpp |
| 4 |
+++ b/src/corelib/global/archdetect.cpp |
| 5 |
@@ -23,6 +23,8 @@ |
| 6 |
# define ARCH_PROCESSOR "x86_64" |
| 7 |
#elif defined(Q_PROCESSOR_IA64) |
| 8 |
# define ARCH_PROCESSOR "ia64" |
| 9 |
+#elif defined(Q_PROCESSOR_LOONGARCH_64) |
| 10 |
+# define ARCH_PROCESSOR "loongarch64" |
| 11 |
#elif defined(Q_PROCESSOR_MIPS_64) |
| 12 |
# define ARCH_PROCESSOR "mips64" |
| 13 |
#elif defined(Q_PROCESSOR_MIPS) |
| 14 |
diff --git a/src/corelib/global/qprocessordetection.h b/src/corelib/global/qprocessordetection.h |
| 15 |
index f18cbf32..d1d9f59c 100644 |
| 16 |
--- a/src/corelib/global/qprocessordetection.h |
| 17 |
+++ b/src/corelib/global/qprocessordetection.h |
| 18 |
@@ -187,6 +187,16 @@ |
| 19 |
# define Q_PROCESSOR_WORDSIZE 8 |
| 20 |
// Q_BYTE_ORDER not defined, use endianness auto-detection |
| 21 |
|
| 22 |
+/* |
| 23 |
+ LoongArch family, supported variant: lp64d ABI |
| 24 |
+ |
| 25 |
+ LoongArch is little-endian |
| 26 |
+*/ |
| 27 |
+#elif defined(__loongarch64) |
| 28 |
+ #define Q_PROCESSOR_LOONGARCH |
| 29 |
+ #define Q_PROCESSOR_LOONGARCH_64 |
| 30 |
+ #define Q_PROCESSOR_WORDSIZE 8 |
| 31 |
+ #define Q_BYTE_ORDER Q_LITTLE_ENDIAN |
| 32 |
/* |
| 33 |
MIPS family, known revisions: I, II, III, IV, 32, 64 |
| 34 |
|
| 35 |
diff --git a/src/corelib/plugin/qelfparser_p.cpp b/src/corelib/plugin/qelfparser_p.cpp |
| 36 |
index 6ebfaff2..06c77efc 100644 |
| 37 |
--- a/src/corelib/plugin/qelfparser_p.cpp |
| 38 |
+++ b/src/corelib/plugin/qelfparser_p.cpp |
| 39 |
@@ -120,6 +120,8 @@ struct ElfMachineCheck |
| 40 |
EM_BLACKFIN |
| 41 |
#elif defined(Q_PROCESSOR_IA64) |
| 42 |
EM_IA_64 |
| 43 |
+#elif defined(Q_PROCESSOR_LOONGARCH) |
| 44 |
+ EM_LOONGARCH |
| 45 |
#elif defined(Q_PROCESSOR_MIPS) |
| 46 |
EM_MIPS |
| 47 |
#elif defined(Q_PROCESSOR_POWER_32) |