[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 16/55] configure,meson: add option to enable LTO
From: |
Paolo Bonzini |
Subject: |
[PULL 16/55] configure,meson: add option to enable LTO |
Date: |
Mon, 21 Dec 2020 15:44:08 +0100 |
From: Daniele Buono <dbuono@linux.vnet.ibm.com>
This patch allows to compile QEMU with link-time optimization (LTO).
Compilation with LTO is handled directly by meson. This patch only
adds the option in configure and forwards the request to meson
Tested with all major versions of clang from 6 to 12
Signed-off-by: Daniele Buono <dbuono@linux.vnet.ibm.com>
Message-Id: <20201204230615.2392-2-dbuono@linux.vnet.ibm.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
configure | 7 +++++++
meson.build | 1 +
2 files changed, 8 insertions(+)
diff --git a/configure b/configure
index 7ec4a11d1f..55e77bf289 100755
--- a/configure
+++ b/configure
@@ -242,6 +242,7 @@ host_cc="cc"
audio_win_int=""
libs_qga=""
debug_info="yes"
+lto="false"
stack_protector=""
safe_stack=""
use_containers="yes"
@@ -1182,6 +1183,10 @@ for opt do
;;
--disable-werror) werror="no"
;;
+ --enable-lto) lto="true"
+ ;;
+ --disable-lto) lto="false"
+ ;;
--enable-stack-protector) stack_protector="yes"
;;
--disable-stack-protector) stack_protector="no"
@@ -1779,6 +1784,7 @@ disabled with --disable-FEATURE, default is enabled if
available
module-upgrades try to load modules from alternate paths for upgrades
debug-tcg TCG debugging (default is disabled)
debug-info debugging information
+ lto Enable Link-Time Optimization.
sparse sparse checker
safe-stack SafeStack Stack Smash Protection. Depends on
clang/llvm >= 3.7 and requires coroutine backend ucontext.
@@ -6964,6 +6970,7 @@ NINJA=$ninja $meson setup \
-Db_pie=$(if test "$pie" = yes; then echo true; else echo false; fi) \
${staticpic:+-Db_staticpic=$staticpic} \
-Db_coverage=$(if test "$gcov" = yes; then echo true; else echo false;
fi) \
+ -Db_lto=$lto \
-Dmalloc=$malloc -Dmalloc_trim=$malloc_trim -Dsparse=$sparse \
-Dkvm=$kvm -Dhax=$hax -Dwhpx=$whpx -Dhvf=$hvf \
-Dxen=$xen -Dxen_pci_passthrough=$xen_pci_passthrough -Dtcg=$tcg \
diff --git a/meson.build b/meson.build
index 372576f82c..d05d880114 100644
--- a/meson.build
+++ b/meson.build
@@ -2080,6 +2080,7 @@ summary_info += {'gprof enabled':
config_host.has_key('CONFIG_GPROF')}
summary_info += {'sparse enabled': sparse.found()}
summary_info += {'strip binaries': get_option('strip')}
summary_info += {'profiler': config_host.has_key('CONFIG_PROFILER')}
+summary_info += {'link-time optimization (LTO)': get_option('b_lto')}
summary_info += {'static build': config_host.has_key('CONFIG_STATIC')}
if targetos == 'darwin'
summary_info += {'Cocoa support': config_host.has_key('CONFIG_COCOA')}
--
2.29.2
- [PULL 06/55] gitlab: add --without-default-features build, (continued)
- [PULL 06/55] gitlab: add --without-default-features build, Paolo Bonzini, 2020/12/21
- [PULL 08/55] gitlab-CI: Test 32-bit builds with the fedora-i386-cross container, Paolo Bonzini, 2020/12/21
- [PULL 12/55] vl: initialize displays _after_ exiting preconfiguration, Paolo Bonzini, 2020/12/21
- [PULL 21/55] build-sys: fix -static linking of libvhost-user, Paolo Bonzini, 2020/12/21
- [PULL 24/55] trace: do not include TCG helper tracepoints in no-TCG builds, Paolo Bonzini, 2020/12/21
- [PULL 31/55] meson: cleanup Kconfig.host handling, Paolo Bonzini, 2020/12/21
- [PULL 38/55] curl: convert to meson, Paolo Bonzini, 2020/12/21
- [PULL 11/55] configure: document --without-default-{features, devices}, Paolo Bonzini, 2020/12/21
- [PULL 07/55] tests/tcg: build tests with -Werror, Paolo Bonzini, 2020/12/21
- [PULL 14/55] qom: Assert that objects being destroyed have no parent, Paolo Bonzini, 2020/12/21
- [PULL 16/55] configure,meson: add option to enable LTO,
Paolo Bonzini <=
- [PULL 17/55] cfi: Initial support for cfi-icall in QEMU, Paolo Bonzini, 2020/12/21
- [PULL 33/55] configure: remove variable bogus_os, Paolo Bonzini, 2020/12/21
- [PULL 40/55] bzip2: convert to meson, Paolo Bonzini, 2020/12/21
- [PULL 39/55] glusterfs: convert to meson, Paolo Bonzini, 2020/12/21
- [PULL 15/55] target/i386: Check privilege level for protected mode 'int N' task gate, Paolo Bonzini, 2020/12/21
- [PULL 18/55] check-block: enable iotests with cfi-icall, Paolo Bonzini, 2020/12/21
- [PULL 19/55] configure,meson: support Control-Flow Integrity, Paolo Bonzini, 2020/12/21
- [PULL 20/55] docs: Add CFI Documentation, Paolo Bonzini, 2020/12/21
- [PULL 29/55] meson: use pkg-config method for libudev, Paolo Bonzini, 2020/12/21
- [PULL 25/55] Makefile: add dummy target for build.ninja dependencies, Paolo Bonzini, 2020/12/21