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

Khem Raj raj.khem at gmail.com
Wed Feb 27 19:44:09 UTC 2019


On Tue, Feb 26, 2019 at 11:19 PM Adrian Bunk <bunk at stusta.de> wrote:
>
> 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.

I did not do this intentionally, since we do not control gcc on build
host, but rethinking it a bit I think it might be doable, if all hosts
we support use gcc 4.8 or newer
for gcc, which I see is the case of  centos7 uses gcc 4.8, so thats
the oldest supported distro we list.

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

yes, thats taken care of locally for next rev

>
> 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