Merge "Merge remote-tracking branch 'origin/5.4.2' into 5.4" into refs/staging/5.4

This commit is contained in:
Liang Qi 2015-05-29 14:17:21 +00:00 committed by The Qt Project
commit 0c5fbd397c
7 changed files with 33 additions and 17 deletions

18
dist/changes-5.4.2 vendored
View File

@ -37,10 +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 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 *

View File

@ -71,8 +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 PROPERTY INTERFACE_POSITION_INDEPENDENT_CODE \"ON\")
set_property(TARGET Qt5::Core APPEND PROPERTY INTERFACE_COMPILE_OPTIONS ${Qt5Core_EXECUTABLE_COMPILE_FLAGS})
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)

View File

@ -281,8 +281,10 @@ 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)
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()

View File

@ -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

View File

@ -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)

View File

@ -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);
}
/*!

View File

@ -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<const jchar *>(text.constData()), jsize(text.length()));
}