Skip to contentSkip to conversation

gcc-cross: Avoid races with gcc_stash_builddir

PATCH New Richard Purdie 1 participant 2 messages Feb 19, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 gcc-cross: Avoid races with gcc_stash_builddir

Its sad we need to do this but do_install and do_populate_sysroot appear to change the files in ${B} and this breaks if something works in parallel like gcc_stash_builddir. We've seen a few too many race errors on the autobuilder which appear to be from this so make things run in sequence deterministically for now.

An example failure was this from do_populate_sysroot whilst stash_builddir was running in parallel:

ERROR: gcc-cross-initial-arm-6.3.0-r0 do_populate_sysroot: split_and_strip_files: 'file /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm-lsb/build/build/tmp/work/x86_64-linux/ gcc-cross-initial-arm/6.3.0-r0/sysroot-destdir/home/pokybuild/yocto-autobuilder/yocto-worker/ nightly-arm-lsb/build/build/tmp/work/x86_64-linux/gcc-cross-initial-arm/6.3.0-r0/recipe-sysroot-native/ usr/bin/arm-poky-linux-gnueabi.gcc-cross-initial-arm/arm-poky-linux-gnueabi-gcov' failed

Exception: subprocess.CalledProcessError: Command '('patchelf-uninative', '--set-interpreter', '/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm-lsb/build/build/tmp/sysroots-uninative/ x86_64-linux/lib/ld-linux-x86-64.so.2', '/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-arm-lsb/ build/build/tmp/work/x86_64-linux/gcc-cross-initial-arm/6.3.0-r0/sstate-build-populate_sysroot/ recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi.gcc-cross-initial-arm/arm-poky-linux-gnueabi-gcov')' returned non-zero exit status 1

Subprocess output:
missing section headers

---
 meta/recipes-devtools/gcc/gcc-cross.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-devtools/gcc/gcc-cross.inc +1 -1
index fa5cfbd..bb5f7a0 100644
@@ -200,7 +200,7 @@ do_gcc_stash_builddir () {
 	dest=${BUILDDIRSTASH}
 	hardlinkdir . $dest
 }
-addtask do_gcc_stash_builddir after do_compile before do_build
+addtask do_gcc_stash_builddir after do_compile before do_install
 SSTATETASKS += "do_gcc_stash_builddir"
 do_gcc_stash_builddir[sstate-inputdirs] = "${BUILDDIRSTASH}"
 do_gcc_stash_builddir[sstate-outputdirs] = "${STAGING_DIR}-components/${BUILD_ARCH}/gcc-stashed-builddir${COMPILERINITIAL}-${TARGET_SYS}"
Signature · 1 line
2.7.4
#1 lore raw

PATCH 2/2 depmodwrapper-cross/qemuwrapper-cross: Drop unneeded binutils dependency

By default these pull in binutils-cross since they're a cross tool and pull in any native tool requirements. In reality they don't need such tools at build time or runtime since they're scripts.

Therefore clear the dependency and save on some processing time.

---
 meta/recipes-devtools/qemu/qemuwrapper-cross_1.0.bb | 2 ++
 meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb | 2 ++
 2 files changed, 4 insertions(+)
meta/recipes-devtools/qemu/qemuwrapper-cross_1.0.bb +2 -0
index b86400b..e40cdaf 100644
@@ -7,6 +7,8 @@ DEPENDS += "qemu-native"
 
 inherit qemu
 
+do_populate_sysroot[depends] = ""
+
 do_install () {
 	install -d ${D}${bindir_crossscripts}/
 
meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb +2 -0
index aa2805b..17a99a4 100644
@@ -11,6 +11,8 @@ PACKAGE_ARCH = "${MACHINE_ARCH}"
 SSTATE_SCAN_FILES += "depmodwrapper"
 EXTRA_STAGING_FIXMES = "PKGDATA_DIR"
 
+do_populate_sysroot[depends] = ""
+
 do_install() {
 	install -d ${D}${bindir_crossscripts}/
 
Signature · 1 line
2.7.4