[OE-core] [PATCH] bitbake.conf: Use -Og in DEBUG_OPTIMIZATION

Adrian Bunk bunk at stusta.de
Wed Feb 27 07:19:54 UTC 2019


On Tue, Feb 26, 2019 at 11:04:20PM -0800, Khem Raj wrote:
> -Og is for optimized debugging experience.
> this makes this consistent across different compilers especially gcc and
> clang, -O in clang is equal to -O2 where as in gcc its similar to -O1
> so it was not giving consistent debugging experience across compilers
> 
> Signed-off-by: Khem Raj <raj.khem at gmail.com>
> ---
>  meta/conf/bitbake.conf | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
> index 1c5369ec98..758e89f126 100644
> --- a/meta/conf/bitbake.conf
> +++ b/meta/conf/bitbake.conf
> @@ -610,7 +610,7 @@ DEBUG_FLAGS ?= "-g -feliminate-unused-debug-types ${DEBUG_PREFIX_MAP}"
>  
>  # Disabled until the option works properly -feliminate-dwarf2-dups
>  FULL_OPTIMIZATION = "-O2 -pipe ${DEBUG_FLAGS}"
> -DEBUG_OPTIMIZATION = "-O -fno-omit-frame-pointer ${DEBUG_FLAGS} -pipe"
> +DEBUG_OPTIMIZATION = "-Og -fno-omit-frame-pointer ${DEBUG_FLAGS} -pipe"
>  SELECTED_OPTIMIZATION = "${@d.getVar(oe.utils.vartrue('DEBUG_BUILD', 'DEBUG_OPTIMIZATION', 'FULL_OPTIMIZATION', d))}"
>  SELECTED_OPTIMIZATION[vardeps] += "FULL_OPTIMIZATION DEBUG_OPTIMIZATION DEBUG_BUILD"
>  BUILD_OPTIMIZATION = "${@oe.utils.vartrue('DEBUG_BUILD', '-O -g -feliminate-unused-debug-types -fno-omit-frame-pointer', '-O2', d)} -pipe"
>                                                            ^^

Another place that might have to be updated.

And the ref/dev-maunuals also need updating (they document -O as default).

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed



More information about the Openembedded-core mailing list