public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: "Andrej Valek" <andrej.valek@siemens.com>
To: openembedded-core@lists.openembedded.org
Cc: Andrej Valek <andrej.valek@siemens.com>,
	Pascal Bach <pascal.bach@siemens.com>,
	Adrian Freihofer <adrian.freihofer@siemens.com>
Subject: [OE-core][PATCH v2 1/2] bitbake.conf: Split optimization into common part
Date: Mon, 23 Nov 2020 20:00:28 +0100	[thread overview]
Message-ID: <20201123190029.13811-1-andrej.valek@siemens.com> (raw)
In-Reply-To: <20201122124853.30262-1-andrej.valek@siemens.com>

This option allows correctly handle the release/debug flags separation in
upper recipe like cmake. Adopt SELECTED_OPTIMIZATION usage in other
recipes.

Signed-off-by: Andrej Valek <andrej.valek@siemens.com>
Signed-off-by: Pascal Bach <pascal.bach@siemens.com>
Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
---
 meta/conf/bitbake.conf                            | 7 ++++---
 meta/conf/distro/include/security_flags.inc       | 8 ++++----
 meta/conf/local.conf.sample.extended              | 1 +
 meta/recipes-devtools/valgrind/valgrind_3.16.1.bb | 1 +
 4 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index 0d38eac094..5555093e24 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -569,7 +569,7 @@ TARGET_CPPFLAGS = ""
 export BUILD_CFLAGS = "${BUILD_CPPFLAGS} ${BUILD_OPTIMIZATION}"
 BUILDSDK_CFLAGS = "${BUILDSDK_CPPFLAGS} ${BUILD_OPTIMIZATION} ${DEBUG_PREFIX_MAP}"
 export CFLAGS = "${TARGET_CFLAGS}"
-TARGET_CFLAGS = "${TARGET_CPPFLAGS} ${SELECTED_OPTIMIZATION}"
+TARGET_CFLAGS = "${TARGET_CPPFLAGS} ${SELECTED_OPTIMIZATION} ${COMMON_OPTIMIZATION}"
 
 export BUILD_CXXFLAGS = "${BUILD_CFLAGS}"
 BUILDSDK_CXXFLAGS = "${BUILDSDK_CFLAGS}"
@@ -616,8 +616,9 @@ DEBUG_PREFIX_MAP ?= "-fmacro-prefix-map=${WORKDIR}=/usr/src/debug/${PN}/${EXTEND
 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 = "-Og ${DEBUG_FLAGS} -pipe"
+COMMON_OPTIMIZATION = "${DEBUG_FLAGS} -pipe"
+FULL_OPTIMIZATION = "-O2"
+DEBUG_OPTIMIZATION = "-Og"
 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', '-Og -g -feliminate-unused-debug-types', '-O2', d)} -pipe"
diff --git a/meta/conf/distro/include/security_flags.inc b/meta/conf/distro/include/security_flags.inc
index 4e64eb99f9..60370eeb17 100644
--- a/meta/conf/distro/include/security_flags.inc
+++ b/meta/conf/distro/include/security_flags.inc
@@ -63,7 +63,7 @@ SECURITY_STACK_PROTECTOR_pn-glibc-testsuite = ""
 # handled in recipes-graphics/xorg-driver/xorg-driver-common.inc
 SECURITY_LDFLAGS_pn-xserver-xorg = "${SECURITY_X_LDFLAGS}"
 
-TARGET_CC_ARCH_append_pn-binutils = " ${SELECTED_OPTIMIZATION}"
-TARGET_CC_ARCH_append_pn-gcc = " ${SELECTED_OPTIMIZATION}"
-TARGET_CC_ARCH_append_pn-gdb = " ${SELECTED_OPTIMIZATION}"
-TARGET_CC_ARCH_append_pn-perf = " ${SELECTED_OPTIMIZATION}"
+TARGET_CC_ARCH_append_pn-binutils = " ${SELECTED_OPTIMIZATION} ${COMMON_OPTIMIZATION}"
+TARGET_CC_ARCH_append_pn-gcc = " ${SELECTED_OPTIMIZATION} ${COMMON_OPTIMIZATION}"
+TARGET_CC_ARCH_append_pn-gdb = " ${SELECTED_OPTIMIZATION} ${COMMON_OPTIMIZATION}"
+TARGET_CC_ARCH_append_pn-perf = " ${SELECTED_OPTIMIZATION} ${COMMON_OPTIMIZATION}"
diff --git a/meta/conf/local.conf.sample.extended b/meta/conf/local.conf.sample.extended
index 5ece522fa8..51cea43b9e 100644
--- a/meta/conf/local.conf.sample.extended
+++ b/meta/conf/local.conf.sample.extended
@@ -99,6 +99,7 @@
 #
 # PROFILE_OPTIMIZATION = "-pg"
 # SELECTED_OPTIMIZATION = "${PROFILE_OPTIMIZATION}"
+# COMMON_OPTIMIZATION = ""
 # LDFLAGS =+ "-pg"
 
 # TCMODE controls the characteristics of the generated packages/images by
diff --git a/meta/recipes-devtools/valgrind/valgrind_3.16.1.bb b/meta/recipes-devtools/valgrind/valgrind_3.16.1.bb
index bcba55f327..395d603cec 100644
--- a/meta/recipes-devtools/valgrind/valgrind_3.16.1.bb
+++ b/meta/recipes-devtools/valgrind/valgrind_3.16.1.bb
@@ -97,6 +97,7 @@ CACHED_CONFIGUREVARS += "ac_cv_path_PERL='/usr/bin/env perl'"
 # (via CFLAGS) means we interfere with that. Only pass DEBUG_FLAGS to it
 # which fixes build path issue in DWARF.
 SELECTED_OPTIMIZATION = "${DEBUG_FLAGS}"
+COMMON_OPTIMIZATION = ""
 
 do_configure_prepend () {
     rm -rf ${S}/config.h
-- 
2.11.0


  parent reply	other threads:[~2020-11-23 19:00 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-22 12:48 [OE-core][PATCH 1/2] bitbake.conf: Split optimization into common part Andrej Valek
2020-11-22 12:48 ` [OE-core][PATCH 2/2] cmake: split release and debug flags Andrej Valek
2020-11-23 15:03   ` Khem Raj
2020-11-23 19:00 ` Andrej Valek [this message]
2020-11-23 19:17   ` [OE-core][PATCH v2 1/2] bitbake.conf: Split optimization into common part Richard Purdie
2020-11-24  8:01     ` Andrej Valek
2020-11-24 13:34       ` Richard Purdie
2020-11-24 18:47         ` Andrej Valek
2020-11-24 19:29   ` Khem Raj
2020-11-25 10:30   ` Richard Purdie
2020-11-25 16:58     ` Andrej Valek
2020-11-23 19:00 ` [OE-core][PATCH v2 2/2] cmake: split release and debug flags Andrej Valek
2020-11-24 19:32   ` Khem Raj
2020-11-25 10:23     ` Andrej Valek
2020-11-25 15:45       ` Khem Raj

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=20201123190029.13811-1-andrej.valek@siemens.com \
    --to=andrej.valek@siemens.com \
    --cc=adrian.freihofer@siemens.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=pascal.bach@siemens.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox