All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: Daniele Buono <dbuono@linux.vnet.ibm.com>, qemu-devel@nongnu.org
Cc: Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [PATCH v4 1/5] configure,meson: add option to enable LTO
Date: Thu, 15 Jul 2021 17:46:57 +0200	[thread overview]
Message-ID: <1b20b214-81f4-16a5-1e99-d12f6868f3ba@redhat.com> (raw)
In-Reply-To: <4c4542ca-a5cd-5229-6902-f3ea35c6e59f@redhat.com>

On 11/07/2021 12.22, Thomas Huth wrote:
> On 05/12/2020 00.06, Daniele Buono wrote:
>> 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 18c26e0389..fee118518b 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"
>> @@ -1167,6 +1168,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"
>> @@ -1751,6 +1756,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.
>> @@ -7014,6 +7020,7 @@ NINJA=$ninja $meson setup \
>>           -Diconv=$iconv -Dcurses=$curses -Dlibudev=$libudev\
>>           -Ddocs=$docs -Dsphinx_build=$sphinx_build -Dinstall_blobs=$blobs \
>>           -Dvhost_user_blk_server=$vhost_user_blk_server \
>> +        -Db_lto=$lto \
>>           $cross_arg \
>>           "$PWD" "$source_path"
>> diff --git a/meson.build b/meson.build
>> index e3386196ba..ebd1c690e0 100644
>> --- a/meson.build
>> +++ b/meson.build
>> @@ -2044,6 +2044,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')}
>>
> 
> I just came across this --enable-lto option ... but looking at the 
> implementation here, it seems only to emit a line in the summary_info, 
> without adding any compiler flags? Was this patch incomplete? Or do I miss 
> something?

Never mind, I now learnt that b_lto is apparently an option that is directly 
understood by meson already :-)

  Thomas



  reply	other threads:[~2021-07-15 15:48 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-04 23:06 [PATCH v4 0/5] Add support for Control-Flow Integrity Daniele Buono
2020-12-04 23:06 ` [PATCH v4 1/5] configure,meson: add option to enable LTO Daniele Buono
2021-07-11 10:22   ` Thomas Huth
2021-07-15 15:46     ` Thomas Huth [this message]
2020-12-04 23:06 ` [PATCH v4 2/5] cfi: Initial support for cfi-icall in QEMU Daniele Buono
2020-12-04 23:06 ` [PATCH v4 3/5] check-block: enable iotests with cfi-icall Daniele Buono
2020-12-04 23:06 ` [PATCH v4 4/5] configure,meson: support Control-Flow Integrity Daniele Buono
2020-12-13  2:55   ` Alexander Bulekov
2020-12-14 11:22     ` Paolo Bonzini
2020-12-14 11:22   ` Paolo Bonzini
2020-12-04 23:06 ` [PATCH v4 5/5] docs: Add CFI Documentation Daniele Buono
2020-12-13  3:04   ` Alexander Bulekov
2020-12-14 11:33   ` Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1b20b214-81f4-16a5-1e99-d12f6868f3ba@redhat.com \
    --to=thuth@redhat.com \
    --cc=dbuono@linux.vnet.ibm.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.