| Summary: | SDK environment-setup CXXFLAGS wrong | ||
|---|---|---|---|
| Product: | [Build System, Metadata & Runtime] OE-Core | Reporter: | Juro Bystricky <juro.bystricky> |
| Component: | devtools / tool chain | Assignee: | Rebecca Chang <rebecca.swee.fun.chang> |
| Status: | VERIFIED FIXED | QA Contact: | nagarajagopal <nagarajagopalx.velu> |
| Severity: | normal | ||
| Priority: | Medium | CC: | brian.avery, ee.peng.yeoh, meta.mr.watcher, meta.watcher, sgw, shashwatx.pandey |
| Version: | 2.4 | ||
| Target Milestone: | 2.4 M4 | ||
| Hardware: | x86 | ||
| OS: | Multiple | ||
| Whiteboard: | |||
| OS type for building Yocto: | --- | Type of Regression: | Regression (Used to work) |
| Verified: | Documentation change: | No (bug/feature does not impact docs) | |
as part of fixing this, could we add a sdk test for all the sdk variables to make sure they expand to something? There's already a couple of sdk tests so extending them is not too bad. (In reply to comment #0) > I filed this as a regression, as in the past I got: > > export CXXFLAGS=" -O2 -pipe -g -feliminate-unused-debug-types " > > (Same as CFLAGS) > > The version info is : > Distro: poky > Distro Version: 2.3 > Metadata Revision: 754c03006943a219ffd417c36ab909b464f57f67 > Timestamp: 20170706170246 Hi Juro, I have checkout to Metadata Revision: 754c03006943a219ffd417c36ab909b464f57f67 and tried to build a sdk from the revision mentioned above. But I'm still getting no definition for CXXFLAGS: export CXXFLAGS="${BUILDSDK_CXXFLAGS}" So I suspect it might have been broken even earlier. I checked some older SDKs installed on my machine, so this one is OK (buid with MACHINE="qemuarm":
Distro: poky
Distro Version: 2.2+snapshot-20170225
Metadata Revision: 3c83b56309ab419f8cda72c0711479f60f61439a
Timestamp: 20170225001909
It has:
export CXXFLAGS=" -O2 -pipe -g -feliminate-unused-debug-types "
Then I have one:
Distro: poky
Distro Version: 2.3
Metadata Revision: f2b91c6e00c5a6de8ef0ac51f9f07e53d1ca9d43
Timestamp: 20170504192226
which is broken (I did not notice this at the time):
export CXXFLAGS="${BUILDSDK_CXXFLAGS}"
I also checked the official yocto releases:
http://downloads.yoctoproject.org/releases/yocto/
Distro: poky
Distro Version: 2.3.1
Metadata Revision: c2ef32ae58737463cf19aab7446d6a30ad81754f
Timestamp: 20170712013505
and the bug is there as well, so it is in 2.3
Distro: poky
Distro Version: 2.3
Metadata Revision: 381897c64069ea43d595380a3ae913bcc79cf7e1
Timestamp: 20170501163737
export CXXFLAGS="${BUILDSDK_CXXFLAGS}"
This one (2.2.1) is OK:
Distro: poky
Distro Version: 2.2.1
Metadata Revision: 6a1f33cc40bfac33cf030fe41e1a8efd1e5fad6f
Timestamp: 20170208201852
export CXXFLAGS=" -O2 -pipe -g -feliminate-unused-debug-types "
I only randomly checked some SDKs (extended & standard), but I think it is fairly safe to state that 2.2 is OK and 2.3 is broken.
(In reply to comment #3) > I only randomly checked some SDKs (extended & standard), but I think it is > fairly safe to state that 2.2 is OK and 2.3 is broken. Thanks Juro, I was also building a few SDK on the major milestone tags to check. Given that you have narrow down to between 2.2 and 2.3, I will start bisecting from here. Git bisecting went bad from commit 863b6d4f80869b0388fd9ef5c0ead38993c3b2b5
(cross-canadian.bbclass: override TARGET_* flags).
CXXFLAGS in SDK environment file is not set correctly at this point.
I did a grep on Poky, BUILDSDK_* flags was set in both:
meta/classes/cross-canadian.bbclass:TARGET_CXXFLAGS = "${BUILDSDK_CXXFLAGS}"
meta/classes/nativesdk.bbclass:TARGET_CXXFLAGS = "${BUILDSDK_CXXFLAGS}"
I think this is how BUILDSDK_CXXFLAGS came about and we are lack of definition of BUILDSDK_CXXFLAGS in bitbake.conf.
I'm proposing adding definition to BUILDSDK_CXXFLAGS in bitbake.conf.
diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index 3110b9c..8ce6c9f 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -542,6 +542,7 @@ export CFLAGS = "${TARGET_CFLAGS}"
export TARGET_CFLAGS = "${TARGET_CPPFLAGS} ${SELECTED_OPTIMIZATION}"
export BUILD_CXXFLAGS = "${BUILD_CFLAGS}"
+BUILDSDK_CXXFLAGS = "${BUILDSDK_CFLAGS}"
export CXXFLAGS = "${TARGET_CXXFLAGS}"
export TARGET_CXXFLAGS = "${TARGET_CFLAGS}"
By referring to BUILDSDK_CFLAGS, it has a definition in bitbake.conf.
This is how I came about adding a definition for BUILDSDK_CXXFLAGS.
Any comments?
Submitted patch to mailing list for review. http://lists.openembedded.org/pipermail/openembedded-core/2017-August/141587.html OE-Core rev: 073ca1cbd1b70d5b36618584a8c88cbba391a259 Verification logs: 1) Checkout to master branch 2) Check SDK toolchain installed in machine. 3) Check environment setup file configured as " export CXXFLAGS= -O2 -pipe -g -feliminate-unused-debug-types " 4) Crosscheck "export CFLAGS" and "export CXXFLAGS" configure should be same. 5) Below find build configuration, Build Configuration: BB_VERSION = "1.35.0" BUILD_SYS = "x86_64-linux" NATIVELSBSTRING = "universal" TARGET_SYS = "i586-poky-linux" MACHINE = "qemux86" DISTRO = "poky" DISTRO_VERSION = "2.4" TUNE_FEATURES = "m32 i586" TARGET_FPU = "" 6) compile the test CPP file and should compile without error. Verification log ,
clone poky
source oe-init-build-env
bitbake core-image-minimal -cpopulate_sdk
Install SDK
setup source the SDK environment,
. /home/raj/SDK_test_cpp/environment-setup-i586-poky-linux
compile test CPP code,
${CXX} ${CXXFLAGS} testplus.cpp -o test
It should pass all the time.
Verified, issue is fixed. |
I just built an SDK: $ bitbake core-image-minimal -cpopulate_sdk The SDK environment file contains this: export CXXFLAGS="${BUILDSDK_CXXFLAGS}" This does not seem right. There is no definition of BUILDSDK_CXXFLAGS anywhere. FWIW bitbake.conf has definitions for BUILDSDK_CPPFLAGS, BUILDSDK_CFLAGS but no definition for BUILDSDK_CXXFLAGS. I filed this as a regression, as in the past I got: export CXXFLAGS=" -O2 -pipe -g -feliminate-unused-debug-types " (Same as CFLAGS) The version info is : Distro: poky Distro Version: 2.3 Metadata Revision: 754c03006943a219ffd417c36ab909b464f57f67 Timestamp: 20170706170246