diff --git a/src/corelib/global/archdetect.cpp b/src/corelib/global/archdetect.cpp index a0ce5baa..5bbc75e4 100644 --- a/src/corelib/global/archdetect.cpp +++ b/src/corelib/global/archdetect.cpp @@ -23,6 +23,8 @@ # define ARCH_PROCESSOR "x86_64" #elif defined(Q_PROCESSOR_IA64) # define ARCH_PROCESSOR "ia64" +#elif defined(Q_PROCESSOR_LOONGARCH_64) +# define ARCH_PROCESSOR "loongarch64" #elif defined(Q_PROCESSOR_MIPS_64) # define ARCH_PROCESSOR "mips64" #elif defined(Q_PROCESSOR_MIPS) diff --git a/src/corelib/global/qprocessordetection.h b/src/corelib/global/qprocessordetection.h index f18cbf32..d1d9f59c 100644 --- a/src/corelib/global/qprocessordetection.h +++ b/src/corelib/global/qprocessordetection.h @@ -187,6 +187,16 @@ # define Q_PROCESSOR_WORDSIZE 8 // Q_BYTE_ORDER not defined, use endianness auto-detection +/* + LoongArch family, supported variant: lp64d ABI + + LoongArch is little-endian +*/ +#elif defined(__loongarch64) + #define Q_PROCESSOR_LOONGARCH + #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 diff --git a/src/corelib/plugin/qelfparser_p.cpp b/src/corelib/plugin/qelfparser_p.cpp index 6ebfaff2..06c77efc 100644 --- a/src/corelib/plugin/qelfparser_p.cpp +++ b/src/corelib/plugin/qelfparser_p.cpp @@ -120,6 +120,8 @@ struct ElfMachineCheck EM_BLACKFIN #elif defined(Q_PROCESSOR_IA64) EM_IA_64 +#elif defined(Q_PROCESSOR_LOONGARCH) + EM_LOONGARCH #elif defined(Q_PROCESSOR_MIPS) EM_MIPS #elif defined(Q_PROCESSOR_POWER_32)