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>
This commit is contained in:
Thiago Macieira 2017-01-25 07:22:04 -08:00
parent a23d705e18
commit 51dafeda8c

View File

@ -79,6 +79,7 @@ QMAKE_LINK = icpc
QMAKE_LINK_SHLIB = icpc QMAKE_LINK_SHLIB = icpc
QMAKE_LFLAGS = QMAKE_LFLAGS =
QMAKE_LFLAGS_RELEASE = QMAKE_LFLAGS_RELEASE =
QMAKE_LFLAGS_APP = -pie
QMAKE_LFLAGS_DEBUG = QMAKE_LFLAGS_DEBUG =
QMAKE_LFLAGS_SHLIB = -shared -shared-intel QMAKE_LFLAGS_SHLIB = -shared -shared-intel
QMAKE_LFLAGS_PLUGIN = $$QMAKE_LFLAGS_SHLIB QMAKE_LFLAGS_PLUGIN = $$QMAKE_LFLAGS_SHLIB