summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorLada Trimasova <ltrimas@synopsys.com>2016-02-03 22:33:02 +0300
committerOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>2016-02-05 16:29:09 +0000
commitf669ea0d54302de31456d57286aa0e4ca1443e98 (patch)
tree98847dd27ed38f654286d922a9ec8da050809a5d /src/corelib
parenta107c5394a37df068d2f7b304004178a3c361750 (diff)
Link with -ldl option only when it is supported
-ldl option was used unconditionally while libdl is not supported when libc is static. Add build test to configure which checks if libdl is supported. QMAKE_LIBS_DYNLOAD in "src/corelib/plugin/plugin.pri" is now used only if libdl is available. qt_linux_find_symbol_sys from qlibrary_unix is now used only if QT_NO_DYNAMIC_LIBRARY is not defined. Initially reported by Buildroot autobuilder here: http://autobuild.buildroot.net/results/a85/a85a1839a45fb6102e53131ecc8f6dadf92bcdc2 Change-Id: I0397472456efdc4f3ab5f24d01253bee8048a9d1 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/plugin/plugin.pri2
-rw-r--r--src/corelib/plugin/qlibrary_unix.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/plugin/plugin.pri b/src/corelib/plugin/plugin.pri
index 8b64f93467..473480eb55 100644
--- a/src/corelib/plugin/plugin.pri
+++ b/src/corelib/plugin/plugin.pri
@@ -35,4 +35,4 @@ integrity {
SOURCES += plugin/qlibrary_unix.cpp
}
-LIBS_PRIVATE += $$QMAKE_LIBS_DYNLOAD
+!no-libdl: LIBS_PRIVATE += $$QMAKE_LIBS_DYNLOAD
diff --git a/src/corelib/plugin/qlibrary_unix.cpp b/src/corelib/plugin/qlibrary_unix.cpp
index cd158a9e49..13bc129605 100644
--- a/src/corelib/plugin/qlibrary_unix.cpp
+++ b/src/corelib/plugin/qlibrary_unix.cpp
@@ -286,7 +286,7 @@ bool QLibraryPrivate::unload_sys()
return true;
}
-#ifdef Q_OS_LINUX
+#if defined(Q_OS_LINUX) && !defined(QT_NO_DYNAMIC_LIBRARY)
Q_CORE_EXPORT QFunctionPointer qt_linux_find_symbol_sys(const char *symbol)
{
return QFunctionPointer(dlsym(RTLD_DEFAULT, symbol));