configure,meson: add option to enable LTO
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>
This commit is contained in:
parent
3df1a3d070
commit
cdad781d09
7
configure
vendored
7
configure
vendored
@ -242,6 +242,7 @@ host_cc="cc"
|
|||||||
audio_win_int=""
|
audio_win_int=""
|
||||||
libs_qga=""
|
libs_qga=""
|
||||||
debug_info="yes"
|
debug_info="yes"
|
||||||
|
lto="false"
|
||||||
stack_protector=""
|
stack_protector=""
|
||||||
safe_stack=""
|
safe_stack=""
|
||||||
use_containers="yes"
|
use_containers="yes"
|
||||||
@ -1182,6 +1183,10 @@ for opt do
|
|||||||
;;
|
;;
|
||||||
--disable-werror) werror="no"
|
--disable-werror) werror="no"
|
||||||
;;
|
;;
|
||||||
|
--enable-lto) lto="true"
|
||||||
|
;;
|
||||||
|
--disable-lto) lto="false"
|
||||||
|
;;
|
||||||
--enable-stack-protector) stack_protector="yes"
|
--enable-stack-protector) stack_protector="yes"
|
||||||
;;
|
;;
|
||||||
--disable-stack-protector) stack_protector="no"
|
--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
|
module-upgrades try to load modules from alternate paths for upgrades
|
||||||
debug-tcg TCG debugging (default is disabled)
|
debug-tcg TCG debugging (default is disabled)
|
||||||
debug-info debugging information
|
debug-info debugging information
|
||||||
|
lto Enable Link-Time Optimization.
|
||||||
sparse sparse checker
|
sparse sparse checker
|
||||||
safe-stack SafeStack Stack Smash Protection. Depends on
|
safe-stack SafeStack Stack Smash Protection. Depends on
|
||||||
clang/llvm >= 3.7 and requires coroutine backend ucontext.
|
clang/llvm >= 3.7 and requires coroutine backend ucontext.
|
||||||
@ -6965,6 +6971,7 @@ NINJA=$ninja $meson setup \
|
|||||||
-Db_pie=$(if test "$pie" = yes; then echo true; else echo false; fi) \
|
-Db_pie=$(if test "$pie" = yes; then echo true; else echo false; fi) \
|
||||||
${staticpic:+-Db_staticpic=$staticpic} \
|
${staticpic:+-Db_staticpic=$staticpic} \
|
||||||
-Db_coverage=$(if test "$gcov" = yes; then echo true; else echo false; fi) \
|
-Db_coverage=$(if test "$gcov" = yes; then echo true; else echo false; fi) \
|
||||||
|
-Db_lto=$lto \
|
||||||
-Dmalloc=$malloc -Dmalloc_trim=$malloc_trim -Dsparse=$sparse \
|
-Dmalloc=$malloc -Dmalloc_trim=$malloc_trim -Dsparse=$sparse \
|
||||||
-Dkvm=$kvm -Dhax=$hax -Dwhpx=$whpx -Dhvf=$hvf \
|
-Dkvm=$kvm -Dhax=$hax -Dwhpx=$whpx -Dhvf=$hvf \
|
||||||
-Dxen=$xen -Dxen_pci_passthrough=$xen_pci_passthrough -Dtcg=$tcg \
|
-Dxen=$xen -Dxen_pci_passthrough=$xen_pci_passthrough -Dtcg=$tcg \
|
||||||
|
@ -2080,6 +2080,7 @@ summary_info += {'gprof enabled': config_host.has_key('CONFIG_GPROF')}
|
|||||||
summary_info += {'sparse enabled': sparse.found()}
|
summary_info += {'sparse enabled': sparse.found()}
|
||||||
summary_info += {'strip binaries': get_option('strip')}
|
summary_info += {'strip binaries': get_option('strip')}
|
||||||
summary_info += {'profiler': config_host.has_key('CONFIG_PROFILER')}
|
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')}
|
summary_info += {'static build': config_host.has_key('CONFIG_STATIC')}
|
||||||
if targetos == 'darwin'
|
if targetos == 'darwin'
|
||||||
summary_info += {'Cocoa support': config_host.has_key('CONFIG_COCOA')}
|
summary_info += {'Cocoa support': config_host.has_key('CONFIG_COCOA')}
|
||||||
|
Loading…
Reference in New Issue
Block a user