Skip to contentSkip to conversation

make-mod-scripts: Fix a rare build race condition

PATCH Superseded Khem Raj 2 participants 2 messages May 27, 2020

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH v2 1/1 make-mod-scripts: Fix a rare build race condition

There is a build break which often happens whem using 4.1 kernel

/bin/sh: 1: scripts/basic/fixdep: Permission denied scripts/Makefile.host:124: recipe for target 'scripts/dtc/srcpos.o' failed make[3]: *** [scripts/dtc/srcpos.o] Error 126

this patch sequences the build targets so it can work reliably with different kernel versions

Divide the target into scripts_basic scripts is not strictly necessary and was simply what was used for testing on kernel 4.1, which is quite an old kernel

perhaps just using scripts is sufficient, but it is not tested to not known will cause the build race as seen above.

Cc Bruce Ashfield <[email protected]>

---
v2: Improve commit msg

 .../make-mod-scripts/make-mod-scripts_1.0.bb               | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb +4 -3
index 0be1422a24..c7edb20ee4 100644
@@ -23,7 +23,8 @@ EXTRA_OEMAKE = " HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" HOSTCPP="
 #
 do_configure() {
 	unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS
-	oe_runmake CC="${KERNEL_CC}" LD="${KERNEL_LD}" AR="${KERNEL_AR}" \
-	           -C ${STAGING_KERNEL_DIR} O=${STAGING_KERNEL_BUILDDIR} scripts prepare
-
+	for t in prepare scripts_basic scripts; do
+		oe_runmake CC="${KERNEL_CC}" LD="${KERNEL_LD}" AR="${KERNEL_AR}" \
+		-C ${STAGING_KERNEL_DIR} O=${STAGING_KERNEL_BUILDDIR} $t
+	done
 }
Signature · 1 line
2.26.2
#1 lore raw
Quoted 2 lines · Khem Raj

There is a build break which often happens whem using 4.1 kernel

Perhaps change "often" to "rarely" to match the title...

Quoted 42 lines

/bin/sh: 1: scripts/basic/fixdep: Permission denied scripts/Makefile.host:124: recipe for target 'scripts/dtc/srcpos.o' failed make[3]: *** [scripts/dtc/srcpos.o] Error 126

this patch sequences the build targets so it can work reliably with different kernel versions

Divide the target into scripts_basic scripts is not strictly necessary and was simply what was used for testing on kernel 4.1, which is quite an old kernel

perhaps just using scripts is sufficient, but it is not tested to not known will cause the build race as seen above.

Cc Bruce Ashfield <[email protected]>

---
v2: Improve commit msg

 .../make-mod-scripts/make-mod-scripts_1.0.bb               | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
meta/recipes-kernel/make-mod-scripts/make-mod-scripts_1.0.bb +4 -4
index 0be1422a24..c7edb20ee4 100644
@@ -23,7 +23,8 @@ EXTRA_OEMAKE = " HOSTCC="${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS}" HOSTCPP="
 #
 do_configure() {
        unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS
-       oe_runmake CC="${KERNEL_CC}" LD="${KERNEL_LD}" AR="${KERNEL_AR}" \
-                  -C ${STAGING_KERNEL_DIR} O=${STAGING_KERNEL_BUILDDIR} scripts prepare
-
+       for t in prepare scripts_basic scripts; do
+               oe_runmake CC="${KERNEL_CC}" LD="${KERNEL_LD}" AR="${KERNEL_AR}" \
+               -C ${STAGING_KERNEL_DIR} O=${STAGING_KERNEL_BUILDDIR} $t
+       done
 }
--

2.26.2