All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] [2022.02.x] boot/grub2: fix build race condition
@ 2022-08-04 12:39 Stefan Agner
  0 siblings, 0 replies; only message in thread
From: Stefan Agner @ 2022-08-04 12:39 UTC (permalink / raw)
  To: yann.morin.1998, buildroot; +Cc: stefan

Sometimes buildroot fails with:
../grub-core/kern/emu/hostfs.c:20:10: fatal error: config-util.h: No such file or directory
   20 | #include <config-util.h>
      |          ^~~~~~~~~~~~~~~

Add a patch which fixes the Makefile to correctly generate config-util.h
first.

Signed-off-by: Stefan Agner <stefan@agner.ch>
---
 ...ub_fstest.pp-depend-on-config-util.h.patch | 36 +++++++++++++++++++
 1 file changed, 36 insertions(+)
 create mode 100644 boot/grub2/0151-Makefile-Make-grub_fstest.pp-depend-on-config-util.h.patch

diff --git a/boot/grub2/0151-Makefile-Make-grub_fstest.pp-depend-on-config-util.h.patch b/boot/grub2/0151-Makefile-Make-grub_fstest.pp-depend-on-config-util.h.patch
new file mode 100644
index 0000000000..f25291b504
--- /dev/null
+++ b/boot/grub2/0151-Makefile-Make-grub_fstest.pp-depend-on-config-util.h.patch
@@ -0,0 +1,36 @@
+From 2ad0b32a5c7a94c10b982139934a931c547929b3 Mon Sep 17 00:00:00 2001
+Message-Id: <2ad0b32a5c7a94c10b982139934a931c547929b3.1659606262.git.stefan@agner.ch>
+From: Stefan Agner <stefan@agner.ch>
+Date: Thu, 4 Aug 2022 11:43:12 +0200
+Subject: [PATCH] Makefile: Make grub_fstest.pp depend on config-util.h
+
+If you build with "make -j25", sometimes you see:
+/build/output_generic_x86_64/host/bin/x86_64-buildroot-linux-gnu-gcc -E -DHAVE_CONFIG_H -I. -I..  -Wall -W -DGRUB_UTIL=1 -D_FILE_OFFSET_BITS=64 -I./include -DGRUB_FILE=\"util/grub-fstest.c\" -I. -I.. -I. -I.. -I../include -I./include -I../grub-core/lib/libgcrypt-grub/src/ -I./grub-core/lib/gnulib -I../grub-core/lib/gnulib  -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -fno-stack-protector -D_FILE_OFFSET_BITS=64 \
+  -D'GRUB_MOD_INIT(x)=@MARKER@x@' ../util/grub-fstest.c ../grub-core/kern/emu/hostfs.c ../grub-core/disk/host.c ../grub-core/osdep/init.c > grub_fstest.pp || (rm -f grub_fstest.pp; exit 1)
+config.status: creating config-util.h
+../grub-core/kern/emu/hostfs.c:20:10: fatal error: config-util.h: No such file or directory
+   20 | #include <config-util.h>
+      |          ^~~~~~~~~~~~~~~
+compilation terminated.
+
+Signed-off-by: Stefan Agner <stefan@agner.ch>
+---
+ Makefile.am | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index 42e121feb..43635d5ff 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -60,7 +60,7 @@ libgrub_a_init.c: libgrub_a_init.lst $(top_srcdir)/geninit.sh
+ CLEANFILES += libgrub_a_init.c
+ 
+ # For grub-fstest
+-grub_fstest.pp: $(grub_fstest_SOURCES)
++grub_fstest.pp: config-util.h $(grub_fstest_SOURCES)
+ 	$(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(grub_fstest_CPPFLAGS) $(CPPFLAGS) \
+ 	  -D'GRUB_MOD_INIT(x)=@MARKER@x@' $^ > $@ || (rm -f $@; exit 1)
+ CLEANFILES += grub_fstest.pp
+-- 
+2.37.1
+
-- 
2.37.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-08-04 12:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-04 12:39 [Buildroot] [PATCH] [2022.02.x] boot/grub2: fix build race condition Stefan Agner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.