public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
* [PATCH] conf/bitbake.conf: Remove debug flags for native and nativesdk builds
@ 2025-10-23 11:34 Deepesh.Varatharajan
  2025-10-23 11:53 ` Deepesh Varatharajan
  2025-10-23 12:00 ` [OE-core] " Peter Kjellerstedt
  0 siblings, 2 replies; 4+ messages in thread
From: Deepesh.Varatharajan @ 2025-10-23 11:34 UTC (permalink / raw)
  To: openembedded-core; +Cc: Sundeep.Kokkonda, Deepesh.Varatharajan

From: Deepesh Varatharajan <Deepesh.Varatharajan@windriver.com>

The native and nativesdk builds were previously using the '-Og -g' flags
during debug builds. This resulted in increased disk usage and few linker
memory issues due to the large debug information generated.

Since native and nativesdk components do not require debug symbols,
update the build flags to use '-O2' instead of '-Og -g' for these builds.
This reduces build size and avoids memory-related issues during linking.

Signed-off-by: Deepesh Varatharajan <Deepesh.Varatharajan@windriver.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 5406e542db..d8f9f6c312 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -663,7 +663,7 @@ DEBUG_OPTIMIZATION = "-Og ${DEBUG_LEVELFLAG}"
 SELECTED_OPTIMIZATION = "${@d.getVar(oe.utils.vartrue('DEBUG_BUILD', 'DEBUG_OPTIMIZATION', 'FULL_OPTIMIZATION', d))}"
 SELECTED_OPTIMIZATION[vardeps] += "FULL_OPTIMIZATION DEBUG_OPTIMIZATION DEBUG_BUILD"
 # compiler flags for native/nativesdk
-BUILD_OPTIMIZATION = "${@oe.utils.vartrue('DEBUG_BUILD', '-Og -g', '-O2', d)}"
+BUILD_OPTIMIZATION = '-O2'
 BUILD_OPTIMIZATION[vardeps] += "DEBUG_BUILD"
 
 ##################################################################
-- 
2.49.0



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] conf/bitbake.conf: Remove debug flags for native and nativesdk builds
  2025-10-23 11:34 [PATCH] conf/bitbake.conf: Remove debug flags for native and nativesdk builds Deepesh.Varatharajan
@ 2025-10-23 11:53 ` Deepesh Varatharajan
  2025-10-23 12:00 ` [OE-core] " Peter Kjellerstedt
  1 sibling, 0 replies; 4+ messages in thread
From: Deepesh Varatharajan @ 2025-10-23 11:53 UTC (permalink / raw)
  To: openembedded-core; +Cc: Sundeep.Kokkonda

Hi All,

Testing results :

qemux86-64

time taken for bitbake clang & bitbake gcc for debug builds

with (-g -Og)                        with(-O2)            Diff
  real    46m43.329s             real    41m28.778s             -5m 14.551s
  user    0m22.136s              user    0m22.134s -0.002s
  sys     0m3.048s                  sys     0m3.020s  -0.028s

tmp Dir
size 86 GB                            size 38 GB           -48 GB


qemuarm64

time taken for bitbake clang & bitbake gcc  for debug builds

  with (-g -Og)                       with(-O2)          Diff
  real    48m26.788s            real    41m46.814s            -6m 39.974s
  user    0m30.930s             user    0m21.854s  -9.076s
  sys     0m4.068s                 sys     0m3.085s -0.983s

tmp Dir
size 92 GB                            size 41 GB        -51 GB

Regards,
Deepesh

On 23-10-2025 17:04, Deepesh.Varatharajan@windriver.com wrote:
> From: Deepesh Varatharajan <Deepesh.Varatharajan@windriver.com>
>
> The native and nativesdk builds were previously using the '-Og -g' flags
> during debug builds. This resulted in increased disk usage and few linker
> memory issues due to the large debug information generated.
>
> Since native and nativesdk components do not require debug symbols,
> update the build flags to use '-O2' instead of '-Og -g' for these builds.
> This reduces build size and avoids memory-related issues during linking.
>
> Signed-off-by: Deepesh Varatharajan <Deepesh.Varatharajan@windriver.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 5406e542db..d8f9f6c312 100644
> --- a/meta/conf/bitbake.conf
> +++ b/meta/conf/bitbake.conf
> @@ -663,7 +663,7 @@ DEBUG_OPTIMIZATION = "-Og ${DEBUG_LEVELFLAG}"
>   SELECTED_OPTIMIZATION = "${@d.getVar(oe.utils.vartrue('DEBUG_BUILD', 'DEBUG_OPTIMIZATION', 'FULL_OPTIMIZATION', d))}"
>   SELECTED_OPTIMIZATION[vardeps] += "FULL_OPTIMIZATION DEBUG_OPTIMIZATION DEBUG_BUILD"
>   # compiler flags for native/nativesdk
> -BUILD_OPTIMIZATION = "${@oe.utils.vartrue('DEBUG_BUILD', '-Og -g', '-O2', d)}"
> +BUILD_OPTIMIZATION = '-O2'
>   BUILD_OPTIMIZATION[vardeps] += "DEBUG_BUILD"
>   
>   ##################################################################

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [OE-core] [PATCH] conf/bitbake.conf: Remove debug flags for native and nativesdk builds
  2025-10-23 11:34 [PATCH] conf/bitbake.conf: Remove debug flags for native and nativesdk builds Deepesh.Varatharajan
  2025-10-23 11:53 ` Deepesh Varatharajan
@ 2025-10-23 12:00 ` Peter Kjellerstedt
  2025-10-23 12:41   ` Alexander Kanavin
  1 sibling, 1 reply; 4+ messages in thread
From: Peter Kjellerstedt @ 2025-10-23 12:00 UTC (permalink / raw)
  To: deepesh.varatharajan@windriver.com,
	openembedded-core@lists.openembedded.org
  Cc: Sundeep.Kokkonda@windriver.com

> -----Original Message-----
> From: openembedded-core@lists.openembedded.org <openembedded-core@lists.openembedded.org> On Behalf Of Varatharajan, Deepesh via lists.openembedded.org
> Sent: den 23 oktober 2025 13:35
> To: openembedded-core@lists.openembedded.org
> Cc: Sundeep.Kokkonda@windriver.com; Deepesh.Varatharajan@windriver.com
> Subject: [OE-core] [PATCH] conf/bitbake.conf: Remove debug flags for native and nativesdk builds
> 
> From: Deepesh Varatharajan <Deepesh.Varatharajan@windriver.com>
> 
> The native and nativesdk builds were previously using the '-Og -g' flags
> during debug builds. This resulted in increased disk usage and few linker
> memory issues due to the large debug information generated.
> 
> Since native and nativesdk components do not require debug symbols,
> update the build flags to use '-O2' instead of '-Og -g' for these builds.
> This reduces build size and avoids memory-related issues during linking.
> 
> Signed-off-by: Deepesh Varatharajan <Deepesh.Varatharajan@windriver.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 5406e542db..d8f9f6c312 100644
> --- a/meta/conf/bitbake.conf
> +++ b/meta/conf/bitbake.conf
> @@ -663,7 +663,7 @@ DEBUG_OPTIMIZATION = "-Og ${DEBUG_LEVELFLAG}"
>  SELECTED_OPTIMIZATION = "${@d.getVar(oe.utils.vartrue('DEBUG_BUILD', 'DEBUG_OPTIMIZATION', 'FULL_OPTIMIZATION', d))}"
>  SELECTED_OPTIMIZATION[vardeps] += "FULL_OPTIMIZATION DEBUG_OPTIMIZATION DEBUG_BUILD"
>  # compiler flags for native/nativesdk
> -BUILD_OPTIMIZATION = "${@oe.utils.vartrue('DEBUG_BUILD', '-Og -g', '-O2', d)}"
> +BUILD_OPTIMIZATION = '-O2'
>  BUILD_OPTIMIZATION[vardeps] += "DEBUG_BUILD"
> 
>  ##################################################################
> --
> 2.49.0

I am sorry, but I must be missing something. If I enable DEBUG_BUILD for 
a native recipe, I definitely expect it to be compiled with -Og so I can 
debug it in gdb.

If what you really want to do is enable debug for all target recipes, 
then use DEBUG_BUILD:class-target = "1" in your local.conf instead.

//Peter



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [OE-core] [PATCH] conf/bitbake.conf: Remove debug flags for native and nativesdk builds
  2025-10-23 12:00 ` [OE-core] " Peter Kjellerstedt
@ 2025-10-23 12:41   ` Alexander Kanavin
  0 siblings, 0 replies; 4+ messages in thread
From: Alexander Kanavin @ 2025-10-23 12:41 UTC (permalink / raw)
  To: peter.kjellerstedt
  Cc: deepesh.varatharajan@windriver.com,
	openembedded-core@lists.openembedded.org,
	Sundeep.Kokkonda@windriver.com

[-- Attachment #1: Type: text/plain, Size: 3071 bytes --]

Yes, absolutely. You’d be surprised how often something native crashes or
exhibits unusual behaviour and then debugging it in gdb is absolutely
essential.

Alex

On Thu 23. Oct 2025 at 14.00, Peter Kjellerstedt via lists.openembedded.org
<peter.kjellerstedt=axis.com@lists.openembedded.org> wrote:

> > -----Original Message-----
> > From: openembedded-core@lists.openembedded.org <
> openembedded-core@lists.openembedded.org> On Behalf Of Varatharajan,
> Deepesh via lists.openembedded.org
> > Sent: den 23 oktober 2025 13:35
> > To: openembedded-core@lists.openembedded.org
> > Cc: Sundeep.Kokkonda@windriver.com; Deepesh.Varatharajan@windriver.com
> > Subject: [OE-core] [PATCH] conf/bitbake.conf: Remove debug flags for
> native and nativesdk builds
> >
> > From: Deepesh Varatharajan <Deepesh.Varatharajan@windriver.com>
> >
> > The native and nativesdk builds were previously using the '-Og -g' flags
> > during debug builds. This resulted in increased disk usage and few linker
> > memory issues due to the large debug information generated.
> >
> > Since native and nativesdk components do not require debug symbols,
> > update the build flags to use '-O2' instead of '-Og -g' for these builds.
> > This reduces build size and avoids memory-related issues during linking.
> >
> > Signed-off-by: Deepesh Varatharajan <Deepesh.Varatharajan@windriver.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 5406e542db..d8f9f6c312 100644
> > --- a/meta/conf/bitbake.conf
> > +++ b/meta/conf/bitbake.conf
> > @@ -663,7 +663,7 @@ DEBUG_OPTIMIZATION = "-Og ${DEBUG_LEVELFLAG}"
> >  SELECTED_OPTIMIZATION = "${@d.getVar(oe.utils.vartrue('DEBUG_BUILD',
> 'DEBUG_OPTIMIZATION', 'FULL_OPTIMIZATION', d))}"
> >  SELECTED_OPTIMIZATION[vardeps] += "FULL_OPTIMIZATION DEBUG_OPTIMIZATION
> DEBUG_BUILD"
> >  # compiler flags for native/nativesdk
> > -BUILD_OPTIMIZATION = "${@oe.utils.vartrue('DEBUG_BUILD', '-Og -g',
> '-O2', d)}"
> > +BUILD_OPTIMIZATION = '-O2'
> >  BUILD_OPTIMIZATION[vardeps] += "DEBUG_BUILD"
> >
> >  ##################################################################
> > --
> > 2.49.0
>
> I am sorry, but I must be missing something. If I enable DEBUG_BUILD for
> a native recipe, I definitely expect it to be compiled with -Og so I can
> debug it in gdb.
>
> If what you really want to do is enable debug for all target recipes,
> then use DEBUG_BUILD:class-target = "1" in your local.conf instead.
>
> //Peter
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#225247):
> https://lists.openembedded.org/g/openembedded-core/message/225247
> Mute This Topic: https://lists.openembedded.org/mt/115908796/1686489
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [
> alex.kanavin@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
>

[-- Attachment #2: Type: text/html, Size: 4950 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-10-23 12:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-23 11:34 [PATCH] conf/bitbake.conf: Remove debug flags for native and nativesdk builds Deepesh.Varatharajan
2025-10-23 11:53 ` Deepesh Varatharajan
2025-10-23 12:00 ` [OE-core] " Peter Kjellerstedt
2025-10-23 12:41   ` Alexander Kanavin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox