meson: change buildtype when debug_info=no
PATCH 1/1 meson: change buildtype when debug_info=no
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.
--- configure | 1 + 1 file changed, 1 insertion(+)
configure +1 -0
@@ -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" \
Signature · 1 line
2.28.0
Quoted 15 lines · 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 <[email protected]>--- configure | 1 + 1 file changed, 1 insertion(+)configure +0
-0
configure NINJA=$ninja $meson setup \ · line 6401
Quoted 4 lines
configure +1
-0@@ -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.
Quoted 12 lines · Philippe Mathieu-Daudé
Quoted 10 lines · 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 <[email protected]>--- configure | 1 + 1 file changed, 1 insertion(+)
Quoted 11 lines
configure NINJA=$ninja $meson setup \ · line 6401
Quoted 9 lines
configure +1
-0@@ -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.
Quoted 8 lines
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".
Quoted 7 lines
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
Quoted 5 lines
Regards,
Phil.
Quoted 26 lines · Joelle van Dyne
Quoted 12 lines · Philippe Mathieu-Daudé
Quoted 10 lines · 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 <[email protected]>--- configure | 1 + 1 file changed, 1 insertion(+)Quoted 11 lines
configure NINJA=$ninja $meson setup \ · line 6401
Quoted 9 lines
configure +1
-0@@ -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'.
Quoted 4 lines
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 disablingdebug_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?
Quoted 14 lines
Quoted 14 lines
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.
Quoted 4 lines
Quoted 2 lines
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.
Quoted 6 lines · 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 <[email protected]>
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
Quoted 17 lines
--- configure | 1 + 1 file changed, 1 insertion(+)configure +1
-0@@ -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" \