All of lore.kernel.org
 help / color / mirror / Atom feed
From: "hongxu" <hongxu.jia@eng.windriver.com>
To: openembedded-core@lists.openembedded.org
Subject: Re: [PATCH v2 2/8] distro/include: Add debug_build.inc when DEBUG_BUILD is enabled
Date: Mon, 15 Sep 2025 20:51:05 -0700	[thread overview]
Message-ID: <20091.1757994665184735903@lists.openembedded.org> (raw)
In-Reply-To: <DB5PR02MB102139D0B56D4D14DDAC711ECEF14A@DB5PR02MB10213.eurprd02.prod.outlook.com>

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

On Mon, Sep 15, 2025 at 05:25 PM, Peter Kjellerstedt wrote:

> 
> 
>> -----Original Message-----
>> From: openembedded-core@... <openembedded-core@...> On Behalf Of hongxu
>> via
>> lists.openembedded.org
>> Sent: den 15 september 2025 08:17
>> To: openembedded-core@...
>> Cc: randy.macleod@...; Peter Kjellerstedt <peter.kjellerstedt@...>
>> Subject: [OE-core] [PATCH v2 2/8] distro/include: Add debug_build.inc when
>> DEBUG_BUILD is enabled
>> 
>> Add a new include file debug_build.inc to override SELECTED_OPTIMIZATION
>> and BUILD_OPTIMIZATION when DEBUG_BUILD is enabled
>> 
>> Add separate variables FULL_OPTLEVEL, DEBUG_OPTLEVEL and BUILD_OPTLEVEL
>> for the optimization level, and override it for specific recipe other
>> than original remove and append DEBUG_OPTIMIZATION and BUILD_OPTIMIZATION
>> 
>> Update the documentation for FULL_OPTIMIZATION and DEBUG_OPTIMIZATION
>> 
>> Require the include file when DEBUG_BUILD is enabled
>> 
>> Suggested-by: Peter Kjellerstedt <peter.kjellerstedt@...>
>> Signed-off-by: Hongxu Jia <hongxu.jia@...>
>> ---
>> meta/conf/bitbake.conf | 15 +++++++++------
>> meta/conf/distro/include/debug_build.inc | 8 ++++++++
>> meta/conf/documentation.conf | 8 +++++---
>> 3 files changed, 22 insertions(+), 9 deletions(-)
>> create mode 100644 meta/conf/distro/include/debug_build.inc
>> 
>> diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
>> index 8e90c7bbc85..91dc51cd61d 100644
>> --- a/meta/conf/bitbake.conf
>> +++ b/meta/conf/bitbake.conf
>> @@ -658,13 +658,14 @@ DEBUG_PREFIX_MAP ?= "\
>> "
>> DEBUG_LEVELFLAG ?= "-g"
>> 
>> -FULL_OPTIMIZATION = "-O2 ${DEBUG_LEVELFLAG}"
>> -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"
>> +FULL_OPTLEVEL ?= "-O2"
>> +FULL_OPTIMIZATION = "${FULL_OPTLEVEL} ${DEBUG_LEVELFLAG}"
>> +SELECTED_OPTIMIZATION = "${FULL_OPTIMIZATION}"
>> +SELECTED_OPTIMIZATION[vardeps] += "FULL_OPTIMIZATION DEBUG_LEVELFLAG
>> FULL_OPTLEVEL"
> 
> The vardeps is no longer needed.

Copy

> 
> 
>> # compiler flags for native/nativesdk
>> -BUILD_OPTIMIZATION = "${@oe.utils.vartrue('DEBUG_BUILD', '-Og -g', '-O2',
>> d)}"
>> -BUILD_OPTIMIZATION[vardeps] += "DEBUG_BUILD"
>> +BUILD_OPTLEVEL ?= "-O2"
>> +BUILD_OPTIMIZATION = "${BUILD_OPTLEVEL}"
>> +BUILD_OPTIMIZATION[vardeps] += "BUILD_OPTLEVEL"
> 
> The vardeps is no longer needed.

Copy

> 
> 
>> ##################################################################
>> # Reproducibility
>> @@ -831,6 +832,8 @@ include conf/licenses.conf
>> require conf/sanity.conf
>> include conf/bblock.conf
>> 
>> +require ${@oe.utils.vartrue('DEBUG_BUILD',
>> 'conf/distro/include/debug_build.inc', '', d)}
>> +
>> ##################################################################
>> # Weak variables (usually to retain backwards compatibility)
>> ##################################################################
>> diff --git a/meta/conf/distro/include/debug_build.inc
>> b/meta/conf/distro/include/debug_build.inc
>> new file mode 100644
>> index 00000000000..af947a80e8b
>> --- /dev/null
>> +++ b/meta/conf/distro/include/debug_build.inc
>> @@ -0,0 +1,8 @@
>> +# Override SELECTED_OPTIMIZATION and BUILD_OPTIMIZATION when DEBUG_BUILD
>> is enabled.
>> +DEBUG_OPTLEVEL ?= "-Og"
>> +DEBUG_OPTIMIZATION = "${DEBUG_OPTLEVEL} ${DEBUG_LEVELFLAG}"
>> +SELECTED_OPTIMIZATION = "${DEBUG_OPTIMIZATION}"
>> +SELECTED_OPTIMIZATION[vardeps] += "DEBUG_OPTIMIZATION DEBUG_OPTLEVEL"
> 
> The vardeps is no longer needed.

Copy

> 
> 
>> +# compiler flags for native/nativesdk
>> +BUILD_OPTLEVEL = "-Og"
>> +BUILD_OPTIMIZATION = "${BUILD_OPTLEVEL} -g"
>> diff --git a/meta/conf/documentation.conf b/meta/conf/documentation.conf
>> index 741130a3921..824c4fb3801 100644
>> --- a/meta/conf/documentation.conf
>> +++ b/meta/conf/documentation.conf
>> @@ -129,8 +129,9 @@ CVE_CHECK_LAYER_INCLUDELIST[doc] = "Defines which
>> layers to include during cve-c
>> D[doc] = "The destination directory."
>> DATE[doc] = "The date the build was started using YMD format."
>> DATETIME[doc] = "The date and time the build was started."
>> -DEBUG_BUILD[doc] = "Specifies to build packages with debugging
>> information. This influences the value of the SELECTED_OPTIMIZATION
>> variable."
>> -DEBUG_OPTIMIZATION[doc] = "The options to pass in TARGET_CFLAGS and
>> CFLAGS when compiling a system for debugging. This variable defaults to
>> '-Og ${DEBUG_LEVELFLAG}'."
>> +DEBUG_BUILD[doc] = "Specifies to build packages with debugging
>> information. This influences the value of the SELECTED_OPTIMIZATION
>> variable and add include file conf/distro/include/debug_build.inc"
> 
> Change "add include file" to "includes".

Copy

V3 incoming

//Hongxu

> 
> 
> 
>> +DEBUG_OPTLEVEL[doc] = "The toolchain optimization level flags for
>> debugging. This variable defaults to '-Og'"
>> +DEBUG_OPTIMIZATION[doc] = "The options to pass in TARGET_CFLAGS and
>> CFLAGS when compiling a system for debugging. This variable defaults to
>> '${DEBUG_OPTLEVEL} ${DEBUG_LEVELFLAG}'."
>> DEFAULT_PREFERENCE[doc] = "Specifies a weak bias for recipe selection
>> priority."
>> DEPENDS[doc] = "Lists a recipe's build-time dependencies (i.e. other
>> recipe files)."
>> DEPLOY_DIR[doc] = "Points to the general area that the OpenEmbedded build
>> system uses to place images, packages, SDKs and other output files that
>> are ready to be used outside of the build system."
>> @@ -178,7 +179,8 @@ FILESPATH[doc] = "The default set of directories the
>> OpenEmbedded build system u
>> FILESYSTEM_PERMS_TABLES[doc] = "Allows you to define your own file
>> permissions settings table as part of your configuration for the packaging
>> process."
>> FONT_EXTRA_RDEPENDS[doc] = "When a recipe inherits the fontcache class,
>> this variable specifies runtime dependencies for font packages. This
>> variable defaults to 'fontconfig-utils'."
>> FONT_PACKAGES[doc] = "When a recipe inherits the fontcache class, this
>> variable identifies packages containing font files that need to be cached
>> by Fontconfig."
>> -FULL_OPTIMIZATION[doc] = "The options to pass in TARGET_CFLAGS and CFLAGS
>> when compiling an optimized system. This variable defaults to '-O2
>> ${DEBUG_LEVELFLAG}'."
>> +FULL_OPTLEVEL[doc] = "The toolchain optimization level flags. This
>> variable defaults to '-O2'"
>> +FULL_OPTIMIZATION[doc] = "The options to pass in TARGET_CFLAGS and CFLAGS
>> when compiling an optimized system. This variable defaults to
>> '${FULL_OPTLEVEL} ${DEBUG_LEVELFLAG}'."
>> 
>> #G
>> 
>> --
>> 2.34.1
> 
>

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

  reply	other threads:[~2025-09-16  3:51 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-15  6:17 [PATCH 1/8] yocto-space-optimize.inc: move space optimize from recipe webkitgtk Hongxu Jia
2025-09-15  6:17 ` [PATCH v2 2/8] distro/include: Add debug_build.inc when DEBUG_BUILD is enabled Hongxu Jia
2025-09-16  0:25   ` [OE-core] " Peter Kjellerstedt
2025-09-16  3:51     ` hongxu [this message]
2025-09-15  6:17 ` [PATCH v2 3/8] harfbuzz: set FULL_OPTLEVEL for FULL_OPTIMIZATION Hongxu Jia
2025-09-15  6:17 ` [PATCH v2 4/8] debug_build.inc: collect debug build tuning configuration Hongxu Jia
2025-09-15  6:17 ` [PATCH v2 5/8] debug_build.inc: allow other layers to add their own debug build configurations Hongxu Jia
2025-09-16  0:25   ` [OE-core] " Peter Kjellerstedt
2025-09-16  3:59     ` hongxu
2025-09-15  6:17 ` [PATCH 6/8] debug_build.inc: override INHIBIT_SYSROOT_STRIP for cross and native Hongxu Jia
2025-09-15  6:17 ` [PATCH 7/8] debug_build.inc: override MESON_BUILDTYPE for meson.bbclass Hongxu Jia
2025-09-15  6:17 ` [PATCH 8/8] debug_build.inc: override BUILD_MODE and BUILD_DIR " Hongxu Jia
2025-09-16  0:25   ` [OE-core] " Peter Kjellerstedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20091.1757994665184735903@lists.openembedded.org \
    --to=hongxu.jia@eng.windriver.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.