All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] meson: change buildtype when debug_info=no
@ 2021-04-28 19:55 Joelle van Dyne
  2021-04-29  5:07 ` Philippe Mathieu-Daudé
  2021-04-29 11:02 ` Paolo Bonzini
  0 siblings, 2 replies; 5+ messages in thread
From: Joelle van Dyne @ 2021-04-28 19:55 UTC (permalink / raw)
  To: qemu-devel; +Cc: Joelle van Dyne

Meson defaults builds to 'debugoptimized' which adds '-g -O2'
to CFLAGS. If the user specifies '--disable-debug-info' we
should instead build with 'release' which does not emit any
debug info.

Signed-off-by: Joelle van Dyne <j@getutm.app>
---
 configure | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configure b/configure
index 4f374b4889..5c3568cbc3 100755
--- a/configure
+++ b/configure
@@ -6398,6 +6398,7 @@ NINJA=$ninja $meson setup \
         --sysconfdir "$sysconfdir" \
         --localedir "$localedir" \
         --localstatedir "$local_statedir" \
+        --buildtype $(if test "$debug_info" = yes; then echo "debugoptimized"; else echo "release"; fi) \
         -Ddocdir="$docdir" \
         -Dqemu_firmwarepath="$firmwarepath" \
         -Dqemu_suffix="$qemu_suffix" \
-- 
2.28.0



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] meson: change buildtype when debug_info=no
  2021-04-28 19:55 [PATCH] meson: change buildtype when debug_info=no Joelle van Dyne
@ 2021-04-29  5:07 ` Philippe Mathieu-Daudé
  2021-04-29  7:33   ` Joelle van Dyne
  2021-04-29 11:02 ` Paolo Bonzini
  1 sibling, 1 reply; 5+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-04-29  5:07 UTC (permalink / raw)
  To: Joelle van Dyne, qemu-devel; +Cc: Paolo Bonzini, Thomas Huth, Peter Maydell

On 4/28/21 9:55 PM, Joelle van Dyne wrote:
> Meson defaults builds to 'debugoptimized' which adds '-g -O2'
> to CFLAGS. If the user specifies '--disable-debug-info' we
> should instead build with 'release' which does not emit any
> debug info.
> 
> Signed-off-by: Joelle van Dyne <j@getutm.app>
> ---
>  configure | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/configure b/configure
> index 4f374b4889..5c3568cbc3 100755
> --- a/configure
> +++ b/configure
> @@ -6398,6 +6398,7 @@ NINJA=$ninja $meson setup \
>          --sysconfdir "$sysconfdir" \
>          --localedir "$localedir" \
>          --localstatedir "$local_statedir" \
> +        --buildtype $(if test "$debug_info" = yes; then echo "debugoptimized"; else echo "release"; fi) \

NAck. You are changing the default (which is 'debug') to 'release'.

This should be at least mentioned in the commit description, but
I don't think this is what we want here. 'release' enables -O3,
which is certainly not supported. The 'debug' profile is what we
have been and are testing.

I'd be OK if you had used "debugoptimized else debug".

The mainstream project would rather use 'debug'/'debugoptimized', or
'minsize', which are already tested. We might consider allowing forks
to use 'plain' profile eventually. But the 'release' type is an
unsupported landmine IMHO.

If you want to use something else, it should be an explicit argument
to ./configure, then you are on your own IMO.

Regards,

Phil.



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] meson: change buildtype when debug_info=no
  2021-04-29  5:07 ` Philippe Mathieu-Daudé
@ 2021-04-29  7:33   ` Joelle van Dyne
  2021-04-29  9:55     ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 5+ messages in thread
From: Joelle van Dyne @ 2021-04-29  7:33 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Peter Maydell, Thomas Huth, QEMU Developers, Joelle van Dyne,
	Paolo Bonzini

On Wed, Apr 28, 2021 at 10:07 PM Philippe Mathieu-Daudé
<philmd@redhat.com> wrote:
>
> On 4/28/21 9:55 PM, Joelle van Dyne wrote:
> > Meson defaults builds to 'debugoptimized' which adds '-g -O2'
> > to CFLAGS. If the user specifies '--disable-debug-info' we
> > should instead build with 'release' which does not emit any
> > debug info.
> >
> > Signed-off-by: Joelle van Dyne <j@getutm.app>
> > ---
> >  configure | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/configure b/configure
> > index 4f374b4889..5c3568cbc3 100755
> > --- a/configure
> > +++ b/configure
> > @@ -6398,6 +6398,7 @@ NINJA=$ninja $meson setup \
> >          --sysconfdir "$sysconfdir" \
> >          --localedir "$localedir" \
> >          --localstatedir "$local_statedir" \
> > +        --buildtype $(if test "$debug_info" = yes; then echo "debugoptimized"; else echo "release"; fi) \
>
> NAck. You are changing the default (which is 'debug') to 'release'.

I thought 'debugoptimized' was the default? From my build logs,
there's always '-g -O2' which is why I needed to make this change. The
default for 'debug_info' is yes so this keeps it on 'debugoptimized'
and uses 'release' when explicitly disabling debug_info.

>
> This should be at least mentioned in the commit description, but
> I don't think this is what we want here. 'release' enables -O3,
> which is certainly not supported. The 'debug' profile is what we
> have been and are testing.
>
> I'd be OK if you had used "debugoptimized else debug".
>
> The mainstream project would rather use 'debug'/'debugoptimized', or
> 'minsize', which are already tested. We might consider allowing forks
> to use 'plain' profile eventually. But the 'release' type is an
> unsupported landmine IMHO.
>
> If you want to use something else, it should be an explicit argument
> to ./configure, then you are on your own IMO.

What do I need to avoid '-g'?

-j

>
> Regards,
>
> Phil.
>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] meson: change buildtype when debug_info=no
  2021-04-29  7:33   ` Joelle van Dyne
@ 2021-04-29  9:55     ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 5+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-04-29  9:55 UTC (permalink / raw)
  To: Joelle van Dyne
  Cc: Paolo Bonzini, Thomas Huth, QEMU Developers, Peter Maydell

On 4/29/21 9:33 AM, Joelle van Dyne wrote:
> On Wed, Apr 28, 2021 at 10:07 PM Philippe Mathieu-Daudé
> <philmd@redhat.com> wrote:
>>
>> On 4/28/21 9:55 PM, Joelle van Dyne wrote:
>>> Meson defaults builds to 'debugoptimized' which adds '-g -O2'
>>> to CFLAGS. If the user specifies '--disable-debug-info' we
>>> should instead build with 'release' which does not emit any
>>> debug info.
>>>
>>> Signed-off-by: Joelle van Dyne <j@getutm.app>
>>> ---
>>>  configure | 1 +
>>>  1 file changed, 1 insertion(+)
>>>
>>> diff --git a/configure b/configure
>>> index 4f374b4889..5c3568cbc3 100755
>>> --- a/configure
>>> +++ b/configure
>>> @@ -6398,6 +6398,7 @@ NINJA=$ninja $meson setup \
>>>          --sysconfdir "$sysconfdir" \
>>>          --localedir "$localedir" \
>>>          --localstatedir "$local_statedir" \
>>> +        --buildtype $(if test "$debug_info" = yes; then echo "debugoptimized"; else echo "release"; fi) \
>>
>> NAck. You are changing the default (which is 'debug') to 'release'.
> 
> I thought 'debugoptimized' was the default? From my build logs,
> there's always '-g -O2' which is why I needed to make this change. The
> default for 'debug_info' is yes so this keeps it on 'debugoptimized'
> and uses 'release' when explicitly disabling debug_info.

Again, I'm not concerned between 'debugoptimized' VS 'debug',
I'm worried to use 'release', because of the b_ndebug=if-release
option which disable assertions (unsupported QEMU build mode).

Also, 'release' sets optimization=3 which isn't supported neither.

Per https://mesonbuild.com/Builtin-options.html#build-type-options

  All other combinations of debug and optimization set buildtype
  to 'custom'.

So maybe this is what you want, with debug=false and optimization=2?

> 
>>
>> This should be at least mentioned in the commit description, but
>> I don't think this is what we want here. 'release' enables -O3,
>> which is certainly not supported. The 'debug' profile is what we
>> have been and are testing.
>>
>> I'd be OK if you had used "debugoptimized else debug".
>>
>> The mainstream project would rather use 'debug'/'debugoptimized', or
>> 'minsize', which are already tested. We might consider allowing forks
>> to use 'plain' profile eventually. But the 'release' type is an
>> unsupported landmine IMHO.
>>
>> If you want to use something else, it should be an explicit argument
>> to ./configure, then you are on your own IMO.
> 
> What do I need to avoid '-g'?

Why don't you simply use ./configure --extra-cflags='-g0 -O2'?

Regards,

Phil.



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] meson: change buildtype when debug_info=no
  2021-04-28 19:55 [PATCH] meson: change buildtype when debug_info=no Joelle van Dyne
  2021-04-29  5:07 ` Philippe Mathieu-Daudé
@ 2021-04-29 11:02 ` Paolo Bonzini
  1 sibling, 0 replies; 5+ messages in thread
From: Paolo Bonzini @ 2021-04-29 11:02 UTC (permalink / raw)
  To: Joelle van Dyne, qemu-devel

On 28/04/21 21:55, Joelle van Dyne wrote:
> Meson defaults builds to 'debugoptimized' which adds '-g -O2'
> to CFLAGS. If the user specifies '--disable-debug-info' we
> should instead build with 'release' which does not emit any
> debug info.
> 
> Signed-off-by: Joelle van Dyne <j@getutm.app>

This is not needed.  buildtype is a shortcut for the optimization and
debug options, we need not bother with it because configure sets the
individual options already:

         -Doptimization=$(if test "$debug" = yes; then echo 0; else echo 2; fi) \
         -Ddebug=$(if test "$debug_info" = yes; then echo true; else echo false; fi) \

Paolo

> ---
>   configure | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/configure b/configure
> index 4f374b4889..5c3568cbc3 100755
> --- a/configure
> +++ b/configure
> @@ -6398,6 +6398,7 @@ NINJA=$ninja $meson setup \
>           --sysconfdir "$sysconfdir" \
>           --localedir "$localedir" \
>           --localstatedir "$local_statedir" \
> +        --buildtype $(if test "$debug_info" = yes; then echo "debugoptimized"; else echo "release"; fi) \
>           -Ddocdir="$docdir" \
>           -Dqemu_firmwarepath="$firmwarepath" \
>           -Dqemu_suffix="$qemu_suffix" \
> 



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-04-29 11:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-28 19:55 [PATCH] meson: change buildtype when debug_info=no Joelle van Dyne
2021-04-29  5:07 ` Philippe Mathieu-Daudé
2021-04-29  7:33   ` Joelle van Dyne
2021-04-29  9:55     ` Philippe Mathieu-Daudé
2021-04-29 11:02 ` Paolo Bonzini

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.