diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/plugin/qelfparser_p.cpp | 14 | ||||
-rw-r--r-- | src/corelib/plugin/qelfparser_p.h | 4 | ||||
-rw-r--r-- | src/corelib/plugin/qlibrary.cpp | 2 | ||||
-rw-r--r-- | src/corelib/plugin/qmachparser_p.h | 2 |
4 files changed, 15 insertions, 7 deletions
diff --git a/src/corelib/plugin/qelfparser_p.cpp b/src/corelib/plugin/qelfparser_p.cpp index 6a83c94e20..ed973e4323 100644 --- a/src/corelib/plugin/qelfparser_p.cpp +++ b/src/corelib/plugin/qelfparser_p.cpp @@ -40,7 +40,7 @@ #include "qelfparser_p.h" -#if defined (Q_OF_ELF) && __has_include(<elf.h>) +#ifdef Q_OF_ELF #include "qlibrary_p.h" @@ -48,7 +48,13 @@ #include <qnumeric.h> #include <qsysinfo.h> -#include <elf.h> +#if __has_include(<elf.h>) +# include <elf.h> +#elif __has_include(<sys/elf.h>) +# include <sys/elf.h> +#else +# error "Need ELF header to parse plugins." +#endif QT_BEGIN_NAMESPACE @@ -408,7 +414,9 @@ Q_DECL_UNUSED Q_DECL_COLD_FUNCTION static QDebug &operator<<(QDebug &d, ElfHeade case EM_MIPS: d << ", MIPS"; break; case EM_PPC: d << ", PowerPC"; break; case EM_PPC64: d << ", PowerPC 64-bit"; break; +#ifdef EM_RISCV case EM_RISCV: d << ", RISC-V"; break; +#endif case EM_S390: d << ", S/390"; break; case EM_SH: d << ", SuperH"; break; case EM_SPARC: d << ", SPARC"; break; @@ -790,4 +798,4 @@ QLibraryScanResult QElfParser::parse(QByteArrayView data, QString *errMsg) QT_END_NAMESPACE -#endif // defined(Q_OF_ELF) && defined(Q_CC_GNU) +#endif // Q_OF_ELF diff --git a/src/corelib/plugin/qelfparser_p.h b/src/corelib/plugin/qelfparser_p.h index 42eb212ee1..5c8a0b700f 100644 --- a/src/corelib/plugin/qelfparser_p.h +++ b/src/corelib/plugin/qelfparser_p.h @@ -56,7 +56,7 @@ QT_REQUIRE_CONFIG(library); -#if defined(Q_OF_ELF) && __has_include(<elf.h>) +#ifdef Q_OF_ELF QT_BEGIN_NAMESPACE @@ -67,6 +67,6 @@ struct QElfParser QT_END_NAMESPACE -#endif // defined(Q_OF_ELF) && defined(Q_CC_GNU) +#endif // Q_OF_ELF #endif // QELFPARSER_P_H diff --git a/src/corelib/plugin/qlibrary.cpp b/src/corelib/plugin/qlibrary.cpp index d4ee833554..9f89abdf01 100644 --- a/src/corelib/plugin/qlibrary.cpp +++ b/src/corelib/plugin/qlibrary.cpp @@ -203,7 +203,7 @@ static QLibraryScanResult qt_find_pattern(const char *s, qsizetype s_len, QStrin More importantly, the pattern string may exist in the debug information due to it being used in the plugin in the first place. */ -#if defined (Q_OF_ELF) && __has_include(<elf.h>) +#if defined(Q_OF_ELF) return QElfParser::parse({s, s_len}, errMsg); #elif defined(Q_OF_MACH_O) return QMachOParser::parse(s, s_len, errMsg); diff --git a/src/corelib/plugin/qmachparser_p.h b/src/corelib/plugin/qmachparser_p.h index 9e0375c6cb..216f4c3bb9 100644 --- a/src/corelib/plugin/qmachparser_p.h +++ b/src/corelib/plugin/qmachparser_p.h @@ -70,6 +70,6 @@ public: QT_END_NAMESPACE -#endif // defined(Q_OF_ELF) && defined(Q_CC_GNU) +#endif // defined(Q_OF_MACH_O) #endif // QMACHPARSER_P_H |