[PATCH] Add HPPA detection
authorPino Toscano <toscano.pino@tiscali.it>
Thu, 6 Oct 2022 21:15:30 +0000 (23:15 +0200)
committerRaspbian forward porter <root@raspbian.org>
Wed, 7 Feb 2024 11:12:42 +0000 (11:12 +0000)
- detect the HPPA architecture (PA-RISC) and define Q_PROCESSOR_HPPA
- set the right machine type in QElfParser for HPPA ELF files

Change-Id: I5214ce64ef1fdd0ecca3d6c1694c5db9b2852a22
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Gbp-Pq: Name upstream_Add-HPPA-detection.patch

src/corelib/global/archdetect.cpp
src/corelib/global/qglobal.cpp
src/corelib/global/qprocessordetection.h
src/corelib/plugin/qelfparser_p.cpp

index a0ce5baa435f21dc72b8d2bfb81f35e36ee46dd9..0bb6853fea41c0cd7f4b77f5363929f3dc6dad8d 100644 (file)
@@ -17,6 +17,8 @@
 #  define ARCH_PROCESSOR "bfin"
 #elif defined(Q_PROCESSOR_WASM)
 #  define ARCH_PROCESSOR "wasm"
+#elif defined(Q_PROCESSOR_HPPA)
+#  define ARCH_PROCESSOR "hppa"
 #elif defined(Q_PROCESSOR_X86_32)
 #  define ARCH_PROCESSOR "i386"
 #elif defined(Q_PROCESSOR_X86_64)
index e9a75ba9e8d93e77ebc65cb97adb0a9d1130164b..7f0e0104ac7a70c5a50a1da5e9ee4981ce2e3167 100644 (file)
@@ -1790,6 +1790,15 @@ bool qSharedBuild() noexcept
     \sa QSysInfo::buildCpuArchitecture()
 */
 
+/*!
+    \macro Q_PROCESSOR_HPPA
+    \relates <QtGlobal>
+
+    Defined if the application is compiled for PA-RISC processors.
+
+    \sa QSysInfo::buildCpuArchitecture()
+*/
+
 /*!
     \macro Q_PROCESSOR_IA64
     \relates <QtGlobal>
index f18cbf328bc9456b37cfeed212c5d067d10be3ec..1ded4583aac9b1f2209edb43b5c42f251c71e059 100644 (file)
 // #  define Q_PROCESSOR_BLACKFIN
 // #  define Q_BYTE_ORDER Q_LITTLE_ENDIAN
 
+/*
+    PA-RISC family, no revisions or variants
+
+    PA-RISC is big-endian.
+*/
+#elif defined(__hppa__)
+#  define Q_PROCESSOR_HPPA
+#  define Q_BYTE_ORDER Q_BIG_ENDIAN
+
 /*
     X86 family, known variants: 32- and 64-bit
 
index 6ebfaff21e2a878298236f14f81a4376f23f2a82..62fae0d7934269505e498e783722c31e697bc1ce 100644 (file)
@@ -118,6 +118,8 @@ struct ElfMachineCheck
             EM_AARCH64
 #elif defined(Q_PROCESSOR_BLACKFIN)
             EM_BLACKFIN
+#elif defined(Q_PROCESSOR_HPPA)
+            EM_PARISC
 #elif defined(Q_PROCESSOR_IA64)
             EM_IA_64
 #elif defined(Q_PROCESSOR_MIPS)
@@ -383,6 +385,7 @@ Q_DECL_UNUSED Q_DECL_COLD_FUNCTION static QDebug &operator<<(QDebug &d, ElfHeade
 #endif
     case EM_IA_64:      d << ", IA-64"; break;
     case EM_MIPS:       d << ", MIPS"; break;
+    case EM_PARISC:     d << ", HPPA"; break;
     case EM_PPC:        d << ", PowerPC"; break;
     case EM_PPC64:      d << ", PowerPC 64-bit"; break;
 #ifdef EM_RISCV