diff mbox series

bitbake.conf: Use -Og in DEBUG_OPTIMIZATION

Message ID 20190227070420.36624-1-raj.khem@gmail.com
State New
Headers show
Series bitbake.conf: Use -Og in DEBUG_OPTIMIZATION | expand

Commit Message

Khem Raj Feb. 27, 2019, 7:04 a.m. UTC
-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@gmail.com>

---
 meta/conf/bitbake.conf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.21.0

-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core

Comments

Adrian Bunk Feb. 27, 2019, 7:19 a.m. UTC | #1
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@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

-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core
Khem Raj Feb. 27, 2019, 7:44 p.m. UTC | #2
On Tue, Feb 26, 2019 at 11:19 PM Adrian Bunk <bunk@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@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

>

-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core
diff mbox series

Patch

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"