summaryrefslogtreecommitdiffstats
path: root/mkspecs/features/ltcg.prf
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2014-11-14 19:27:46 -0800
committerThiago Macieira <thiago.macieira@intel.com>2015-01-11 03:41:48 +0100
commit0f569f5900ea4cf3af551c90f79b80fc78dce9bf (patch)
tree318d8a66986ce03cde4f5cc1f533fbca6b6a8bda /mkspecs/features/ltcg.prf
parentd7795559a7b80d3ec0a1eb86d29deaca6074f4ed (diff)
Clean up ltcg.prf with variables, including a new static mode
By using the special "ar" and "ranlib" tools, the symbol table is made visible, so we don't need fat LTO binaries. Since we need to store the new tool names, we may as well clean up ltcg.prf with variable names for the fat mode too. Change-Id: I7e53af0c74a3d069313f38500b72538af1d61128 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Diffstat (limited to 'mkspecs/features/ltcg.prf')
-rw-r--r--mkspecs/features/ltcg.prf34
1 files changed, 17 insertions, 17 deletions
diff --git a/mkspecs/features/ltcg.prf b/mkspecs/features/ltcg.prf
index 1a0980101f..ccf0226272 100644
--- a/mkspecs/features/ltcg.prf
+++ b/mkspecs/features/ltcg.prf
@@ -1,32 +1,32 @@
CONFIG(release, debug|release) {
# We need fat object files when creating static libraries on some platforms
# so the linker will know to load a particular object from the library
- # in the first place. With GCC, we have -ffat-lto-objects. MSVC
- # seems to work just fine. For other compilers, we disable LTCG
+ # in the first place. On others, we have special ar and nm to create the symbol
+ # tables so the linker will know better. For other compilers, we disable LTCG
# for static libraries.
msvc {
# Nothing to do
- } else: gcc {
- !clang:!intel_icc {
- static|fat-lto {
- QMAKE_CFLAGS_LTCG += -ffat-lto-objects
- QMAKE_CXXFLAGS_LTCG += -ffat-lto-objects
- } else {
- QMAKE_CFLAGS_LTCG += -fno-fat-lto-objects
- QMAKE_CXXFLAGS_LTCG += -fno-fat-lto-objects
- }
- greaterThan(QMAKE_HOST.cpu_count, 1) {
- # Override LTO number of jobs
- QMAKE_LFLAGS_LTCG -= -flto
- QMAKE_LFLAGS_LTCG += -flto=$$QMAKE_HOST.cpu_count
- }
- } else: static {
+ } else {
+ !isEmpty(QMAKE_AR_LTCG): QMAKE_AR = $$QMAKE_AR_LTCG
+ !isEmpty(QMAKE_NM_LTCG): QMAKE_NM = $$QMAKE_NM_LTCG
+
+ equals(QMAKE_RANLIB_LTCG, true): QMAKE_RANLIB =
+ else: !isEmpty(QMAKE_RANLIB_LTCG): QMAKE_RANLIB = $$QMAKE_RANLIB_LTCG
+
+ static:isEmpty(QMAKE_AR_LTCG):isEmpty(QMAKE_RANLIB_LTCG) {
+ # We don't know how to create symbol tables for static libs with this
+ # compiler, so disable LTCG
QMAKE_CFLAGS_LTCG =
QMAKE_CXXFLAGS_LTCG =
QMAKE_LFLAGS_LTCG =
}
}
+ fat-lto {
+ QMAKE_CFLAGS_LTCG += $$QMAKE_CFLAGS_LTCG_FATOBJECTS
+ QMAKE_CXXFLAGS_LTCG += $$QMAKE_CXXFLAGS_LTCG_FATOBJECTS
+ }
+
load(link_ltcg)
QMAKE_CFLAGS *= $$QMAKE_CFLAGS_LTCG
QMAKE_CXXFLAGS *= $$QMAKE_CXXFLAGS_LTCG