From 311f8157ae1aa77a0fb0154e8207678a0d919703 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Wed, 10 May 2023 13:47:33 +0200 Subject: [PATCH 1/2] iOS: Don't add Qt libraries to PRE_TARGETDEPS of xcodebuild Makefile Support for PRE_TARGETDEPS was added for iOS applications in 53ac8094b13d52b7da8b029cf4716827241283c3, even if the Xcode generator doesn't support PRE_TARGETDEPS, by taking advantage of the glue Makefile we use to run xcodebuild. And we add our own Qt libraries to PRE_TARGETDEPS in qt.prf, as you would expect. But since Xcode supports both debug and release, we always set debug_and_release for this glue Makefile. The result is that when computing the Qt library PRE_TARGETDEPS, we fail to apply a _debug suffix from qtPlatformTargetSuffix(), since we've enabled debug_and_release. In a debug only build, this means that 'make' of the glue Makefile will fail to find the release versions of our Qt libraries. To work around this we skip adding Qt to the target deps when generating the xcodebuild Makefile, as we know these libraries are added to the target in the Xcode project. Pick-to: 6.5 6.2 Change-Id: Icafc103e34a6f83240fa8187181d885fb0172a86 Reviewed-by: Joerg Bornemann --- mkspecs/features/qt.prf | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mkspecs/features/qt.prf b/mkspecs/features/qt.prf index 7799a29fa8..d6a87b7599 100644 --- a/mkspecs/features/qt.prf +++ b/mkspecs/features/qt.prf @@ -252,15 +252,16 @@ for(ever) { } else { lib_bases = $$MODULE_MODULE$$qtPlatformTargetSuffix() darwin: lib_bases *= $$MODULE_MODULE + add_lib_to_pretargetdeps = false win32|contains(MODULE_CONFIG, staticlib) { lib_prefix = $$MODULE_LIBS/$$QMAKE_PREFIX_STATICLIB lib_suffixes = $$QMAKE_EXTENSION_STATICLIB lib_suffixes *= $$QMAKE_LIB_EXTENSIONS - add_lib_to_pretargetdeps = true + !xcodebuild: \ + add_lib_to_pretargetdeps = true } else { lib_prefix = $$MODULE_LIBS/$$QMAKE_PREFIX_SHLIB lib_suffixes = $$QMAKE_EXTENSION_SHLIB - add_lib_to_pretargetdeps = false } candidates = for(lib_base, lib_bases) { From 86a0e70d65f406359e36b1a0f714a8ff3e5394e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20Nordheim?= Date: Tue, 25 Apr 2023 14:30:44 +0200 Subject: [PATCH 2/2] QDataBuffer: decrease size on shrink() Having the size potentially be larger than the capacity can't be considered anything other than a bug. Pick-to: 6.5 Change-Id: Id059c0f2c7320f992d897011d7aa944c5cb86058 Reviewed-by: Laszlo Agocs --- src/gui/painting/qdatabuffer_p.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gui/painting/qdatabuffer_p.h b/src/gui/painting/qdatabuffer_p.h index 1e62c8d924..8f467afe4e 100644 --- a/src/gui/painting/qdatabuffer_p.h +++ b/src/gui/painting/qdatabuffer_p.h @@ -89,13 +89,16 @@ public: } void shrink(qsizetype size) { + Q_ASSERT(capacity >= size); capacity = size; if (size) { buffer = (Type*) realloc(static_cast(buffer), capacity * sizeof(Type)); Q_CHECK_PTR(buffer); + siz = std::min(siz, size); } else { free(buffer); buffer = nullptr; + siz = 0; } }