summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2017-01-25 07:22:04 -0800
committerThiago Macieira <thiago.macieira@intel.com>2017-03-17 05:40:25 +0000
commitcd9b79e0e4b8d36ee7287c787cb57a6f0e1b5672 (patch)
treeac4e2d6fcc8dd3ce7ecd5d5848b6239aa12114e1
parentf780eeadb599a7ecadf9d6cb670fd73b416267dd (diff)
linux-icc: always compile applications as position-independent execs
The problem isn't the compiler, but the linker, so we ought to turn this flag on for all ELF-based systems where we compile Qt with -Bsymbolic, but so far only the Intel compiler has been affected. We can turn it on as needed for other systems. The cause of the problem is the way that ICC materializes the pointer- to-member-function: it stores the full 2*sizeof(void*) data in an anonymous variable, so that it can load it in one go, such as one 16- byte SSE aligned load on 64-bit systems. That relocation in a data variable gets turned into a fixed-position copy relocation by the linker, which breaks the signal-identification mechanism. GCC and Clang are likely to be affected if anyone did: static const auto destroyed = &QObject::destroyed; QObject::connect(obj, destroyed, [](){}); Task-number: QTBUG-52439 Change-Id: I0d69eaf61af149db9574fffd149d0cfb08459c33 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> (cherry picked from commit 51dafeda8c833134acf7da40f7ad58cec349ee30) Reviewed-by: Dominik Haumann <dhaumann@kde.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
-rw-r--r--mkspecs/linux-icc/qmake.conf1
1 files changed, 1 insertions, 0 deletions
diff --git a/mkspecs/linux-icc/qmake.conf b/mkspecs/linux-icc/qmake.conf
index 57f6c45ac1..d9b2d849fb 100644
--- a/mkspecs/linux-icc/qmake.conf
+++ b/mkspecs/linux-icc/qmake.conf
@@ -72,6 +72,7 @@ QMAKE_LINK = icpc
QMAKE_LINK_SHLIB = icpc
QMAKE_LFLAGS =
QMAKE_LFLAGS_RELEASE =
+QMAKE_LFLAGS_APP = -pie
QMAKE_LFLAGS_DEBUG =
QMAKE_LFLAGS_SHLIB = -shared -shared-intel
QMAKE_LFLAGS_PLUGIN = $$QMAKE_LFLAGS_SHLIB