[1/2] bitbake.conf: Split optimization into common part

Submitted by Andrej Valek on Nov. 22, 2020, 12:48 p.m. | Patch ID: 178263

Details

Message ID 20201122124853.30262-1-andrej.valek@siemens.com
State New
Headers show

Commit Message

Andrej Valek Nov. 22, 2020, 12:48 p.m.
This option allows correctly handle the release/debug flags separation in
upper recipe like cmake.

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 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

-- 
2.11.0
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#144901): https://lists.openembedded.org/g/openembedded-core/message/144901
Mute This Topic: https://lists.openembedded.org/mt/78429702/1003190
Group Owner: openembedded-core+owner@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [mhalstead@linuxfoundation.org]
-=-=-=-=-=-=-=-=-=-=-=-

Patch hide | download patch | download mbox

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"