Skip to content

Commit cfbf824

Browse files
committed
patches/coreboot-4.11: fix bootblock.inc parallel build race condition
The ROMCC bootblock.inc recipe writes a dependency file via shell redirect to $(objgenerated)/bootblock.inc.d. In a fresh parallel (-j) build, make can schedule this before build-dirs creates the generated/ directory, causing: sh: EOL_librem_l1um/generated/bootblock.inc.d: No such file or directory This was hidden by CI cache (coreboot-4.11 crossgcc and build directory were cached), but exposed when cache was invalidated by the coreboot module rename in the previous commit. Add build-dirs as a prerequisite for $(objgenerated)/bootblock.inc, matching the existing fix for assembly.inc (0073-build-race-condition-fixes.patch). Signed-off-by: Filip Lewiński <filip.lewinski@3mdeb.com>
1 parent f9a56fa commit cfbf824

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
src/arch/x86: Ensure $(objgenerated) exists before bootblock.inc is built
2+
3+
The $(objgenerated)/bootblock.inc recipe writes a dependency file to
4+
$(objgenerated)/bootblock.inc.d via shell redirect:
5+
6+
$(CC_bootblock) ... -MM -MT$(objgenerated)/bootblock.inc \
7+
$< > $(objgenerated)/bootblock.inc.d
8+
9+
In a parallel build (-j), make can try to generate bootblock.inc before
10+
the build-dirs target has created the $(objgenerated)/ directory, causing
11+
the shell redirect to fail with "No such file or directory".
12+
13+
Enforce that build-dirs is done before bootblock.inc starts, matching the
14+
fix already applied to assembly.inc in 0073-build-race-condition-fixes.patch.
15+
16+
diff --git a/src/arch/x86/Makefile.inc b/src/arch/x86/Makefile.inc
17+
--- a/src/arch/x86/Makefile.inc
18+
+++ b/src/arch/x86/Makefile.inc
19+
@@ -167,3 +167,3 @@
20+
-include $(objgenerated)/bootblock.inc.d
21+
-$(objgenerated)/bootblock.inc: $(src)/arch/x86/$(subst ",,$(CONFIG_BOOTBLOCK_SOURCE)) $(objutil)/romcc/romcc $(OPTION_TABLE_H) $(KCONFIG_AUTOHEADER)
22+
+$(objgenerated)/bootblock.inc: build-dirs $(src)/arch/x86/$(subst ",,$(CONFIG_BOOTBLOCK_SOURCE)) $(objutil)/romcc/romcc $(OPTION_TABLE_H) $(KCONFIG_AUTOHEADER)
23+
# The open quote in the subst messes with syntax highlighting. Fix it - ")

0 commit comments

Comments
 (0)