From 65d8ecd62e1ca4ba18045d953da329c2afb71dd5 Mon Sep 17 00:00:00 2001 From: Kevin Hendricks Date: Tue, 19 Mar 2019 20:01:44 -0400 Subject: [PATCH] add some patches for building qt-5.12.2 --- docs/qt512.2_avoid_qtabbar_segfault.patch | 11 + docs/qt512.2_qtableview_fix.patch | 68 ++++ docs/qt512.2_support_macosx_10.11.patch | 446 ++++++++++++++++++++++ 3 files changed, 525 insertions(+) create mode 100644 docs/qt512.2_avoid_qtabbar_segfault.patch create mode 100644 docs/qt512.2_qtableview_fix.patch create mode 100644 docs/qt512.2_support_macosx_10.11.patch diff --git a/docs/qt512.2_avoid_qtabbar_segfault.patch b/docs/qt512.2_avoid_qtabbar_segfault.patch new file mode 100644 index 0000000000..0939110d50 --- /dev/null +++ b/docs/qt512.2_avoid_qtabbar_segfault.patch @@ -0,0 +1,11 @@ +--- qtbase/src/widgets/widgets/qtabbar.cpp.orig 2019-03-19 12:24:14.000000000 -0400 ++++ qtbase/src/widgets/widgets/qtabbar.cpp 2019-03-19 12:23:40.000000000 -0400 +@@ -738,6 +738,8 @@ + { + Q_Q(QTabBar); + Q_ASSERT(index >= 0); ++ // play it safe ++ if (index < 0) return; + + Tab &tab = tabList[index]; + bool vertical = verticalTabs(shape); diff --git a/docs/qt512.2_qtableview_fix.patch b/docs/qt512.2_qtableview_fix.patch new file mode 100644 index 0000000000..ad3bf20e00 --- /dev/null +++ b/docs/qt512.2_qtableview_fix.patch @@ -0,0 +1,68 @@ +diff --git qtbase/src/widgets/styles/qcommonstyle.cpp qtbase/src/widgets/styles/qcommonstyle.cpp +index 79e338a6e7..c739ddc6e2 100644 +--- qtbase/src/widgets/styles/qcommonstyle.cpp ++++ qtbase/src/widgets/styles/qcommonstyle.cpp +@@ -843,11 +843,14 @@ static void drawArrow(const QStyle *style, const QStyleOptionToolButton *toolbut + } + #endif // QT_CONFIG(toolbutton) + +-static QSizeF viewItemTextLayout(QTextLayout &textLayout, int lineWidth) ++static QSizeF viewItemTextLayout(QTextLayout &textLayout, int lineWidth, int maxHeight = -1, int *lastVisibleLine = nullptr) + { ++ if (lastVisibleLine) ++ *lastVisibleLine = -1; + qreal height = 0; + qreal widthUsed = 0; + textLayout.beginLayout(); ++ int i = 0; + while (true) { + QTextLine line = textLayout.createLine(); + if (!line.isValid()) +@@ -856,6 +859,13 @@ static QSizeF viewItemTextLayout(QTextLayout &textLayout, int lineWidth) + line.setPosition(QPointF(0, height)); + height += line.height(); + widthUsed = qMax(widthUsed, line.naturalTextWidth()); ++ // we assume that the height of the next line is the same as the current one ++ if (maxHeight > 0 && lastVisibleLine && height + line.height() > maxHeight) { ++ const QTextLine nextLine = textLayout.createLine(); ++ *lastVisibleLine = nextLine.isValid() ? i : -1; ++ break; ++ } ++ ++i; + } + textLayout.endLayout(); + return QSizeF(widthUsed, height); +@@ -869,7 +879,13 @@ QString QCommonStylePrivate::calculateElidedText(const QString &text, const QTex + QTextLayout textLayout(text, font); + textLayout.setTextOption(textOption); + +- viewItemTextLayout(textLayout, textRect.width()); ++ // In AlignVCenter mode when more than one line is displayed and the height only allows ++ // some of the lines it makes no sense to display those. From a users perspective it makes ++ // more sense to see the start of the text instead something inbetween. ++ const bool vAlignmentOptimization = paintStartPosition && valign.testFlag(Qt::AlignVCenter); ++ ++ int lastVisibleLine = -1; ++ viewItemTextLayout(textLayout, textRect.width(), vAlignmentOptimization ? textRect.height() : -1, &lastVisibleLine); + + const QRectF boundingRect = textLayout.boundingRect(); + // don't care about LTR/RTL here, only need the height +@@ -896,7 +912,7 @@ QString QCommonStylePrivate::calculateElidedText(const QString &text, const QTex + const int start = line.textStart(); + const int length = line.textLength(); + const bool drawElided = line.naturalTextWidth() > textRect.width(); +- bool elideLastVisibleLine = false; ++ bool elideLastVisibleLine = lastVisibleLine == i; + if (!drawElided && i + 1 < lineCount && lastVisibleLineShouldBeElided) { + const QTextLine nextLine = textLayout.lineAt(i + 1); + const int nextHeight = height + nextLine.height() / 2; +@@ -927,7 +943,8 @@ QString QCommonStylePrivate::calculateElidedText(const QString &text, const QTex + } + + // below visible text, can stop +- if (height + layoutRect.top() >= textRect.bottom()) ++ if ((height + layoutRect.top() >= textRect.bottom()) || ++ (lastVisibleLine >= 0 && lastVisibleLine == i)) + break; + } + return ret; diff --git a/docs/qt512.2_support_macosx_10.11.patch b/docs/qt512.2_support_macosx_10.11.patch new file mode 100644 index 0000000000..85e95f44a0 --- /dev/null +++ b/docs/qt512.2_support_macosx_10.11.patch @@ -0,0 +1,446 @@ +--- ./qtbase/mkspecs/common/macx.conf.orig 2019-03-19 12:19:30.000000000 -0400 ++++ ./qtbase/mkspecs/common/macx.conf 2019-03-19 12:18:57.000000000 -0400 +@@ -5,7 +5,7 @@ + QMAKE_PLATFORM += macos osx macx + QMAKE_MAC_SDK = macosx + +-QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.12 ++QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.11 + QMAKE_APPLE_DEVICE_ARCHS = x86_64 + QT_MAC_SDK_VERSION_MIN = 10.13 + QT_MAC_SDK_VERSION_MAX = 10.14 +--- ./qtbase/src/corelib/global/qlogging.cpp.orig 2019-03-06 02:59:50.000000000 -0500 ++++ ./qtbase/src/corelib/global/qlogging.cpp 2019-03-19 14:13:20.000000000 -0400 +@@ -1766,7 +1766,8 @@ + # elif defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED) + handledStderr |= android_default_message_handler(type, context, message); + # elif defined(QT_USE_APPLE_UNIFIED_LOGGING) +- handledStderr |= AppleUnifiedLogger::messageHandler(type, context, message); ++ if (__builtin_available(macOS 10.12, iOS 10, tvOS 10, watchOS 3, *)) ++ handledStderr |= AppleUnifiedLogger::messageHandler(type, context, message); + # elif defined Q_OS_WASM + handledStderr |= wasm_default_message_handler(type, context, message); + # endif +--- ./qtbase/src/corelib/io/qfilesystemengine_unix.cpp.orig 2019-03-06 02:59:50.000000000 -0500 ++++ ./qtbase/src/corelib/io/qfilesystemengine_unix.cpp 2019-03-19 14:13:20.000000000 -0400 +@@ -76,7 +76,9 @@ + #endif + + #if defined(Q_OS_DARWIN) +-# include ++# if QT_DARWIN_PLATFORM_SDK_EQUAL_OR_ABOVE(101200, 100000, 100000, 30000) ++# include ++# endif + # include + // We cannot include (it's an Objective-C header), but + // we need these declarations: +@@ -1226,18 +1228,20 @@ + //static + bool QFileSystemEngine::copyFile(const QFileSystemEntry &source, const QFileSystemEntry &target, QSystemError &error) + { +-#if defined(Q_OS_DARWIN) +- if (::clonefile(source.nativeFilePath().constData(), +- target.nativeFilePath().constData(), 0) == 0) +- return true; +- error = QSystemError(errno, QSystemError::StandardLibraryError); +- return false; ++#if QT_DARWIN_PLATFORM_SDK_EQUAL_OR_ABOVE(101200, 100000, 100000, 30000) ++ if (__builtin_available(macOS 10.12, iOS 10, tvOS 10, watchOS 3, *)) { ++ if (::clonefile(source.nativeFilePath().constData(), ++ target.nativeFilePath().constData(), 0) == 0) ++ return true; ++ error = QSystemError(errno, QSystemError::StandardLibraryError); ++ return false; ++ } + #else + Q_UNUSED(source); + Q_UNUSED(target); ++#endif + error = QSystemError(ENOSYS, QSystemError::StandardLibraryError); //Function not implemented + return false; +-#endif + } + + //static +@@ -1259,11 +1263,13 @@ + } + #endif + #if defined(Q_OS_DARWIN) && defined(RENAME_EXCL) +- if (renameatx_np(AT_FDCWD, srcPath, AT_FDCWD, tgtPath, RENAME_EXCL) == 0) +- return true; +- if (errno != ENOTSUP) { +- error = QSystemError(errno, QSystemError::StandardLibraryError); +- return false; ++ if (__builtin_available(macOS 10.12, iOS 10, tvOS 10, watchOS 3, *)) { ++ if (renameatx_np(AT_FDCWD, srcPath, AT_FDCWD, tgtPath, RENAME_EXCL) == 0) ++ return true; ++ if (errno != ENOTSUP) { ++ error = QSystemError(errno, QSystemError::StandardLibraryError); ++ return false; ++ } + } + #endif + +--- ./qtbase/src/corelib/kernel/qcore_mac_p.h.orig 2019-03-19 14:11:08.000000000 -0400 ++++ ./qtbase/src/corelib/kernel/qcore_mac_p.h 2019-03-19 14:13:20.000000000 -0400 +@@ -59,6 +59,36 @@ + + // -------------------------------------------------------------------------- + ++#if !defined(QT_BOOTSTRAPPED) && (QT_MACOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_12) || !defined(Q_OS_MACOS)) ++#define QT_USE_APPLE_ACTIVITIES ++ ++#if defined(OS_ACTIVITY_OBJECT_API) ++#error The file has already been included ++#endif ++ ++// We runtime-check all use of the activity APIs, so we can safely build ++// with them included, even if the deployment target is macOS 10.11 ++#if QT_MACOS_DEPLOYMENT_TARGET_BELOW(__MAC_10_12) ++#undef __MAC_OS_X_VERSION_MIN_REQUIRED ++#define __MAC_OS_X_VERSION_MIN_REQUIRED __MAC_10_12 ++#define DID_OVERRIDE_DEPLOYMENT_TARGET ++#endif ++ ++#include ++#if !OS_ACTIVITY_OBJECT_API ++#error "Expected activity API to be available" ++#endif ++ ++#if defined(DID_OVERRIDE_DEPLOYMENT_TARGET) ++#undef __MAC_OS_X_VERSION_MIN_REQUIRED ++#define __MAC_OS_X_VERSION_MIN_REQUIRED __MAC_10_11 ++#undef DID_OVERRIDE_DEPLOYMENT_TARGET ++#endif ++ ++#endif ++ ++// -------------------------------------------------------------------------- ++ + #if defined(QT_BOOTSTRAPPED) + #include + #else +@@ -190,31 +220,41 @@ + + // -------------------------------------------------------------------------- + +-#if !defined(QT_BOOTSTRAPPED) ++#if !defined(QT_BOOTSTRAPPED) && (QT_MACOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_12) || !defined(Q_OS_MACOS)) + #define QT_USE_APPLE_UNIFIED_LOGGING + + QT_END_NAMESPACE + #include ++ ++// The compiler isn't smart enough to realize that we're calling these functions ++// guarded by __builtin_available, so we need to also tag each function with the ++// runtime requirements. ++#include ++#define OS_LOG_AVAILABILITY API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0)) + QT_BEGIN_NAMESPACE + + class Q_CORE_EXPORT AppleUnifiedLogger + { + public: + static bool messageHandler(QtMsgType msgType, const QMessageLogContext &context, const QString &message, +- const QString &subsystem = QString()); ++ const QString &subsystem = QString()) OS_LOG_AVAILABILITY; + private: +- static os_log_type_t logTypeForMessageType(QtMsgType msgType); +- static os_log_t cachedLog(const QString &subsystem, const QString &category); ++ static os_log_type_t logTypeForMessageType(QtMsgType msgType) OS_LOG_AVAILABILITY; ++ static os_log_t cachedLog(const QString &subsystem, const QString &category) OS_LOG_AVAILABILITY; + }; + ++#undef OS_LOG_AVAILABILITY ++ + #endif + + // -------------------------------------------------------------------------- + +-#if !defined(QT_BOOTSTRAPPED) ++#if defined(QT_USE_APPLE_ACTIVITIES) + + QT_END_NAMESPACE +-#include ++#include ++#define OS_ACTIVITY_AVAILABILITY API_AVAILABLE(macos(10.12), ios(10.0), tvos(10.0), watchos(3.0)) ++#define OS_ACTIVITY_AVAILABILITY_CHECK __builtin_available(macOS 10.12, iOS 10, tvOS 10, watchOS 3, *) + QT_BEGIN_NAMESPACE + + template using QAppleOsType = QAppleRefCounted; +@@ -223,7 +263,7 @@ + { + public: + QAppleLogActivity() : activity(nullptr) {} +- QAppleLogActivity(os_activity_t activity) : activity(activity) {} ++ QAppleLogActivity(os_activity_t activity) OS_ACTIVITY_AVAILABILITY : activity(activity) {} + ~QAppleLogActivity() { if (activity) leave(); } + + QAppleLogActivity(const QAppleLogActivity &) = delete; +@@ -244,17 +284,21 @@ + + QAppleLogActivity&& enter() + { +- if (activity) +- os_activity_scope_enter(static_cast(*this), &state); ++ if (activity) { ++ if (OS_ACTIVITY_AVAILABILITY_CHECK) ++ os_activity_scope_enter(static_cast(*this), &state); ++ } + return std::move(*this); + } + + void leave() { +- if (activity) +- os_activity_scope_leave(&state); ++ if (activity) { ++ if (OS_ACTIVITY_AVAILABILITY_CHECK) ++ os_activity_scope_leave(&state); ++ } + } + +- operator os_activity_t() ++ operator os_activity_t() OS_ACTIVITY_AVAILABILITY + { + return reinterpret_cast(static_cast(activity)); + } +@@ -268,7 +312,9 @@ + #define QT_APPLE_LOG_ACTIVITY_CREATE(condition, description, parent) []() { \ + if (!(condition)) \ + return QAppleLogActivity(); \ +- return QAppleLogActivity(os_activity_create(description, parent, OS_ACTIVITY_FLAG_DEFAULT)); \ ++ if (OS_ACTIVITY_AVAILABILITY_CHECK) \ ++ return QAppleLogActivity(os_activity_create(description, parent, OS_ACTIVITY_FLAG_DEFAULT)); \ ++ return QAppleLogActivity(); \ + }() + + #define QT_VA_ARGS_CHOOSE(_1, _2, _3, _4, _5, _6, _7, _8, _9, N, ...) N +@@ -289,7 +335,12 @@ + + #define QT_APPLE_SCOPED_LOG_ACTIVITY(...) QAppleLogActivity scopedLogActivity = QT_APPLE_LOG_ACTIVITY(__VA_ARGS__).enter(); + +-#endif // !defined(QT_BOOTSTRAPPED) ++#else ++// No-ops for macOS 10.11. We don't need to provide QT_APPLE_SCOPED_LOG_ACTIVITY, ++// as all the call sites for that are in code that's only built on 10.12 and above. ++#define QT_APPLE_LOG_ACTIVITY_WITH_PARENT(...) ++#define QT_APPLE_LOG_ACTIVITY(...) ++#endif // QT_DARWIN_PLATFORM_SDK_EQUAL_OR_ABOVE + + // ------------------------------------------------------------------------- + +--- ./qtbase/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm.orig 2019-03-06 02:59:50.000000000 -0500 ++++ ./qtbase/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm 2019-03-19 14:13:20.000000000 -0400 +@@ -268,11 +268,13 @@ + inLaunch = false; + + if (qEnvironmentVariableIsEmpty("QT_MAC_DISABLE_FOREGROUND_APPLICATION_TRANSFORM")) { +- // Move the application window to front to avoid launching behind the terminal. +- // Ignoring other apps is necessary (we must ignore the terminal), but makes +- // Qt apps play slightly less nice with other apps when lanching from Finder +- // (See the activateIgnoringOtherApps docs.) +- [[NSApplication sharedApplication] activateIgnoringOtherApps:YES]; ++ if (__builtin_available(macOS 10.12, *)) { ++ // Move the application window to front to avoid launching behind the terminal. ++ // Ignoring other apps is necessary (we must ignore the terminal), but makes ++ // Qt apps play slightly less nice with other apps when lanching from Finder ++ // (See the activateIgnoringOtherApps docs.) ++ [[NSApplication sharedApplication] activateIgnoringOtherApps:YES]; ++ } + } + } + +--- ./qtbase/src/plugins/platforms/cocoa/qcocoabackingstore.mm.orig 2019-03-19 14:11:36.000000000 -0400 ++++ ./qtbase/src/plugins/platforms/cocoa/qcocoabackingstore.mm 2019-03-19 14:13:20.000000000 -0400 +@@ -67,6 +67,11 @@ + return QRasterBackingStore::format(); + } + ++#if !QT_MACOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_12) ++static const NSCompositingOperation NSCompositingOperationCopy = NSCompositeCopy; ++static const NSCompositingOperation NSCompositingOperationSourceOver = NSCompositeSourceOver; ++#endif ++ + /*! + Flushes the given \a region from the specified \a window onto the + screen. +--- ./qtbase/src/plugins/platforms/cocoa/qnswindow.mm.orig 2019-03-06 02:59:50.000000000 -0500 ++++ ./qtbase/src/plugins/platforms/cocoa/qnswindow.mm 2019-03-19 14:13:20.000000000 -0400 +@@ -102,20 +102,29 @@ + NSEnumerator *windowEnumerator = nullptr; + NSApplication *application = [NSApplication sharedApplication]; + +- // Unfortunately there's no NSWindowListOrderedBackToFront, +- // so we have to manually reverse the order using an array. +- NSMutableArray *windows = [NSMutableArray new]; +- [application enumerateWindowsWithOptions:NSWindowListOrderedFrontToBack +- usingBlock:^(NSWindow *window, BOOL *) { +- // For some reason AppKit will give us nil-windows, skip those +- if (!window) +- return; ++#if QT_MACOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_12) ++ if (__builtin_available(macOS 10.12, *)) { ++ // Unfortunately there's no NSWindowListOrderedBackToFront, ++ // so we have to manually reverse the order using an array. ++ NSMutableArray *windows = [NSMutableArray new]; ++ [application enumerateWindowsWithOptions:NSWindowListOrderedFrontToBack ++ usingBlock:^(NSWindow *window, BOOL *) { ++ // For some reason AppKit will give us nil-windows, skip those ++ if (!window) ++ return; ++ ++ [windows addObject:window]; ++ } ++ ]; + +- [windows addObject:window]; +- } +- ]; +- +- windowEnumerator = windows.reverseObjectEnumerator; ++ windowEnumerator = windows.reverseObjectEnumerator; ++ } else ++#endif ++ { ++ // No way to get ordered list of windows, so fall back to unordered, ++ // list, which typically corresponds to window creation order. ++ windowEnumerator = application.windows.objectEnumerator; ++ } + + for (NSWindow *window in windowEnumerator) { + // We're meddling with normal and floating windows, so leave others alone +--- ./qtbase/src/plugins/styles/mac/qmacstyle_mac.mm.orig 2019-03-06 02:59:50.000000000 -0500 ++++ ./qtbase/src/plugins/styles/mac/qmacstyle_mac.mm 2019-03-19 14:13:20.000000000 -0400 +@@ -1810,10 +1810,17 @@ + } + Q_UNREACHABLE(); + } (); ++#if QT_MACOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_12) + const auto styleMask = NSWindowStyleMaskTitled + | NSWindowStyleMaskClosable + | NSWindowStyleMaskMiniaturizable + | NSWindowStyleMaskResizable; ++#else ++ const auto styleMask = NSTitledWindowMask ++ | NSClosableWindowMask ++ | NSMiniaturizableWindowMask ++ | NSResizableWindowMask; ++#endif + bv = [NSWindow standardWindowButton:button forStyleMask:styleMask]; + [bv retain]; + break; +--- ./qtbase/src/testlib/qappletestlogger.cpp.orig 2019-03-06 02:59:50.000000000 -0500 ++++ ./qtbase/src/testlib/qappletestlogger.cpp 2019-03-19 14:13:20.000000000 -0400 +@@ -52,7 +52,10 @@ + // Debug-level messages are only captured in memory when debug logging is + // enabled through a configuration change, which can happen automatically + // when running inside Xcode, or with the Console application open. +- return os_log_type_enabled(OS_LOG_DEFAULT, OS_LOG_TYPE_DEBUG); ++ if (__builtin_available(macOS 10.12, iOS 10, tvOS 10, watchOS 3, *)) ++ return os_log_type_enabled(OS_LOG_DEFAULT, OS_LOG_TYPE_DEBUG); ++ ++ return false; + } + + QAppleTestLogger::QAppleTestLogger(QAbstractTestLogger *logger) +@@ -68,13 +71,15 @@ + // Re-create activity each time + testFunctionActivity = QT_APPLE_LOG_ACTIVITY("Running test function").enter(); + +- QTestCharBuffer testIdentifier; +- QTestPrivate::generateTestIdentifier(&testIdentifier); +- QString identifier = QString::fromLatin1(testIdentifier.data()); +- QMessageLogContext context(nullptr, 0, nullptr, "qt.test.enter"); +- QString message = identifier; +- if (AppleUnifiedLogger::messageHandler(QtDebugMsg, context, message, identifier)) +- return; // AUL already printed to stderr ++ if (__builtin_available(macOS 10.12, iOS 10, tvOS 10, watchOS 3, *)) { ++ QTestCharBuffer testIdentifier; ++ QTestPrivate::generateTestIdentifier(&testIdentifier); ++ QString identifier = QString::fromLatin1(testIdentifier.data()); ++ QMessageLogContext context(nullptr, 0, nullptr, "qt.test.enter"); ++ QString message = identifier; ++ if (AppleUnifiedLogger::messageHandler(QtDebugMsg, context, message, identifier)) ++ return; // AUL already printed to stderr ++ } + + m_logger->enterTestFunction(function); + } +@@ -112,38 +117,41 @@ + void QAppleTestLogger::addIncident(IncidentTypes type, const char *description, + const char *file, int line) + { ++ if (__builtin_available(macOS 10.12, iOS 10, tvOS 10, watchOS 3, *)) { ++ IncidentClassification incidentClassification = incidentTypeToClassification(type); + +- IncidentClassification incidentClassification = incidentTypeToClassification(type); +- +- QTestCharBuffer category; +- QTest::qt_asprintf(&category, "qt.test.%s", incidentClassification.second); +- QMessageLogContext context(file, line, /* function = */ nullptr, category.data()); +- +- QTestCharBuffer subsystemBuffer; +- // It would be nice to have the data tag as part of the subsystem too, but that +- // will for some tests results in hundreds of thousands of log objects being +- // created, so we limit the subsystem to test functions, which we can hope +- // are reasonably limited. +- generateTestIdentifier(&subsystemBuffer, TestObject | TestFunction); +- QString subsystem = QString::fromLatin1(subsystemBuffer.data()); +- +- // We still want the full identifier as part of the message though +- QTestCharBuffer testIdentifier; +- generateTestIdentifier(&testIdentifier); +- QString message = QString::fromLatin1(testIdentifier.data()); +- if (qstrlen(description)) +- message += QLatin1Char('\n') % QString::fromLatin1(description); ++ QTestCharBuffer category; ++ QTest::qt_asprintf(&category, "qt.test.%s", incidentClassification.second); ++ QMessageLogContext context(file, line, /* function = */ nullptr, category.data()); ++ ++ QTestCharBuffer subsystemBuffer; ++ // It would be nice to have the data tag as part of the subsystem too, but that ++ // will for some tests results in hundreds of thousands of log objects being ++ // created, so we limit the subsystem to test functions, which we can hope ++ // are reasonably limited. ++ generateTestIdentifier(&subsystemBuffer, TestObject | TestFunction); ++ QString subsystem = QString::fromLatin1(subsystemBuffer.data()); ++ ++ // We still want the full identifier as part of the message though ++ QTestCharBuffer testIdentifier; ++ generateTestIdentifier(&testIdentifier); ++ QString message = QString::fromLatin1(testIdentifier.data()); ++ if (qstrlen(description)) ++ message += QLatin1Char('\n') % QString::fromLatin1(description); + +- if (AppleUnifiedLogger::messageHandler(incidentClassification.first, context, message, subsystem)) +- return; // AUL already printed to stderr ++ if (AppleUnifiedLogger::messageHandler(incidentClassification.first, context, message, subsystem)) ++ return; // AUL already printed to stderr ++ } + + m_logger->addIncident(type, description, file, line); + } + + void QAppleTestLogger::addMessage(QtMsgType type, const QMessageLogContext &context, const QString &message) + { +- if (AppleUnifiedLogger::messageHandler(type, context, message)) +- return; // AUL already printed to stderr ++ if (__builtin_available(macOS 10.12, iOS 10, tvOS 10, watchOS 3, *)) { ++ if (AppleUnifiedLogger::messageHandler(type, context, message)) ++ return; // AUL already printed to stderr ++ } + + m_logger->addMessage(type, context, message); + } +--- ./qtbase/tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp.orig 2019-03-19 14:12:32.000000000 -0400 ++++ ./qtbase/tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp 2019-03-19 14:13:20.000000000 -0400 +@@ -456,7 +456,8 @@ + #if defined(Q_OS_WIN32) + QSKIP("Does not work reliably on Windows :("); + #elif defined(Q_OS_MACOS) +- QSKIP("Does not work reliably on macOS 10.12+ (QTBUG-59679)"); ++ if (__builtin_available(macOS 10.12, *)) ++ QSKIP("Does not work reliably on macOS 10.12 (QTBUG-59679)"); + #endif + QTimer ti1; + QTimer ti2;