diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2014-06-26 14:56:06 -0700 |
---|---|---|
committer | hjk <hjk121@nokiamail.com> | 2014-07-23 11:12:02 +0200 |
commit | 1bd27f24fb7f7d82f4b67cffe43e0af644709106 (patch) | |
tree | 4f35d7ed8bb0a9e5f7a4381e0b09f69414d8f9d5 /mkspecs/common/gcc-base.conf | |
parent | 849d1fece1da7136911464bc47439b4126145440 (diff) | |
download | qtbase-1bd27f24fb7f7d82f4b67cffe43e0af644709106.tar.gz |
Add link-time optimization support for Clang, GCC and ICC
GCC currently requires fat object files for static libraries, since the
linker would otherwise not load the .o file from the archive at all and
the linking would fail with a lot of undefined references. Clang on
Linux also needs this, but it has no equivalent flag, so enabling LTCG
for Clang on static libraries will result in linker error.
This commit does not add support for enabling it in configure. It can be
enabled on a per-project basis by doing CONFIG += ltcg or by passing
-config ltcg to qmake's command-line.
Change-Id: I52cf99f1ed9f1701e23a3b457ba3502fd28126ce
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Diffstat (limited to 'mkspecs/common/gcc-base.conf')
-rw-r--r-- | mkspecs/common/gcc-base.conf | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/mkspecs/common/gcc-base.conf b/mkspecs/common/gcc-base.conf index fcff502af6..06d87d7b36 100644 --- a/mkspecs/common/gcc-base.conf +++ b/mkspecs/common/gcc-base.conf @@ -48,6 +48,7 @@ QMAKE_CFLAGS_YACC += -Wno-unused -Wno-parentheses QMAKE_CFLAGS_HIDESYMS += -fvisibility=hidden QMAKE_CFLAGS_EXCEPTIONS_OFF += -fno-exceptions QMAKE_CFLAGS_SPLIT_SECTIONS += -ffunction-sections +QMAKE_CFLAGS_LTCG = -flto QMAKE_CXXFLAGS += $$QMAKE_CFLAGS QMAKE_CXXFLAGS_DEPS += $$QMAKE_CFLAGS_DEPS @@ -62,12 +63,14 @@ QMAKE_CXXFLAGS_YACC += $$QMAKE_CFLAGS_YACC QMAKE_CXXFLAGS_HIDESYMS += $$QMAKE_CFLAGS_HIDESYMS -fvisibility-inlines-hidden QMAKE_CXXFLAGS_EXCEPTIONS_OFF += $$QMAKE_CFLAGS_EXCEPTIONS_OFF QMAKE_CXXFLAGS_SPLIT_SECTIONS += $$QMAKE_CFLAGS_SPLIT_SECTIONS +QMAKE_CXXFLAGS_LTCG = $$QMAKE_CFLAGS_LTCG QMAKE_LFLAGS += QMAKE_LFLAGS_DEBUG += QMAKE_LFLAGS_APP += QMAKE_LFLAGS_RELEASE += QMAKE_LFLAGS_EXCEPTIONS_OFF += +QMAKE_LFLAGS_LTCG = $$QMAKE_CFLAGS_LTCG -fuse-linker-plugin QMAKE_CFLAGS_SSE2 += -msse2 QMAKE_CFLAGS_SSE3 += -msse3 |