Fix some incorrect TARGET_-* flags
cover Fix some incorrect TARGET_-* flags
From: Ming Liu <[email protected]>
I had found a lot of churn in sysroots when multiple MACHINEs are sharing a same build folder, which is the case in my company, after digging into it, I found it's caused by the TARGET_-* flags, they are exported but not in use at all, they should be replaced by particular flags for cross,crosssdk,nativesdk,cross-canadian, native class does not need that because it's already done in:
commit 05a70ac30b37cab0952f1b9df501993a9dec70da:
[ native.bbclass: Override TARGET_ flags too ]
Ming Liu (4):
cross.bbclass: override TARGET_* flags
crosssdk.bbclass: override TARGET_* flags
nativesdk.bbclass: override TARGET_* flags
cross-canadian.bbclass: override TARGET_* flags
meta/classes/cross-canadian.bbclass | 5 +++++ meta/classes/cross.bbclass | 5 +++++ meta/classes/crosssdk.bbclass | 5 +++++ meta/classes/nativesdk.bbclass | 4 ++++ 4 files changed, 19 insertions(+)
Signature · 1 line
2.7.4
PATCH 1/4 cross.bbclass: override TARGET_* flags
From: Ming Liu <[email protected]>
Some TARGET_* flags are being exported in bitbake.conf currently, so they are impacting all the tasks of a cross recipe even they are not in use at all.
This can lead a lot of churn when the cross sysroot are shared by machines while they have defined different TARGET_* flags.
And sometimes it even causes "Taskhash mismatch" errors.
Fix it by overriding with BUILD_* flags.
--- meta/classes/cross.bbclass | 5 +++++ 1 file changed, 5 insertions(+)
meta/classes/cross.bbclass +5 -0
@@ -28,6 +28,11 @@ MULTIMACH_TARGET_SYS = "${BUILD_ARCH}${BUILD_VENDOR}-${BUILD_OS}" export PKG_CONFIG_DIR = "${exec_prefix}/lib/pkgconfig" export PKG_CONFIG_SYSROOT_DIR = "" +TARGET_CPPFLAGS = "${BUILD_CPPFLAGS}" +TARGET_CFLAGS = "${BUILD_CFLAGS}" +TARGET_CXXFLAGS = "${BUILD_CXXFLAGS}" +TARGET_LDFLAGS = "${BUILD_LDFLAGS}" + CPPFLAGS = "${BUILD_CPPFLAGS}" CFLAGS = "${BUILD_CFLAGS}" CXXFLAGS = "${BUILD_CFLAGS}"
Signature · 1 line
2.7.4
PATCH 2/4 crosssdk.bbclass: override TARGET_* flags
In reply to [email protected]From: Ming Liu <[email protected]>
Some TARGET_* flags are being exported in bitbake.conf currently, so they are impacting all the tasks of a crosssdk recipe even they are not in use at all.
This can lead a lot of churn when the crosssdk sysroot are shared by machines while they have defined different TARGET_* flags.
Fix it by overriding with BUILD_* flags.
--- meta/classes/crosssdk.bbclass | 5 +++++ 1 file changed, 5 insertions(+)
meta/classes/crosssdk.bbclass +5 -0
@@ -21,8 +21,13 @@ TARGET_PREFIX = "${SDK_PREFIX}" TARGET_CC_ARCH = "${SDK_CC_ARCH}" TARGET_LD_ARCH = "${SDK_LD_ARCH}" TARGET_AS_ARCH = "${SDK_AS_ARCH}" +TARGET_CPPFLAGS = "${BUILD_CPPFLAGS}" +TARGET_CFLAGS = "${BUILD_CFLAGS}" +TARGET_CXXFLAGS = "${BUILD_CXXFLAGS}" +TARGET_LDFLAGS = "${BUILD_LDFLAGS}" TARGET_FPU = "" + target_libdir = "${SDKPATHNATIVE}${libdir_nativesdk}" target_includedir = "${SDKPATHNATIVE}${includedir_nativesdk}" target_base_libdir = "${SDKPATHNATIVE}${base_libdir_nativesdk}"
Signature · 1 line
2.7.4
PATCH 3/4 nativesdk.bbclass: override TARGET_* flags
In reply to [email protected]From: Ming Liu <[email protected]>
Some TARGET_* flags are being exported in bitbake.conf currently, so they are impacting all the tasks of a nativesdk recipe even they are not in use at all.
This can lead a lot of churn when the nativesdk sysroot are shared by machines while they have defined different TARGET_* flags.
Fix it by overriding with BUILDSDK_* flags.
--- meta/classes/nativesdk.bbclass | 4 ++++ 1 file changed, 4 insertions(+)
meta/classes/nativesdk.bbclass +4 -0
@@ -43,6 +43,10 @@ TARGET_PREFIX = "${SDK_PREFIX}" TARGET_CC_ARCH = "${SDK_CC_ARCH}" TARGET_LD_ARCH = "${SDK_LD_ARCH}" TARGET_AS_ARCH = "${SDK_AS_ARCH}" +TARGET_CPPFLAGS = "${BUILDSDK_CPPFLAGS}" +TARGET_CFLAGS = "${BUILDSDK_CFLAGS}" +TARGET_CXXFLAGS = "${BUILDSDK_CXXFLAGS}" +TARGET_LDFLAGS = "${BUILDSDK_LDFLAGS}" TARGET_FPU = "" EXTRA_OECONF_GCC_FLOAT = ""
Signature · 1 line
2.7.4
PATCH 4/4 cross-canadian.bbclass: override TARGET_* flags
In reply to [email protected]From: Ming Liu <[email protected]>
Some TARGET_* flags are being exported in bitbake.conf currently, so they are impacting all the tasks of a cross-canadian recipe even they are not in use at all.
This can lead a lot of churn when the cross-canadian sysroot are shared by machines while they have defined different TARGET_* flags.
Fix it by overriding with BUILDSDK_* flags.
--- meta/classes/cross-canadian.bbclass | 5 +++++ 1 file changed, 5 insertions(+)
meta/classes/cross-canadian.bbclass +5 -0
@@ -115,6 +115,11 @@ HOST_CC_ARCH = "${SDK_CC_ARCH}" HOST_LD_ARCH = "${SDK_LD_ARCH}" HOST_AS_ARCH = "${SDK_AS_ARCH}" +TARGET_CPPFLAGS = "${BUILDSDK_CPPFLAGS}" +TARGET_CFLAGS = "${BUILDSDK_CFLAGS}" +TARGET_CXXFLAGS = "${BUILDSDK_CXXFLAGS}" +TARGET_LDFLAGS = "${BUILDSDK_LDFLAGS}" + #assign DPKG_ARCH DPKG_ARCH = "${@debian_arch_map(d.getVar('SDK_ARCH'), '')}"
Signature · 1 line
2.7.4
Quoted 11 lines · On Thu, 2017-04-06 at 14:09 +0200, [email protected] wrote:
From: Ming Liu <[email protected]>
I had found a lot of churn in sysroots when multiple MACHINEs are sharing a same build folder, which is the case in my company, after digging into it, I found it's caused by the TARGET_-* flags, they are exported but not in use at all, they should be replaced by particular flags for cross,crosssdk,nativesdk,cross-canadian, native class does not need that because it's already done in:
commit
05a70ac30b37cab0952f1b9df501993a9dec70da:
[ native.bbclass: OverrideTARGET_flags too ]
Whilst I understand why you want to do this, unfortunately these change did break our automated tests, e.g.:
https://autobuilder.yocto.io/builders/nightly-x86-lsb/builds/232/steps/BuildImages/logs/stdio
https://autobuilder.yocto.io/builders/nightly-arm/builds/281/steps/BuildImages/logs/stdio
I think roughly what happened is that binutils-native was built on a machine which doesn't default to PIC (providing libiberty), then prelink-native was attempted on a machine that does. The result is the error you see.
Previously this happened to work since enough target flags leaked into the native ones to avoid the problem. After your change it breaks. We're going to have to look into and fix this before I can merge these changes...
Cheers,
Richard