Skip to content

Commit

Permalink
Remove QLibrary code path specific to HP-UX on PA-RISC
Browse files Browse the repository at this point in the history
The only mkspecs that enabled QT_HPUX_LD were removed in ab44ac0.

Change-Id: I9f27f0b487b69c11d19ba76801e3926b7894e6e7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
  • Loading branch information
annulen committed Feb 12, 2018
1 parent a211d53 commit da1ca1b
Showing 1 changed file with 2 additions and 33 deletions.
35 changes: 2 additions & 33 deletions src/corelib/plugin/qlibrary_unix.cpp
Expand Up @@ -44,25 +44,17 @@
#include <qcoreapplication.h>
#include <private/qfilesystementry_p.h>

#include <dlfcn.h>

#ifdef Q_OS_MAC
# include <private/qcore_mac_p.h>
#endif

QT_BEGIN_NAMESPACE

#if !defined(QT_HPUX_LD)
QT_BEGIN_INCLUDE_NAMESPACE
#include <dlfcn.h>
QT_END_INCLUDE_NAMESPACE
#endif

static QString qdlerror()
{
#if !defined(QT_HPUX_LD)
const char *err = dlerror();
#else
const char *err = strerror(errno);
#endif
return err ? QLatin1Char('(') + QString::fromLocal8Bit(err) + QLatin1Char(')'): QString();
}

Expand Down Expand Up @@ -139,14 +131,6 @@ bool QLibraryPrivate::load_sys()
suffixes = suffixes_sys(fullVersion);
}
int dlFlags = 0;
#if defined(QT_HPUX_LD)
dlFlags = DYNAMIC_PATH | BIND_NONFATAL;
if (loadHints & QLibrary::ResolveAllSymbolsHint) {
dlFlags |= BIND_IMMEDIATE;
} else {
dlFlags |= BIND_DEFERRED;
}
#else
int loadHints = this->loadHints();
if (loadHints & QLibrary::ResolveAllSymbolsHint) {
dlFlags |= RTLD_NOW;
Expand Down Expand Up @@ -182,7 +166,6 @@ bool QLibraryPrivate::load_sys()
dlFlags |= RTLD_MEMBER;
}
#endif
#endif // QT_HPUX_LD

// If the filename is an absolute path then we want to try that first as it is most likely
// what the callee wants. If we have been given a non-absolute path then lets try the
Expand Down Expand Up @@ -211,11 +194,7 @@ bool QLibraryPrivate::load_sys()
} else {
attempt = path + prefixes.at(prefix) + name + suffixes.at(suffix);
}
#if defined(QT_HPUX_LD)
pHnd = (void*)shl_load(QFile::encodeName(attempt), dlFlags, 0);
#else
pHnd = dlopen(QFile::encodeName(attempt), dlFlags);
#endif

if (!pHnd && fileName.startsWith(QLatin1Char('/')) && QFile::exists(attempt)) {
// We only want to continue if dlopen failed due to that the shared library did not exist.
Expand Down Expand Up @@ -253,11 +232,7 @@ bool QLibraryPrivate::load_sys()

bool QLibraryPrivate::unload_sys()
{
#if defined(QT_HPUX_LD)
if (shl_unload((shl_t)pHnd)) {
#else
if (dlclose(pHnd)) {
#endif
#if defined (Q_OS_QNX) // Workaround until fixed in QNX; fixes crash in
char *error = dlerror(); // QtDeclarative auto test "qqmlenginecleanup" for instance
if (!qstrcmp(error, "Shared objects still referenced")) // On QNX that's only "informative"
Expand Down Expand Up @@ -289,13 +264,7 @@ Q_CORE_EXPORT QFunctionPointer qt_mac_resolve_sys(void *handle, const char *symb

QFunctionPointer QLibraryPrivate::resolve_sys(const char* symbol)
{
#if defined(QT_HPUX_LD)
QFunctionPointer address = 0;
if (shl_findsym((shl_t*)&pHnd, symbol, TYPE_UNDEFINED, &address) < 0)
address = 0;
#else
QFunctionPointer address = QFunctionPointer(dlsym(pHnd, symbol));
#endif
if (!address) {
errorString = QLibrary::tr("Cannot resolve symbol \"%1\" in %2: %3").arg(
QString::fromLatin1(symbol), fileName, qdlerror());
Expand Down

0 comments on commit da1ca1b

Please sign in to comment.