From 534ad22b32e09d2d728036a6b5570c8d93f47020 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Tue, 2 Jan 2018 22:41:57 +0200 Subject: [PATCH 1/7] configure: Prefer cl.exe over clang-cl.exe This is a remake of 8e4c8be0b9821ee2f3dbdda3ebbe16126d334959 that was undone by mistake in 8f49da6c18a2a86576f06deb9a6ff1deef748837. Change-Id: I9596b860dea90b042baa8b2b95b1e3b050e9b835 Reviewed-by: Oswald Buddenhagen --- configure.bat | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.bat b/configure.bat index 6e9a82f2dff..7cadd783ea4 100644 --- a/configure.bat +++ b/configure.bat @@ -157,10 +157,10 @@ rem Determine host spec if "%PLATFORM%" == "" ( if not "%icl.exe%" == "" ( set PLATFORM=win32-icc - ) else if not "%clang-cl.exe%" == "" ( - set PLATFORM=win32-clang-msvc ) else if not "%cl.exe%" == "" ( set PLATFORM=win32-msvc + ) else if not "%clang-cl.exe%" == "" ( + set PLATFORM=win32-clang-msvc ) else if not "%g++.exe%" == "" ( set PLATFORM=win32-g++ ) else ( From 8cef809b16aac9d4c4163ff2e2e831adf70133c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Tue, 2 Jan 2018 22:49:08 +0200 Subject: [PATCH 2/7] qmake: Handle QMAKE_LINK_OBJECT_MAX being unset for static libraries This was missed in 8bebded9. Task-number: QTBUG-63637 Change-Id: I6be472430a9aa8f533def4fd6c14c8dbfe8b6f70 Reviewed-by: Oswald Buddenhagen --- qmake/generators/win32/mingw_make.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qmake/generators/win32/mingw_make.cpp b/qmake/generators/win32/mingw_make.cpp index 792ffb1997d..d6d6b04148c 100644 --- a/qmake/generators/win32/mingw_make.cpp +++ b/qmake/generators/win32/mingw_make.cpp @@ -324,7 +324,8 @@ void MingwMakefileGenerator::writeBuildRulesPart(QTextStream &t) t << "\n\t" <isActiveConfig("staticlib") && project->first("TEMPLATE") == "lib") { t << "\n\t-$(DEL_FILE) $(DESTDIR_TARGET) 2>" << var("QMAKE_SHELL_NULL_DEVICE"); - if (project->values("OBJECTS").count() < var("QMAKE_LINK_OBJECT_MAX").toInt()) { + const ProString &objmax = project->first("QMAKE_LINK_OBJECT_MAX"); + if (objmax.isEmpty() || project->values("OBJECTS").count() < objmax.toInt()) { t << "\n\t$(LIB) $(DESTDIR_TARGET) " << objectsLinkLine << " " ; } else { t << "\n\t" << objectsLinkLine << " " ; From 4a11243d3c37ab6917c8e99275259853d1970ec5 Mon Sep 17 00:00:00 2001 From: Timur Pocheptsov Date: Fri, 29 Dec 2017 15:17:53 +0100 Subject: [PATCH 3/7] tst_QUdpSocket - unblacklist tests on Ubuntu 16.04 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We use QSKIP instead for kernel versions [4.6, 4.13). Task-number: QTBUG-65440 Change-Id: Ie764b5a4eb8a67dc2a43d4dc67b5d6eb772f6b2a Reviewed-by: Thiago Macieira Reviewed-by: Joni Jäntti --- .../auto/network/socket/qudpsocket/BLACKLIST | 3 --- .../socket/qudpsocket/tst_qudpsocket.cpp | 20 ++++++++++++++++++- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/tests/auto/network/socket/qudpsocket/BLACKLIST b/tests/auto/network/socket/qudpsocket/BLACKLIST index 3951be16abc..6164c0a60a1 100644 --- a/tests/auto/network/socket/qudpsocket/BLACKLIST +++ b/tests/auto/network/socket/qudpsocket/BLACKLIST @@ -22,12 +22,9 @@ osx osx [broadcasting] osx -ubuntu-16.04 [zeroLengthDatagram] osx [linkLocalIPv6] redhatenterpriselinuxworkstation-6.6 -[pendingDatagramSize] -ubuntu-16.04 [readyReadForEmptyDatagram] ubuntu-16.04 diff --git a/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp b/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp index 5c5dfc881d3..47f5854ff82 100644 --- a/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp +++ b/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp @@ -131,11 +131,13 @@ protected slots: private: bool shouldSkipIpv6TestsForBrokenSetsockopt(); + bool shouldWorkaroundLinuxKernelBug(); #ifdef SHOULD_CHECK_SYSCALL_SUPPORT bool ipv6SetsockoptionMissing(int level, int optname); #endif bool m_skipUnsupportedIPv6Tests; + bool m_workaroundLinuxKernelBug; QList allAddresses; #ifndef QT_NO_BEARERMANAGEMENT QNetworkConfigurationManager *netConfMan; @@ -183,6 +185,16 @@ bool tst_QUdpSocket::shouldSkipIpv6TestsForBrokenSetsockopt() return false; } +bool tst_QUdpSocket::shouldWorkaroundLinuxKernelBug() +{ +#ifdef Q_OS_LINUX + const QVersionNumber version = QVersionNumber::fromString(QSysInfo::kernelVersion()); + return version.majorVersion() == 4 && version.minorVersion() >= 6 && version.minorVersion() < 13; +#else + return false; +#endif +} + static QHostAddress makeNonAny(const QHostAddress &address, QHostAddress::SpecialAddress preferForAny = QHostAddress::LocalHost) { if (address == QHostAddress::Any) @@ -235,7 +247,7 @@ void tst_QUdpSocket::initTestCase() QSKIP("No network test server available"); allAddresses = QNetworkInterface::allAddresses(); m_skipUnsupportedIPv6Tests = shouldSkipIpv6TestsForBrokenSetsockopt(); - + m_workaroundLinuxKernelBug = shouldWorkaroundLinuxKernelBug(); if (EmulationDetector::isRunningArmOnX86()) QSKIP("This test is unreliable due to QEMU emulation shortcomings."); } @@ -329,6 +341,9 @@ void tst_QUdpSocket::unconnectedServerAndClientTest() void tst_QUdpSocket::broadcasting() { + if (m_workaroundLinuxKernelBug) + QSKIP("This test can fail due to linux kernel bug"); + QFETCH_GLOBAL(bool, setProxy); if (setProxy) { #ifndef QT_NO_NETWORKPROXY @@ -797,6 +812,9 @@ void tst_QUdpSocket::bindAndConnectToHost() void tst_QUdpSocket::pendingDatagramSize() { + if (m_workaroundLinuxKernelBug) + QSKIP("This test can fail due to linux kernel bug"); + QUdpSocket server; #ifdef FORCE_SESSION server.setProperty("_q_networksession", QVariant::fromValue(networkSession)); From 9f2ce7e2f651f30daf5403ad04ce2464b85480c8 Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Wed, 3 Jan 2018 14:08:22 +0100 Subject: [PATCH 4/7] winrt: Remove -qdevel and -qdebug from command line parameters These options are used by winrtrunner/Qt Creator to control logging and debugging behavior and should not influence applications. Without this change applications that use QCommandLineParser::process have to explicitly remove these values from the arguments list or the application will exit with an "unknown option" error when run from Qt Creator. As winrt applications do not natively support command line arguments, breaking the use case of having these values as valid command line options is acceptable. [ChangeLog][qtmain][winrt] -qdevel and -qdebug are removed from the command line arguments and not passed to the application. Change-Id: I60e5565148fd3dd0155b946607fdf5042139d2e1 Reviewed-by: David Schulz Reviewed-by: Maurice Kalinowski --- src/winmain/qtmain_winrt.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/winmain/qtmain_winrt.cpp b/src/winmain/qtmain_winrt.cpp index 13ca561d357..1a3ad333222 100644 --- a/src/winmain/qtmain_winrt.cpp +++ b/src/winmain/qtmain_winrt.cpp @@ -295,11 +295,15 @@ private: bool develMode = false; bool debugWait = false; - for (const char *arg : args) { - if (strcmp(arg, "-qdevel") == 0) + for (int i = args.count() - 1; i >= 0; --i) { + const char *arg = args.at(i); + if (strcmp(arg, "-qdevel") == 0) { develMode = true; - if (strcmp(arg, "-qdebug") == 0) + args.remove(i); + } else if (strcmp(arg, "-qdebug") == 0) { debugWait = true; + args.remove(i); + } } if (develMode) { // Write a PID file to help runner From da81b01df856e532a8cabb99949232de1b23327d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20Nordheim?= Date: Fri, 5 Jan 2018 09:49:18 +0100 Subject: [PATCH 5/7] Change use of qDebug to qCDebug Task-number: QTBUG-65532 Change-Id: I8b6b8f04f5f6b63eb3c80f140710c8c05291986a Reviewed-by: Friedemann Kleint Reviewed-by: Timur Pocheptsov --- src/plugins/platforms/windows/qwindowsdialoghelpers.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp b/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp index 4b08528d174..6b978a38feb 100644 --- a/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp +++ b/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp @@ -1221,7 +1221,7 @@ void QWindowsNativeFileDialogBase::onSelectionChange() { const QList current = selectedFiles(); m_data.setSelectedFiles(current); - qDebug() << __FUNCTION__ << current << current.size(); + qCDebug(lcQpaDialogs) << __FUNCTION__ << current << current.size(); if (current.size() == 1) emit currentChanged(current.front()); From fe72571da885499739f723e054e1ba5433fb36e8 Mon Sep 17 00:00:00 2001 From: Jake Petroules Date: Thu, 4 Jan 2018 23:45:42 -0800 Subject: [PATCH 6/7] qmake: replace invalid characters in generated bundle identifiers This problem does not affect the Xcode generator. Task-number: QTBUG-65477 Change-Id: I6194edc5b679edad9ae1a25e35b71e5df9bd4c95 Reviewed-by: Oswald Buddenhagen --- qmake/generators/unix/unixmake2.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp index f7097e58dc2..6b08a2dd28f 100644 --- a/qmake/generators/unix/unixmake2.cpp +++ b/qmake/generators/unix/unixmake2.cpp @@ -155,6 +155,20 @@ UnixMakefileGenerator::writeSubTargets(QTextStream &t, QList= '0' && c <= '9') || (c >= 'A' && c <= 'Z') + || (c >= 'a' && c <= 'z') || c == '-' || c == '.'; + if (!okChar) + ch = QChar::fromLatin1('-'); + } + return s; +} + void UnixMakefileGenerator::writeMakeParts(QTextStream &t) { @@ -826,7 +840,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) if (bundleIdentifier.endsWith(".framework")) bundleIdentifier.chop(10); // replace invalid bundle id characters - bundleIdentifier.replace('_', '-'); + bundleIdentifier = rfc1034Identifier(bundleIdentifier); commonSedArgs << "-e \"s,@BUNDLEIDENTIFIER@," << bundleIdentifier << ",g\" "; if (!isFramework) { From 1c8224511dee2794553da9dc8ed484d49dc78b45 Mon Sep 17 00:00:00 2001 From: Jake Petroules Date: Fri, 5 Jan 2018 00:40:46 -0800 Subject: [PATCH 7/7] qmake: set COPY_PHASE_STRIP to NO in Xcode generator Since Xcode 6.3, this must be set to NO because stripping on copy is no longer fully supported due to the potential of input binaries being code signed. In this case Xcode will simply ignore the strip step and issue a warning since stripping would invalidate the code signature. This change silences that annoying warning for release builds. Also, the setting assignment is moved from being hardcoded in the generator, to a QMAKE_MAC_XCODE_SETTINGS value. Change-Id: If25511edddc12b7b0407e2992d80884b7d6437dc Reviewed-by: Gabriel de Dietrich --- mkspecs/features/mac/default_pre.prf | 4 ++++ qmake/generators/mac/pbuilder_pbx.cpp | 2 -- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/mkspecs/features/mac/default_pre.prf b/mkspecs/features/mac/default_pre.prf index 44636f22889..e3534561a56 100644 --- a/mkspecs/features/mac/default_pre.prf +++ b/mkspecs/features/mac/default_pre.prf @@ -54,3 +54,7 @@ macx-xcode:qtConfig(static): \ # feature, which allows Xcode to choose the Qt libraries to link to # at build time, depending on the current Xcode SDK and configuration. QMAKE_XCODE_LIBRARY_SUFFIX_SETTING = QT_LIBRARY_SUFFIX + +xcode_copy_phase_strip_setting.name = COPY_PHASE_STRIP +xcode_copy_phase_strip_setting.value = NO +QMAKE_MAC_XCODE_SETTINGS += xcode_copy_phase_strip_setting diff --git a/qmake/generators/mac/pbuilder_pbx.cpp b/qmake/generators/mac/pbuilder_pbx.cpp index 0622ace71b1..db7a1b27145 100644 --- a/qmake/generators/mac/pbuilder_pbx.cpp +++ b/qmake/generators/mac/pbuilder_pbx.cpp @@ -279,7 +279,6 @@ ProjectBuilderMakefileGenerator::writeSubDirs(QTextStream &t) QString configName = (as_release ? "Release" : "Debug"); QMap settings; - settings.insert("COPY_PHASE_STRIP", (as_release ? "YES" : "NO")); if(project->isActiveConfig("sdk") && !project->isEmpty("QMAKE_MAC_SDK")) settings.insert("SDKROOT", project->first("QMAKE_MAC_SDK").toQString()); { @@ -1493,7 +1492,6 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t) settings.insert("PROVISIONING_PROFILE_SPECIFIER", project->first("QMAKE_PROVISIONING_PROFILE").toQString()); } - settings.insert("COPY_PHASE_STRIP", (as_release ? "YES" : "NO")); settings.insert("APPLICATION_EXTENSION_API_ONLY", project->isActiveConfig("app_extension_api_only") ? "YES" : "NO"); // required for tvOS (and watchos), optional on iOS (deployment target >= iOS 6.0) settings.insert("ENABLE_BITCODE", project->isActiveConfig("bitcode") ? "YES" : "NO");