[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 6/9] configure,meson: add option to enable LTO
From: |
Daniele Buono |
Subject: |
[PATCH v3 6/9] configure,meson: add option to enable LTO |
Date: |
Thu, 5 Nov 2020 17:19:02 -0500 |
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>
---
configure | 7 +++++++
meson.build | 1 +
2 files changed, 8 insertions(+)
diff --git a/configure b/configure
index 2c3c69f118..7115655fe4 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"
@@ -1166,6 +1167,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"
@@ -1744,6 +1749,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.
@@ -6991,6 +6997,7 @@ NINJA=$ninja $meson setup \
-Dcapstone=$capstone -Dslirp=$slirp -Dfdt=$fdt \
-Diconv=$iconv -Dcurses=$curses -Dlibudev=$libudev\
-Ddocs=$docs -Dsphinx_build=$sphinx_build -Dinstall_blobs=$blobs \
+ -Db_lto=$lto \
$cross_arg \
"$PWD" "$source_path"
diff --git a/meson.build b/meson.build
index 39ac5cf6d8..99c7ab1d38 100644
--- a/meson.build
+++ b/meson.build
@@ -2023,6 +2023,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.17.1
- [PATCH v3 0/9] Add support for Control-Flow Integrity, Daniele Buono, 2020/11/05
- [PATCH v3 1/9] fuzz: Make fork_fuzz.ld compatible with LLVM's LLD, Daniele Buono, 2020/11/05
- [PATCH v3 2/9] s390x: fix clang 11 warnings in cpu_models.c, Daniele Buono, 2020/11/05
- [PATCH v3 4/9] s390x: Avoid variable size warning in ipl.h, Daniele Buono, 2020/11/05
- [PATCH v3 6/9] configure,meson: add option to enable LTO,
Daniele Buono <=
- [PATCH v3 5/9] scsi: fix overflow in scsi_disk_new_request_dump, Daniele Buono, 2020/11/05
[PATCH v3 7/9] cfi: Initial support for cfi-icall in QEMU, Daniele Buono, 2020/11/05
[PATCH v3 8/9] check-block: enable iotests with cfi-icall, Daniele Buono, 2020/11/05
[PATCH v3 9/9] configure,meson: support Control-Flow Integrity, Daniele Buono, 2020/11/05
[PATCH v3 3/9] hw/usb: reorder fields in UASStatus, Daniele Buono, 2020/11/05