diff options
author | Olivier Goffart <ogoffart@woboq.com> | 2012-01-29 13:54:19 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-02-10 11:42:31 +0100 |
commit | 482d96a0c5d523ace63f56bda6851926b4469dd0 (patch) | |
tree | ab25f3f91adbd6031f0bb83812b516e80131bff4 /mkspecs/common/gcc-base.conf | |
parent | 09e2e77be25e02ff1c3ba432d739fbc5fe860ec7 (diff) |
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>
Diffstat (limited to 'mkspecs/common/gcc-base.conf')
-rw-r--r-- | mkspecs/common/gcc-base.conf | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/mkspecs/common/gcc-base.conf b/mkspecs/common/gcc-base.conf index 0e90666350..28e3b87b5d 100644 --- a/mkspecs/common/gcc-base.conf +++ b/mkspecs/common/gcc-base.conf @@ -39,6 +39,7 @@ QMAKE_CFLAGS_RELEASE += -O2 QMAKE_CFLAGS_DEBUG += -g QMAKE_CFLAGS_SHLIB += -fPIC QMAKE_CFLAGS_STATIC_LIB += -fPIC +QMAKE_CFLAGS_APP += -fPIE QMAKE_CFLAGS_YACC += -Wno-unused -Wno-parentheses QMAKE_CFLAGS_HIDESYMS += -fvisibility=hidden @@ -50,6 +51,7 @@ QMAKE_CXXFLAGS_RELEASE += $$QMAKE_CFLAGS_RELEASE QMAKE_CXXFLAGS_DEBUG += $$QMAKE_CFLAGS_DEBUG QMAKE_CXXFLAGS_SHLIB += $$QMAKE_CFLAGS_SHLIB QMAKE_CXXFLAGS_STATIC_LIB += $$QMAKE_CFLAGS_STATIC_LIB +QMAKE_CXXFLAGS_APP += $$QMAKE_CFLAGS_APP QMAKE_CXXFLAGS_YACC += $$QMAKE_CFLAGS_YACC QMAKE_CXXFLAGS_HIDESYMS += $$QMAKE_CFLAGS_HIDESYMS -fvisibility-inlines-hidden |