diff mbox series

[19/30] configure, meson: move --enable-debug-info to Meson

Message ID 20221209112409.184703-20-pbonzini@redhat.com
State New
Headers show
Series Meson changes for QEMU 8.0 | expand

Commit Message

Paolo Bonzini Dec. 9, 2022, 11:23 a.m. UTC
Older versions of Meson had an unclear description of the -Ddebug option,
but this is fixed in 0.63.0 that is required now.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 configure                     | 5 -----
 scripts/meson-buildoptions.py | 2 ++
 scripts/meson-buildoptions.sh | 3 +++
 3 files changed, 5 insertions(+), 5 deletions(-)

Comments

Philippe Mathieu-Daudé Dec. 9, 2022, 12:55 p.m. UTC | #1
On 9/12/22 12:23, Paolo Bonzini wrote:
> Older versions of Meson had an unclear description of the -Ddebug option,
> but this is fixed in 0.63.0 that is required now.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>   configure                     | 5 -----
>   scripts/meson-buildoptions.py | 2 ++
>   scripts/meson-buildoptions.sh | 3 +++
>   3 files changed, 5 insertions(+), 5 deletions(-)


> diff --git a/scripts/meson-buildoptions.sh b/scripts/meson-buildoptions.sh
> index f91797741eef..cb277347bb18 100644
> --- a/scripts/meson-buildoptions.sh
> +++ b/scripts/meson-buildoptions.sh

# This file is generated by meson-buildoptions.py, do not edit!

> @@ -10,6 +10,7 @@ meson_options_help() {
>     printf "%s\n" '                           affects only QEMU, not tools like qemu-img)'
>     printf "%s\n" '  --datadir=VALUE          Data file directory [share]'
>     printf "%s\n" '  --disable-coroutine-pool coroutine freelist (better performance)'
> +  printf "%s\n" '  --disable-debug-info     Enable debug symbols and other information'

We should get '--enable-debug-info' here, ...

>     printf "%s\n" '  --disable-install-blobs  install provided firmware blobs'

... and here. Do we have a bug in meson-buildoptions.py?

>     printf "%s\n" '  --docdir=VALUE           Base directory for documentation installation'
>     printf "%s\n" '                           (can be empty) [share/doc]'
Paolo Bonzini Dec. 9, 2022, 1:54 p.m. UTC | #2
On 12/9/22 13:55, Philippe Mathieu-Daudé wrote:
>>
>> +  printf "%s\n" '  --disable-debug-info     Enable debug symbols and 
>> other information'
> 
> We should get '--enable-debug-info' here, ...
> 
>>     printf "%s\n" '  --disable-install-blobs  install provided 
>> firmware blobs'
> 
> ... and here. Do we have a bug in meson-buildoptions.py?

No, for boolean options it only includes the non-default setting.  This 
behavior was copied from the prior handcrafted help output:

   --with-devices-ARCH=NAME override default configs/devices
   --enable-debug           enable common debug build options
   --enable-sanitizers      enable default sanitizers
   --enable-tsan            enable thread sanitizer
   --disable-strip          disable stripping binaries
   --disable-werror         disable compilation abort on warning
   --disable-stack-protector disable compiler-provided stack protection
   --audio-drv-list=LIST    set audio drivers list

etc.

Paolo
Philippe Mathieu-Daudé Dec. 9, 2022, 2:21 p.m. UTC | #3
On 9/12/22 14:54, Paolo Bonzini wrote:
> On 12/9/22 13:55, Philippe Mathieu-Daudé wrote:
>>>
>>> +  printf "%s\n" '  --disable-debug-info     Enable debug symbols and 
>>> other information'
>>
>> We should get '--enable-debug-info' here, ...
>>
>>>     printf "%s\n" '  --disable-install-blobs  install provided 
>>> firmware blobs'
>>
>> ... and here. Do we have a bug in meson-buildoptions.py?
> 
> No, for boolean options it only includes the non-default setting.  This 
> behavior was copied from the prior handcrafted help output:
> 
>    --with-devices-ARCH=NAME override default configs/devices
>    --enable-debug           enable common debug build options
>    --enable-sanitizers      enable default sanitizers
>    --enable-tsan            enable thread sanitizer
>    --disable-strip          disable stripping binaries
>    --disable-werror         disable compilation abort on warning
>    --disable-stack-protector disable compiler-provided stack protection

These are correct... For debug-info I'd expect that (change on top of
your patch):

-  printf "%s\n" '  --disable-debug-info     Enable debug symbols and 
other information'
+  printf "%s\n" '  --disable-debug-info     Disable debug symbols and 
other information'
Paolo Bonzini Dec. 9, 2022, 4:21 p.m. UTC | #4
On 12/9/22 15:21, Philippe Mathieu-Daudé wrote:
> On 9/12/22 14:54, Paolo Bonzini wrote:
>> On 12/9/22 13:55, Philippe Mathieu-Daudé wrote:
>>>>
>>>> +  printf "%s\n" '  --disable-debug-info     Enable debug symbols 
>>>> and other information'
>>>
>>> We should get '--enable-debug-info' here, ...
>>>
>>>>     printf "%s\n" '  --disable-install-blobs  install provided 
>>>> firmware blobs'
>>>
>>> ... and here. Do we have a bug in meson-buildoptions.py?
>>
>> No, for boolean options it only includes the non-default setting.  
>> This behavior was copied from the prior handcrafted help output:
>>
>>    --with-devices-ARCH=NAME override default configs/devices
>>    --enable-debug           enable common debug build options
>>    --enable-sanitizers      enable default sanitizers
>>    --enable-tsan            enable thread sanitizer
>>    --disable-strip          disable stripping binaries
>>    --disable-werror         disable compilation abort on warning
>>    --disable-stack-protector disable compiler-provided stack protection
> 
> These are correct... For debug-info I'd expect that (change on top of
> your patch):
> 
> -  printf "%s\n" '  --disable-debug-info     Enable debug symbols and 
> other information'
> +  printf "%s\n" '  --disable-debug-info     Disable debug symbols and 
> other information'

Ahh, I see now.  Yeah, it is inconsistent, I'll just drop this patch.

Paolo
Daniel P. Berrangé Dec. 16, 2022, 3:09 p.m. UTC | #5
On Fri, Dec 09, 2022 at 12:23:58PM +0100, Paolo Bonzini wrote:
> Older versions of Meson had an unclear description of the -Ddebug option,
> but this is fixed in 0.63.0 that is required now.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  configure                     | 5 -----
>  scripts/meson-buildoptions.py | 2 ++
>  scripts/meson-buildoptions.sh | 3 +++
>  3 files changed, 5 insertions(+), 5 deletions(-)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
 

With regards,
Daniel
diff mbox series

Patch

diff --git a/configure b/configure
index 26d10aeffd82..b0df6c3cf754 100755
--- a/configure
+++ b/configure
@@ -700,10 +700,6 @@  for opt do
   ;;
   --cross-prefix-*)
   ;;
-  --enable-debug-info) meson_option_add -Ddebug=true
-  ;;
-  --disable-debug-info) meson_option_add -Ddebug=false
-  ;;
   --cpu=*)
   ;;
   --target-list=*) target_list="$optarg"
@@ -995,7 +991,6 @@  cat << EOF
   bsd-user        all BSD usermode emulation targets
   pie             Position Independent Executables
   debug-tcg       TCG debugging (default is disabled)
-  debug-info      debugging information
   safe-stack      SafeStack Stack Smash Protection. Depends on
                   clang/llvm >= 3.7 and requires coroutine backend ucontext.
 
diff --git a/scripts/meson-buildoptions.py b/scripts/meson-buildoptions.py
index 3e2b4785388f..8e4e5c4e8bd6 100755
--- a/scripts/meson-buildoptions.py
+++ b/scripts/meson-buildoptions.py
@@ -35,6 +35,7 @@ 
 OPTION_NAMES = {
     "b_coverage": "gcov",
     "b_lto": "lto",
+    "debug": "debug-info",
     "malloc": "enable-malloc",
     "pkgversion": "with-pkgversion",
     "qemu_firmwarepath": "firmwarepath",
@@ -45,6 +46,7 @@ 
 BUILTIN_OPTIONS = {
     "b_coverage",
     "b_lto",
+    "debug",
     "datadir",
     "includedir",
     "libdir",
diff --git a/scripts/meson-buildoptions.sh b/scripts/meson-buildoptions.sh
index f91797741eef..cb277347bb18 100644
--- a/scripts/meson-buildoptions.sh
+++ b/scripts/meson-buildoptions.sh
@@ -10,6 +10,7 @@  meson_options_help() {
   printf "%s\n" '                           affects only QEMU, not tools like qemu-img)'
   printf "%s\n" '  --datadir=VALUE          Data file directory [share]'
   printf "%s\n" '  --disable-coroutine-pool coroutine freelist (better performance)'
+  printf "%s\n" '  --disable-debug-info     Enable debug symbols and other information'
   printf "%s\n" '  --disable-install-blobs  install provided firmware blobs'
   printf "%s\n" '  --docdir=VALUE           Base directory for documentation installation'
   printf "%s\n" '                           (can be empty) [share/doc]'
@@ -242,6 +243,8 @@  _meson_option_parse() {
     --datadir=*) quote_sh "-Ddatadir=$2" ;;
     --enable-dbus-display) printf "%s" -Ddbus_display=enabled ;;
     --disable-dbus-display) printf "%s" -Ddbus_display=disabled ;;
+    --enable-debug-info) printf "%s" -Ddebug=true ;;
+    --disable-debug-info) printf "%s" -Ddebug=false ;;
     --enable-debug-mutex) printf "%s" -Ddebug_mutex=true ;;
     --disable-debug-mutex) printf "%s" -Ddebug_mutex=false ;;
     --enable-debug-stack-usage) printf "%s" -Ddebug_stack_usage=true ;;