diff options
author | Mikhail Svetkin <mikhail.svetkin@qt.io> | 2018-04-10 15:03:11 +0200 |
---|---|---|
committer | Mikhail Svetkin <mikhail.svetkin@qt.io> | 2018-04-27 06:47:35 +0000 |
commit | 194a40449039a1e1dad2f370255698172bf5e7f7 (patch) | |
tree | f5d33472cea9afbc500ef5a34f3f724704dd2bfe /configure.json | |
parent | 18d26192242873625a3132d0ad6b9342226d14bb (diff) |
Make the use of -fdata-sections and --gc-sections more generic in Qt
Add qmake feature and configure option, which optimze the size of static
exectuable. Use for static build.
Enabled via configure --gc-binaries, or CONFIG += gc-binaries in 3rd party
projects.
Change-Id: I3c25b02caaef6a4afc6019afc9c67122dd11696d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Diffstat (limited to 'configure.json')
-rw-r--r-- | configure.json | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/configure.json b/configure.json index 595bb619ce..6e48f5da61 100644 --- a/configure.json +++ b/configure.json @@ -80,6 +80,7 @@ "force-debug-info": { "type": "boolean", "name": "force_debug_info" }, "force-pkg-config": { "type": "void", "name": "pkg-config" }, "framework": "boolean", + "gc-binaries": { "type": "boolean", "name": "gc_binaries" }, "gdb-index": { "type": "boolean", "name": "gdb_index" }, "gcc-sysroot": "boolean", "gcov": "boolean", @@ -397,6 +398,17 @@ ] } }, + "gc_binaries": { + "label": "support for split sections and linker garbage collection", + "type": "compile", + "test": { + "qmake": [ + "isEmpty(QMAKE_CFLAGS_SPLIT_SECTIONS): error(\"Nope\")", + "isEmpty(QMAKE_CXXFLAGS_SPLIT_SECTIONS): error(\"Nope\")", + "isEmpty(QMAKE_LFLAGS_GCSECTIONS): error(\"Nope\")" + ] + } + }, "sse2": { "label": "SSE2 instructions", "type": "x86Simd" @@ -592,6 +604,10 @@ "compiler-flags": { "output": [ "compilerFlags" ] }, + "gc_binaries": { + "condition": "!features.shared && tests.gc_binaries", + "output": [ "privateFeature" ] + }, "gcc-sysroot": { "output": [ "gccSysroot" ], "condition": "input.sysroot != ''" |