Force -fPIE on ELF if Qt is built with reduced relocations
authorOlivier Goffart <ogoffart@woboq.com>
Sun, 29 Jan 2012 12:54:19 +0000 (13:54 +0100)
committerQt by Nokia <qt-info@nokia.com>
Fri, 10 Feb 2012 10:42:31 +0000 (11:42 +0100)
commit482d96a0c5d523ace63f56bda6851926b4469dd0
treeab25f3f91adbd6031f0bb83812b516e80131bff4
parent09e2e77be25e02ff1c3ba432d739fbc5fe860ec7
Force -fPIE on ELF if Qt is built with reduced relocations

Put in qconfig.h whether qt is compiled with reduced relocations.

When using -Bsymbolic-functions (enabled by default on Qt)
but not -fPIE, the comparison of the function pointers fail
because the addresses are different in Qt, and in the executable.

Hence we now enable -fPIE by default on qmake, and force a compilation
error when it is not enabled and built with reduced relocations.

Done-with: Sune Vuorela <sune@vuorela.dk>
Change-Id: Ib3fdba06fab6e8a93b75b4c6cf16cc973ab335db
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
configure
mkspecs/common/gcc-base.conf
src/corelib/global/qglobal.h
tests/auto/corelib/kernel/qobject/tst_qobject.cpp
tests/auto/tools/moc/tst_moc.cpp