diff --git a/dist/changes-5.4.2 b/dist/changes-5.4.2 index e1ad9b6846..5827187e9e 100644 --- a/dist/changes-5.4.2 +++ b/dist/changes-5.4.2 @@ -34,6 +34,13 @@ information about a particular change. common EXIF-format (big-endian) was not working until 5.4.1. 5.4.2 restores the behavior of 5.4.0 and earlier for most EXIF-tagged JPEGs. EXIF orientation will be an opt-in starting with Qt 5.5. +- 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. **************************************************************************** * Library * diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index ef84662036..4547877da6 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -1047,9 +1047,9 @@ Q_CORE_EXPORT int qrand(); # define QT_NO_SHAREDMEMORY #endif -#if !defined(QT_BOOTSTRAPPED) && defined(QT_REDUCE_RELOCATIONS) && defined(__ELF__) && !defined(__PIC__) +#if !defined(QT_BOOTSTRAPPED) && defined(QT_REDUCE_RELOCATIONS) && defined(__ELF__) && (!defined(__PIC__) || defined(__PIE__)) # error "You must build your code with position independent code if Qt was built with -reduce-relocations. "\ - "Compile your code with -fPIC." + "Compile your code with -fPIC (-fPIE is not enough)." #endif namespace QtPrivate {