summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in4
-rw-r--r--src/corelib/configure.json3
-rw-r--r--src/corelib/plugin/qlibrary.cpp2
-rw-r--r--src/corelib/plugin/qlibrary_unix.cpp4
-rw-r--r--src/corelib/plugin/qlibrary_win.cpp3
-rw-r--r--src/corelib/time/qtimezoneprivate_tz.cpp30
6 files changed, 18 insertions, 28 deletions
diff --git a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
index 59b34453f9..309798a767 100644
--- a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
+++ b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
@@ -405,8 +405,12 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
!!ENDIF
endif()
+!!IF equals(TEMPLATE, aux)
+ add_library(Qt5::$${CMAKE_MODULE_NAME} INTERFACE IMPORTED)
+!!ELSE
add_library(Qt5::$${CMAKE_MODULE_NAME} STATIC IMPORTED)
set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} PROPERTY IMPORTED_LINK_INTERFACE_LANGUAGES "CXX")
+!!ENDIF
!!ELSE
!!IF equals(TEMPLATE, aux)
add_library(Qt5::$${CMAKE_MODULE_NAME} INTERFACE IMPORTED)
diff --git a/src/corelib/configure.json b/src/corelib/configure.json
index eb60ad213c..c5e0423273 100644
--- a/src/corelib/configure.json
+++ b/src/corelib/configure.json
@@ -389,7 +389,8 @@
"# Block futimens() on Apple platforms unless it's available on ALL",
"# deployment targets. This simplifies the logic at the call site",
"# dramatically, as it isn't strictly needed compared to futimes().",
- "darwin: QMAKE_CXXFLAGS += -Werror=unguarded-availability"
+ "darwin: QMAKE_CXXFLAGS += -Werror=unguarded-availability -Werror=unguarded-availability-new",
+ "CONFIG += warn_on"
]
}
},
diff --git a/src/corelib/plugin/qlibrary.cpp b/src/corelib/plugin/qlibrary.cpp
index 595f9097c1..c94adc7a01 100644
--- a/src/corelib/plugin/qlibrary.cpp
+++ b/src/corelib/plugin/qlibrary.cpp
@@ -576,9 +576,7 @@ bool QLibraryPrivate::load()
Q_TRACE(QLibraryPrivate_load_entry, fileName);
- mutex.lock();
bool ret = load_sys();
- mutex.unlock();
if (qt_debug_component()) {
if (ret) {
qDebug() << "loaded library" << fileName;
diff --git a/src/corelib/plugin/qlibrary_unix.cpp b/src/corelib/plugin/qlibrary_unix.cpp
index 017aa97b66..a5c72f81d9 100644
--- a/src/corelib/plugin/qlibrary_unix.cpp
+++ b/src/corelib/plugin/qlibrary_unix.cpp
@@ -123,6 +123,7 @@ QStringList QLibraryPrivate::prefixes_sys()
bool QLibraryPrivate::load_sys()
{
+ QMutexLocker locker(&mutex);
QString attempt;
QFileSystemEntry fsEntry(fileName);
@@ -213,6 +214,7 @@ bool QLibraryPrivate::load_sys()
}
#endif
+ locker.unlock();
bool retry = true;
Handle hnd = nullptr;
for (int prefix = 0; retry && !hnd && prefix < prefixes.size(); prefix++) {
@@ -273,6 +275,8 @@ bool QLibraryPrivate::load_sys()
}
}
#endif
+
+ locker.relock();
if (!hnd) {
errorString = QLibrary::tr("Cannot load library %1: %2").arg(fileName, qdlerror());
}
diff --git a/src/corelib/plugin/qlibrary_win.cpp b/src/corelib/plugin/qlibrary_win.cpp
index 000bf76276..ef58724be8 100644
--- a/src/corelib/plugin/qlibrary_win.cpp
+++ b/src/corelib/plugin/qlibrary_win.cpp
@@ -78,6 +78,7 @@ bool QLibraryPrivate::load_sys()
// fileName
//
// NB If it's a plugin we do not ever try the ".dll" extension
+ QMutexLocker locker(&mutex);
QStringList attempts;
if (pluginState != IsAPlugin)
@@ -95,6 +96,7 @@ bool QLibraryPrivate::load_sys()
attempts.prepend(QDir::rootPath() + fileName);
#endif
+ locker.unlock();
Handle hnd = nullptr;
for (const QString &attempt : qAsConst(attempts)) {
#ifndef Q_OS_WINRT
@@ -115,6 +117,7 @@ bool QLibraryPrivate::load_sys()
#ifndef Q_OS_WINRT
SetErrorMode(oldmode);
#endif
+ locker.relock();
if (!hnd) {
errorString = QLibrary::tr("Cannot load library %1: %2").arg(
QDir::toNativeSeparators(fileName), qt_error_string());
diff --git a/src/corelib/time/qtimezoneprivate_tz.cpp b/src/corelib/time/qtimezoneprivate_tz.cpp
index 09a04767bf..01f9a6cce0 100644
--- a/src/corelib/time/qtimezoneprivate_tz.cpp
+++ b/src/corelib/time/qtimezoneprivate_tz.cpp
@@ -639,7 +639,7 @@ QTzTimeZonePrivate::QTzTimeZonePrivate()
// Create a named time zone
QTzTimeZonePrivate::QTzTimeZonePrivate(const QByteArray &ianaId)
{
- init(ianaId);
+ init(ianaId.isEmpty() ? systemTimeZoneId() : ianaId);
}
QTzTimeZonePrivate::~QTzTimeZonePrivate()
@@ -852,13 +852,16 @@ QTzTimeZoneCacheEntry QTzTimeZoneCache::fetchEntry(const QByteArray &ianaId)
void QTzTimeZonePrivate::init(const QByteArray &ianaId)
{
+ // System ID defaults to UTC, so is never empty; and our callers default to
+ // the system ID if what they're given is empty.
+ Q_ASSERT(!ianaId.isEmpty());
static QTzTimeZoneCache tzCache;
const auto &entry = tzCache.fetchEntry(ianaId);
if (entry.m_tranTimes.isEmpty() && entry.m_posixRule.isEmpty())
return; // Invalid after all !
cached_data = std::move(entry);
- m_id = ianaId.isEmpty() ? systemTimeZoneId() : ianaId;
+ m_id = ianaId;
}
QLocale::Country QTzTimeZonePrivate::country() const
@@ -1150,29 +1153,6 @@ QByteArray QTzTimeZonePrivate::systemTimeZoneId() const
}
}
- // On Debian Etch up to Jessie, /etc/localtime is a copy of the relevant
- // zoneinfo file, whose name is recorded in /etc/timezone:
- if (ianaId.isEmpty()) {
- QFile tzif(QStringLiteral("/etc/timezone"));
- if (tzif.open(QIODevice::ReadOnly))
- ianaId = tzif.readAll().trimmed();
- }
-
- // On some Red Hat distros /etc/localtime is real file with name held in /etc/sysconfig/clock
- // in a line like ZONE="Europe/Oslo" or TIMEZONE="Europe/Oslo"
- if (ianaId.isEmpty()) {
- QFile tzif(QStringLiteral("/etc/sysconfig/clock"));
- if (tzif.open(QIODevice::ReadOnly)) {
- while (ianaId.isEmpty() && !tzif.atEnd()) {
- const QByteArray line(tzif.readLine().trimmed());
- if (line.startsWith("ZONE="))
- ianaId = line.mid(6, line.length() - 7);
- else if (line.startsWith("TIMEZONE="))
- ianaId = line.mid(10, line.length() - 11);
- }
- }
- }
-
// Some systems (e.g. uClibc) have a default value for $TZ in /etc/TZ:
if (ianaId.isEmpty()) {
QFile zone(QStringLiteral("/etc/TZ"));