From 938f9fc0f8ff1575413ca3d6d66860b5fa315768 Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Tue, 19 May 2015 16:07:42 +0200 Subject: Workaround for Samsung keyboard bug Return null string instead of empty string when the selection is empty. It looks like Samsung just tests for selection == null when doing backspace. Task-number: QTBUG-45785 Change-Id: Iaa006a8ffe52b2704c7348646dde9ca4e1f78c5c Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/plugins/platforms/android/qandroidinputcontext.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/platforms/android/qandroidinputcontext.cpp b/src/plugins/platforms/android/qandroidinputcontext.cpp index 7e81735de9..7264f9a74c 100644 --- a/src/plugins/platforms/android/qandroidinputcontext.cpp +++ b/src/plugins/platforms/android/qandroidinputcontext.cpp @@ -176,6 +176,8 @@ static jstring getSelectedText(JNIEnv *env, jobject /*thiz*/, jint flags) #ifdef QT_DEBUG_ANDROID_IM_PROTOCOL qDebug() << "@@@ GETSEL" << text; #endif + if (text.isEmpty()) + return 0; return env->NewString(reinterpret_cast(text.constData()), jsize(text.length())); } -- cgit v1.2.3 From d4a296b538da93f5c915fc7e886c6995f1b41169 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Wed, 20 May 2015 13:35:07 +0200 Subject: Do not modify decoder when determining image-format We should not configure the decoder when just determining the image- format. Doing so can cause all versions of libpng to print a warning, and some versions to fail to decode. The code appears to be a leftover from when the image-format logic was copied out of the introduction of the decoding method, where the proper settings are still applied. Task-number: QTBUG-46233 Change-Id: I6619728804f040ae6c9d637c7298a8586e22499e Reviewed-by: Andy Shaw Reviewed-by: aavit --- src/gui/image/qpnghandler.cpp | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/gui/image/qpnghandler.cpp b/src/gui/image/qpnghandler.cpp index 17a0dd3eb9..304ab0cf3e 100644 --- a/src/gui/image/qpnghandler.cpp +++ b/src/gui/image/qpnghandler.cpp @@ -674,16 +674,9 @@ QImage::Format QPngHandlerPrivate::readImageFormat() && num_palette <= 256) { // 1-bit and 8-bit color - if (bit_depth != 1) - png_set_packing(png_ptr); - png_read_update_info(png_ptr, info_ptr); - png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, &color_type, 0, 0, 0); format = bit_depth == 1 ? QImage::Format_Mono : QImage::Format_Indexed8; } else { // 32-bit - if (bit_depth == 16) - png_set_strip_16(png_ptr); - format = QImage::Format_ARGB32; // Only add filler if no alpha, or we can get 5 channel data. if (!(color_type & PNG_COLOR_MASK_ALPHA) -- cgit v1.2.3 From 7a4f3645f44bae78987facbf4e39231d0d2882ef Mon Sep 17 00:00:00 2001 From: "Richard J. Moore" Date: Sat, 23 May 2015 12:11:09 +0100 Subject: Avoid false positives from google by storing OpenSSL version as Unicode. Google scan play store apps for the openssl version string which leads to false positives since we record the version we were compiled against even though we don't link it directly. Task-number: QTBUG-46265 Change-Id: Iefd0e0954149c17350d49f57f9f374938124d7b8 Reviewed-by: Olivier Goffart (Woboq GmbH) --- src/network/ssl/qsslsocket_openssl.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/network/ssl/qsslsocket_openssl.cpp b/src/network/ssl/qsslsocket_openssl.cpp index b132aec038..ac4336afcc 100644 --- a/src/network/ssl/qsslsocket_openssl.cpp +++ b/src/network/ssl/qsslsocket_openssl.cpp @@ -588,7 +588,10 @@ long QSslSocketPrivate::sslLibraryBuildVersionNumber() QString QSslSocketPrivate::sslLibraryBuildVersionString() { - return QLatin1String(OPENSSL_VERSION_TEXT); + // Using QStringLiteral to store the version string as unicode and + // avoid false positives from Google searching the playstore for old + // SSL versions. See QTBUG-46265 + return QStringLiteral(OPENSSL_VERSION_TEXT); } /*! -- cgit v1.2.3 From 8829ce67d8d0eac90e9fd6fde088b41f157177a5 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Mon, 25 May 2015 14:55:38 +0200 Subject: Only add -fPIC flags for compilers known to require it. Commit 083c9269 (Try to ensure that -fPIC is used in CMake builds, 2015-05-11) added a raw -fPIC to the INTERFACE_COMPILE_OPTIONS of Qt5::Core, which affects all consuming compilers. Use the qmake variable $$QMAKE_CXXFLAGS_APP instead, which at least currently contains only the -fPIC variable or harmlessly expands to nothing. If the content of that qmake variable changes in the future, a $$QMAKE_CXXFLAGS_APP_PIC variable should be extracted in qmake and used here. Don't use the POSITION_INDEPENDENT_CODE feature of CMake. That adds the -fPIE flag for executables, which is explicitly what qglobal.h forbids since commit 3eca75de (Make qglobal.h complain if you use -fPIE, 2015-05-11). The current behavior of that CMake feature is tracked here: http://public.kitware.com/Bug/view.php?id=15570 Change-Id: I5c5bcc40fe4b310b55a681a3505f45c50adfa054 Reviewed-by: Oswald Buddenhagen Reviewed-by: Simon Hausmann --- src/corelib/Qt5CoreConfigExtras.cmake.in | 3 +-- src/corelib/Qt5CoreMacros.cmake | 4 ---- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/corelib/Qt5CoreConfigExtras.cmake.in b/src/corelib/Qt5CoreConfigExtras.cmake.in index d4abc5f271..a5cab880ba 100644 --- a/src/corelib/Qt5CoreConfigExtras.cmake.in +++ b/src/corelib/Qt5CoreConfigExtras.cmake.in @@ -71,8 +71,7 @@ set(_qt5_corelib_extra_includes) # macro to add it. set(Qt5_POSITION_INDEPENDENT_CODE True) set(Qt5Core_EXECUTABLE_COMPILE_FLAGS \"-fPIC\") -set_property(TARGET Qt5::Core PROPERTY INTERFACE_POSITION_INDEPENDENT_CODE \"ON\") -set_property(TARGET Qt5::Core APPEND PROPERTY INTERFACE_COMPILE_OPTIONS ${Qt5Core_EXECUTABLE_COMPILE_FLAGS}) +set_property(TARGET Qt5::Core APPEND PROPERTY INTERFACE_COMPILE_OPTIONS $$QMAKE_CXXFLAGS_APP) !!IF !isEmpty(QT_NAMESPACE) list(APPEND Qt5Core_DEFINITIONS -DQT_NAMESPACE=$$QT_NAMESPACE) diff --git a/src/corelib/Qt5CoreMacros.cmake b/src/corelib/Qt5CoreMacros.cmake index 9c81754302..c10880f787 100644 --- a/src/corelib/Qt5CoreMacros.cmake +++ b/src/corelib/Qt5CoreMacros.cmake @@ -281,10 +281,6 @@ if (NOT CMAKE_VERSION VERSION_LESS 2.8.9) set_property(TARGET ${_target} APPEND PROPERTY COMPILE_DEFINITIONS_RELEASE QT_NO_DEBUG) set_property(TARGET ${_target} APPEND PROPERTY COMPILE_DEFINITIONS_RELWITHDEBINFO QT_NO_DEBUG) set_property(TARGET ${_target} APPEND PROPERTY COMPILE_DEFINITIONS_MINSIZEREL QT_NO_DEBUG) - - if (Qt5_POSITION_INDEPENDENT_CODE) - set_property(TARGET ${_target} PROPERTY POSITION_INDEPENDENT_CODE ${Qt5_POSITION_INDEPENDENT_CODE}) - endif() endforeach() endmacro() endif() -- cgit v1.2.3 From 6255859ebf19b38c864cd6dbaf2878e0116535a4 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Wed, 27 May 2015 16:17:19 +0200 Subject: Fix cmake auto tests failing with cmake 2.8.11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After commit 3eca75de67b3fd2c890715b30c7899cebc096fe9 the use of _EXECUTABLE_COMPILE_FLAGS becomes mandatory for 2.8.11 or older. Therefore use it in test_use_modules - that's supposed to work with all cmake versions it seems - and bump test_interface to require 2.8.12. Change-Id: I7cfb6c6f1e8a97be916d372b9d9148490926693c Reviewed-by: Lisandro Damián Nicanor Pérez Meyer Reviewed-by: Stephen Kelly --- tests/auto/cmake/CMakeLists.txt | 5 +---- tests/auto/cmake/test_interface/CMakeLists.txt | 2 +- tests/auto/cmake/test_use_modules_function/CMakeLists.txt | 2 ++ 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/tests/auto/cmake/CMakeLists.txt b/tests/auto/cmake/CMakeLists.txt index 87d8a802f3..b68aafe956 100644 --- a/tests/auto/cmake/CMakeLists.txt +++ b/tests/auto/cmake/CMakeLists.txt @@ -126,11 +126,8 @@ if (QT_WITH_ANGLE OR (NOT WIN32 AND NOT APPLE AND NOT NO_EGL)) endif() expect_pass(test_opengl_lib) -if (NOT CMAKE_VERSION VERSION_LESS 2.8.11) - expect_pass(test_interface) -endif() - if (NOT CMAKE_VERSION VERSION_LESS 2.8.12) + expect_pass(test_interface) expect_pass(test_interface_link_libraries) expect_pass(test_moc_macro_target) endif() diff --git a/tests/auto/cmake/test_interface/CMakeLists.txt b/tests/auto/cmake/test_interface/CMakeLists.txt index a8af92da63..bd3217a497 100644 --- a/tests/auto/cmake/test_interface/CMakeLists.txt +++ b/tests/auto/cmake/test_interface/CMakeLists.txt @@ -1,5 +1,5 @@ -cmake_minimum_required(VERSION 2.8.11) +cmake_minimum_required(VERSION 2.8.12) project(test_interface) diff --git a/tests/auto/cmake/test_use_modules_function/CMakeLists.txt b/tests/auto/cmake/test_use_modules_function/CMakeLists.txt index bfcdd9d1d7..be05c75054 100644 --- a/tests/auto/cmake/test_use_modules_function/CMakeLists.txt +++ b/tests/auto/cmake/test_use_modules_function/CMakeLists.txt @@ -12,5 +12,7 @@ add_executable(three three.cpp) find_package(Qt5Core) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Core_EXECUTABLE_COMPILE_FLAGS}") + qt5_use_modules(two Test) qt5_use_modules(three Gui Test) -- cgit v1.2.3 From 9d662d9d2f33d75d3fbf682ee9fadc291ecae5cb Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Wed, 27 May 2015 12:47:12 +0200 Subject: Mention cmake changes in ChangeLog for -fPIE -> -fPIC changes This is a follow-up change to commit 3eca75de67b3fd2c890715b30c7899cebc096fe9 to mention changes required to CMakeLists.txt for users of Qt. Change-Id: I1c9ed162427cdc620f998ccf266d59886901c28d Reviewed-by: Lars Knoll --- dist/changes-5.4.2 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dist/changes-5.4.2 b/dist/changes-5.4.2 index 5827187e9e..29d3c6346d 100644 --- a/dist/changes-5.4.2 +++ b/dist/changes-5.4.2 @@ -41,6 +41,10 @@ information about a particular change. Qt's option "reduce relocations" is active. Note that Clang is known to generate incompatible code even with -fPIC if the -flto option is active. + Applications using qmake or cmake >= 2.8.12 as their build system will + adapt automatically. Applications using an older release of cmake need to + change their CMakeLists.txt to add Qt5Core_EXECUTABLE_COMPILE_FLAGS to + CMAKE_CXX_FLAGS. **************************************************************************** * Library * -- cgit v1.2.3 From 95b6c4fed6521aa2212cab67cb8a6e5553e86117 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 28 May 2015 11:21:35 -0700 Subject: Make qglobal.h only complain for GCC >= 5 about -fPIE Commit 3eca75de67b3fd2c890715b30c7899cebc096fe9 introduced the #error nagging about use of -fPIE, but it makes the transition quite difficult for people using other buildsystems. So let's give people a grace period and enforce only for GCC >= 5. Clang is affected, but differently. The problem only happens with -flto -- that is, it happens when the linker detects that it's creating a final executable. Maybe -Wl,-pie would fix it. Change-Id: If4d5ac8db0ed4a84a3eaffff13e275edc29a72b7 Reviewed-by: Simon Hausmann Reviewed-by: Dmitry Shachnev --- src/corelib/global/qglobal.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 4547877da6..d9742408a3 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -1047,7 +1047,8 @@ Q_CORE_EXPORT int qrand(); # define QT_NO_SHAREDMEMORY #endif -#if !defined(QT_BOOTSTRAPPED) && defined(QT_REDUCE_RELOCATIONS) && defined(__ELF__) && (!defined(__PIC__) || defined(__PIE__)) +#if !defined(QT_BOOTSTRAPPED) && defined(QT_REDUCE_RELOCATIONS) && defined(__ELF__) && \ + (!defined(__PIC__) || (defined(__PIE__) && defined(Q_CC_GNU) && Q_CC_GNU >= 500)) # error "You must build your code with position independent code if Qt was built with -reduce-relocations. "\ "Compile your code with -fPIC (-fPIE is not enough)." #endif -- cgit v1.2.3 From e3983c87280ade48b243d9c60bed639713851be9 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Thu, 28 May 2015 21:20:55 +0200 Subject: Revert some changes in light of GCC 4 -fPIE reversal The -fPIE option is now accepted when using GCC 4, which means it is available for backward compatibility for clients using CMake 2.8.11 or older which makes use of the POSITION_INDEPENDENT_CODE feature. Conditionally use that feature for old versions of cmake with GCC 4. Restore the tests for those versions, and clarify the situation in the ChangeLog. Change-Id: I5a06b155dda7db559d86841a2b34fd8ed95acbd0 Reviewed-by: Thiago Macieira --- dist/changes-5.4.2 | 20 +++++++++++++------- src/corelib/Qt5CoreConfigExtras.cmake.in | 8 +++++++- src/corelib/Qt5CoreMacros.cmake | 6 ++++++ tests/auto/cmake/CMakeLists.txt | 5 ++++- tests/auto/cmake/test_interface/CMakeLists.txt | 2 +- .../cmake/test_use_modules_function/CMakeLists.txt | 2 -- 6 files changed, 31 insertions(+), 12 deletions(-) diff --git a/dist/changes-5.4.2 b/dist/changes-5.4.2 index 29d3c6346d..1a34898011 100644 --- a/dist/changes-5.4.2 +++ b/dist/changes-5.4.2 @@ -37,14 +37,20 @@ information about a particular change. - On x86 and x86-64 systems with ELF binaries (especially Linux), due to a new optimization in GCC 5.x in combination with a recent version of GNU binutils, compiling Qt applications with -fPIE is no longer - enough. Applications now need to be compiled with the -fPIC option if - Qt's option "reduce relocations" is active. Note that Clang is known - to generate incompatible code even with -fPIC if the -flto option is - active. + enough with GCC 5.x. Applications now need to be compiled with + the -fPIC option if Qt's option "reduce relocations" is active. For + backward compatibility only, Qt accepts the use of -fPIE for GCC 4.x + versions. + Note that Clang is known to generate incompatible code even with -fPIC if + the -flto option is active. Applications using qmake or cmake >= 2.8.12 as their build system will - adapt automatically. Applications using an older release of cmake need to - change their CMakeLists.txt to add Qt5Core_EXECUTABLE_COMPILE_FLAGS to - CMAKE_CXX_FLAGS. + adapt automatically. Applications using an older release of cmake in + combination with GCC 5.x need to change their CMakeLists.txt to add + Qt5Core_EXECUTABLE_COMPILE_FLAGS to CMAKE_CXX_FLAGS. In particular, + applications using cmake >= 2.8.9 and < 2.8.11 will continue to build + with the -fPIE option and invoke the special compatibility mode if using + GCC 4.x. + **************************************************************************** * Library * diff --git a/src/corelib/Qt5CoreConfigExtras.cmake.in b/src/corelib/Qt5CoreConfigExtras.cmake.in index a5cab880ba..65fd1f9383 100644 --- a/src/corelib/Qt5CoreConfigExtras.cmake.in +++ b/src/corelib/Qt5CoreConfigExtras.cmake.in @@ -71,7 +71,13 @@ set(_qt5_corelib_extra_includes) # macro to add it. set(Qt5_POSITION_INDEPENDENT_CODE True) set(Qt5Core_EXECUTABLE_COMPILE_FLAGS \"-fPIC\") -set_property(TARGET Qt5::Core APPEND PROPERTY INTERFACE_COMPILE_OPTIONS $$QMAKE_CXXFLAGS_APP) +if (CMAKE_VERSION VERSION_LESS 2.8.12 + AND (NOT CMAKE_CXX_COMPILER_ID STREQUAL \"GNU\" + OR CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0)) + set_property(TARGET Qt5::Core APPEND PROPERTY INTERFACE_POSITION_INDEPENDENT_CODE \"ON\") +else() + set_property(TARGET Qt5::Core APPEND PROPERTY INTERFACE_COMPILE_OPTIONS $$QMAKE_CXXFLAGS_APP) +endif() !!IF !isEmpty(QT_NAMESPACE) list(APPEND Qt5Core_DEFINITIONS -DQT_NAMESPACE=$$QT_NAMESPACE) diff --git a/src/corelib/Qt5CoreMacros.cmake b/src/corelib/Qt5CoreMacros.cmake index c10880f787..cfbb381df5 100644 --- a/src/corelib/Qt5CoreMacros.cmake +++ b/src/corelib/Qt5CoreMacros.cmake @@ -281,6 +281,12 @@ if (NOT CMAKE_VERSION VERSION_LESS 2.8.9) set_property(TARGET ${_target} APPEND PROPERTY COMPILE_DEFINITIONS_RELEASE QT_NO_DEBUG) set_property(TARGET ${_target} APPEND PROPERTY COMPILE_DEFINITIONS_RELWITHDEBINFO QT_NO_DEBUG) set_property(TARGET ${_target} APPEND PROPERTY COMPILE_DEFINITIONS_MINSIZEREL QT_NO_DEBUG) + if (Qt5_POSITION_INDEPENDENT_CODE + AND (CMAKE_VERSION VERSION_LESS 2.8.12 + AND (NOT CMAKE_CXX_COMPILER_ID STREQUAL \"GNU\" + OR CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0))) + set_property(TARGET ${_target} PROPERTY POSITION_INDEPENDENT_CODE ${Qt5_POSITION_INDEPENDENT_CODE}) + endif() endforeach() endmacro() endif() diff --git a/tests/auto/cmake/CMakeLists.txt b/tests/auto/cmake/CMakeLists.txt index b68aafe956..87d8a802f3 100644 --- a/tests/auto/cmake/CMakeLists.txt +++ b/tests/auto/cmake/CMakeLists.txt @@ -126,8 +126,11 @@ if (QT_WITH_ANGLE OR (NOT WIN32 AND NOT APPLE AND NOT NO_EGL)) endif() expect_pass(test_opengl_lib) -if (NOT CMAKE_VERSION VERSION_LESS 2.8.12) +if (NOT CMAKE_VERSION VERSION_LESS 2.8.11) expect_pass(test_interface) +endif() + +if (NOT CMAKE_VERSION VERSION_LESS 2.8.12) expect_pass(test_interface_link_libraries) expect_pass(test_moc_macro_target) endif() diff --git a/tests/auto/cmake/test_interface/CMakeLists.txt b/tests/auto/cmake/test_interface/CMakeLists.txt index bd3217a497..a8af92da63 100644 --- a/tests/auto/cmake/test_interface/CMakeLists.txt +++ b/tests/auto/cmake/test_interface/CMakeLists.txt @@ -1,5 +1,5 @@ -cmake_minimum_required(VERSION 2.8.12) +cmake_minimum_required(VERSION 2.8.11) project(test_interface) diff --git a/tests/auto/cmake/test_use_modules_function/CMakeLists.txt b/tests/auto/cmake/test_use_modules_function/CMakeLists.txt index be05c75054..bfcdd9d1d7 100644 --- a/tests/auto/cmake/test_use_modules_function/CMakeLists.txt +++ b/tests/auto/cmake/test_use_modules_function/CMakeLists.txt @@ -12,7 +12,5 @@ add_executable(three three.cpp) find_package(Qt5Core) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Core_EXECUTABLE_COMPILE_FLAGS}") - qt5_use_modules(two Test) qt5_use_modules(three Gui Test) -- cgit v1.2.3