All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Make build more robust
@ 2022-01-13  3:40 Glenn Washburn
  2022-01-13  3:40 ` [PATCH 1/2] gentpl.py: Fix issue where sometimes marker files have CPP defines Glenn Washburn
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Glenn Washburn @ 2022-01-13  3:40 UTC (permalink / raw)
  To: Daniel Kiper, grub-devel; +Cc: Glenn Washburn

I've found these two patches to be necessary under certain build conditions
that I've not been able to narrow down to a specific cause. I suspect it is
related to the values of some build environment variables (like *CFLAGS).
Either way, these patches allow a successful build finishes without error
and where the test suite succeeds. So I believe these patches are allowing
a usable build. Under normal conditions, these changes should be superflous
and thus not affect the build process.

Glenn

Glenn Washburn (2):
  gentpl.py: Fix issue where sometimes marker files have CPP defines
  Makefile: Only look for @MARKER@ at the start of a line when
    generating libgrub_a_init.lst

 Makefile.am | 4 ++--
 gentpl.py   | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

-- 
2.27.0



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/2] gentpl.py: Fix issue where sometimes marker files have CPP defines
  2022-01-13  3:40 [PATCH 0/2] Make build more robust Glenn Washburn
@ 2022-01-13  3:40 ` Glenn Washburn
  2022-01-13  3:40 ` [PATCH 2/2] Makefile: Only look for @MARKER@ at the start of a line when generating libgrub_a_init.lst Glenn Washburn
  2022-01-20 17:07 ` [PATCH 0/2] Make build more robust Daniel Kiper
  2 siblings, 0 replies; 4+ messages in thread
From: Glenn Washburn @ 2022-01-13  3:40 UTC (permalink / raw)
  To: Daniel Kiper, grub-devel; +Cc: Glenn Washburn

When generating video.lst, modules whose marker file contains the string
VIDEO_LIST_MARKER are selected. But when the marker file contains the CPP
defines, one of the defines is VIDEO_LIST_MARKER and is present in all
marker files, so they are all selected. By removing the defines, the correct
modules are selected.

Signed-off-by: Glenn Washburn <development@efficientek.com>
---
 gentpl.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gentpl.py b/gentpl.py
index 28ec24209..9f51e4fb6 100644
--- a/gentpl.py
+++ b/gentpl.py
@@ -700,7 +700,7 @@ def module(defn, platform):
     output("""
 """ + name + """.marker: $(""" + cname(defn) + """_SOURCES) $(nodist_""" + cname(defn) + """_SOURCES)
 	$(TARGET_CPP) -DGRUB_LST_GENERATOR $(CPPFLAGS_MARKER) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(""" + cname(defn) + """_CPPFLAGS) $(CPPFLAGS) $^ > $@.new || (rm -f $@; exit 1)
-	grep 'MARKER' $@.new > $@; rm -f $@.new
+	grep 'MARKER' $@.new | grep -v '^#' > $@; rm -f $@.new
 """)
 
 def kernel(defn, platform):
-- 
2.27.0



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] Makefile: Only look for @MARKER@ at the start of a line when generating libgrub_a_init.lst
  2022-01-13  3:40 [PATCH 0/2] Make build more robust Glenn Washburn
  2022-01-13  3:40 ` [PATCH 1/2] gentpl.py: Fix issue where sometimes marker files have CPP defines Glenn Washburn
@ 2022-01-13  3:40 ` Glenn Washburn
  2022-01-20 17:07 ` [PATCH 0/2] Make build more robust Daniel Kiper
  2 siblings, 0 replies; 4+ messages in thread
From: Glenn Washburn @ 2022-01-13  3:40 UTC (permalink / raw)
  To: Daniel Kiper, grub-devel; +Cc: Glenn Washburn

Under certain conditions libgrub.pp gets generated with a such that it
contains a bunch of CPP defines, at least one of which contains "@MARKER@".
This line should not be used when generating libgrub_a_init.lst, otherwise
we get compiler errors like:

  libgrub_a_init.c:22:18: error: stray ‘#’ in program
     22 | extern void grub_#define_init (void);
        |                  ^
  libgrub_a_init.c:22:19: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘define_init’
     22 | extern void grub_#define_init (void);
        |                   ^~~~~~~~~~~
  libgrub_a_init.c:23:18: error: stray ‘#’ in program
     23 | extern void grub_#define_fini (void);
        |                  ^
  libgrub_a_init.c:23:19: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘define_fini’
     23 | extern void grub_#define_fini (void);
        |                   ^~~~~~~~~~~
  ...

When generating libgrub_a_init.lst only lines starting with "@MARKER@" are
desired.

Signed-off-by: Glenn Washburn <development@efficientek.com>
---
 Makefile.am | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 10faf670b..81a196cdc 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -52,7 +52,7 @@ libgrub.pp: config-util.h grub_script.tab.h grub_script.yy.h $(libgrubmods_a_SOU
 CLEANFILES += libgrub.pp
 
 libgrub_a_init.lst: libgrub.pp
-	cat $< | grep '@MARKER@' | sed 's/@MARKER@\(.*\)@/\1/g' | sort -u > $@ || (rm -f $@; exit 1)
+	cat $< | grep '^@MARKER@' | sed 's/@MARKER@\(.*\)@/\1/g' | sort -u > $@ || (rm -f $@; exit 1)
 CLEANFILES += libgrub_a_init.lst
 
 libgrub_a_init.c: libgrub_a_init.lst $(top_srcdir)/geninit.sh
@@ -66,7 +66,7 @@ grub_fstest.pp: $(grub_fstest_SOURCES)
 CLEANFILES += grub_fstest.pp
 
 grub_fstest_init.lst: libgrub.pp grub_fstest.pp
-	cat $^ | grep '@MARKER@' | sed 's/@MARKER@\(.*\)@/\1/g' | sort -u > $@ || (rm -f $@; exit 1)
+	cat $^ | grep '^@MARKER@' | sed 's/@MARKER@\(.*\)@/\1/g' | sort -u > $@ || (rm -f $@; exit 1)
 CLEANFILES += grub_fstest_init.lst
 
 grub_fstest_init.c: grub_fstest_init.lst $(top_srcdir)/geninit.sh
-- 
2.27.0



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 0/2] Make build more robust
  2022-01-13  3:40 [PATCH 0/2] Make build more robust Glenn Washburn
  2022-01-13  3:40 ` [PATCH 1/2] gentpl.py: Fix issue where sometimes marker files have CPP defines Glenn Washburn
  2022-01-13  3:40 ` [PATCH 2/2] Makefile: Only look for @MARKER@ at the start of a line when generating libgrub_a_init.lst Glenn Washburn
@ 2022-01-20 17:07 ` Daniel Kiper
  2 siblings, 0 replies; 4+ messages in thread
From: Daniel Kiper @ 2022-01-20 17:07 UTC (permalink / raw)
  To: Glenn Washburn; +Cc: grub-devel

On Wed, Jan 12, 2022 at 09:40:19PM -0600, Glenn Washburn wrote:
> I've found these two patches to be necessary under certain build conditions
> that I've not been able to narrow down to a specific cause. I suspect it is
> related to the values of some build environment variables (like *CFLAGS).
> Either way, these patches allow a successful build finishes without error
> and where the test suite succeeds. So I believe these patches are allowing
> a usable build. Under normal conditions, these changes should be superflous
> and thus not affect the build process.

For both Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>...

Daniel


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-01-20 17:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-13  3:40 [PATCH 0/2] Make build more robust Glenn Washburn
2022-01-13  3:40 ` [PATCH 1/2] gentpl.py: Fix issue where sometimes marker files have CPP defines Glenn Washburn
2022-01-13  3:40 ` [PATCH 2/2] Makefile: Only look for @MARKER@ at the start of a line when generating libgrub_a_init.lst Glenn Washburn
2022-01-20 17:07 ` [PATCH 0/2] Make build more robust Daniel Kiper

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.