gummiboot: add patch fixing compilation error
authorChristian Marangi <[email protected]>
Thu, 4 Dec 2025 13:04:05 +0000 (14:04 +0100)
committerChristian Marangi <[email protected]>
Thu, 4 Dec 2025 13:05:03 +0000 (14:05 +0100)
Add patch fixing compilation error for implicit declaration of
'basename' and also add a patch to use toolchain version of nm and
objcopy tool.

Signed-off-by: Christian Marangi <[email protected]>
utils/gummiboot/Makefile
utils/gummiboot/patches/020-fix-dev-mapping.patch
utils/gummiboot/patches/100-Makefile-get-nm-and-objcopy-tool-from-ENV-variable.patch [new file with mode: 0644]

index 2295a0b39cdb87dc5dc3b2fa4a2b8122f28c768b..5f2df43475feff598eb553cf6dfe83e90226fafe 100644 (file)
@@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=gummiboot
 PKG_VERSION:=48.1
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://dev.alpinelinux.org/archive/gummiboot/
index 0446aa2d07d4f5670177e657c773ef11953cedaf..e63ee277b8305025ba898e43d8994f17e4d7cc1e 100644 (file)
@@ -1,6 +1,14 @@
 --- a/src/setup/setup.c
 +++ b/src/setup/setup.c
-@@ -83,6 +83,9 @@ static int verify_esp(const char *p, uin
+@@ -24,6 +24,7 @@
+ #include <getopt.h>
+ #include <errno.h>
+ #include <stdlib.h>
++#include <libgen.h>
+ #include <assert.h>
+ #include <sys/statfs.h>
+ #include <sys/stat.h>
+@@ -83,6 +84,9 @@ static int verify_esp(const char *p, uin
          blkid_probe b = NULL;
          int r;
          const char *v;
@@ -10,7 +18,7 @@
  
          if (statfs(p, &sfs) < 0) {
                  fprintf(stderr, "Failed to check file system type of %s: %m\n", p);
-@@ -122,24 +125,38 @@ static int verify_esp(const char *p, uin
+@@ -122,24 +126,38 @@ static int verify_esp(const char *p, uin
                  return -ENODEV;
          }
  
diff --git a/utils/gummiboot/patches/100-Makefile-get-nm-and-objcopy-tool-from-ENV-variable.patch b/utils/gummiboot/patches/100-Makefile-get-nm-and-objcopy-tool-from-ENV-variable.patch
new file mode 100644 (file)
index 0000000..8241971
--- /dev/null
@@ -0,0 +1,43 @@
+From 32a605b069631bc41ad868ca35224fb4ec20c774 Mon Sep 17 00:00:00 2001
+From: Christian Marangi <[email protected]>
+Date: Thu, 4 Dec 2025 13:58:15 +0100
+Subject: [PATCH] Makefile: get nm and objcopy tool from ENV variable
+
+Get nm and objcopy tool from ENV variables to permit use alternative
+tool than the one installed on host machine.
+
+Signed-off-by: Christian Marangi <[email protected]>
+---
+ Makefile.am | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -161,11 +161,11 @@ $(top_builddir)/src/efi/%.o: $(top_srcdi
+ $(gummiboot_solib): $(gummiboot_objects)
+       $(AM_V_CCLD)$(LD) $(efi_ldflags) $(gummiboot_objects) \
+               -o $@ -lefi -lgnuefi $(shell $(CC) -print-libgcc-file-name); \
+-      nm -D -u $@ | grep ' U ' && exit 1 || :
++      $(NM) -D -u $@ | grep ' U ' && exit 1 || :
+ .DELETE_ON_ERROR: $(gummboot_solib)
+ $(gummiboot): $(gummiboot_solib)
+-      $(AM_V_GEN) objcopy -j .text -j .sdata -j .data -j .dynamic \
++      $(AM_V_GEN) $(OBJCOPY) -j .text -j .sdata -j .data -j .dynamic \
+         -j .dynsym -j .rel -j .rela -j .reloc \
+         $(FORMAT) $< $@
+@@ -196,11 +196,11 @@ $(top_builddir)/src/efi/%.o: $(top_srcdi
+ $(stub_solib): $(stub_objects)
+       $(AM_V_CCLD)$(LD) $(efi_ldflags) $(stub_objects) \
+               -o $@ -lefi -lgnuefi $(shell $(CC) -print-libgcc-file-name); \
+-      nm -D -u $@ | grep ' U ' && exit 1 || :
++      $(NM) -D -u $@ | grep ' U ' && exit 1 || :
+ .DELETE_ON_ERROR: $(gummboot_solib)
+ $(stub): $(stub_solib)
+-      $(AM_V_GEN) objcopy -j .text -j .sdata -j .data -j .dynamic \
++      $(AM_V_GEN) $(OBJCOPY) -j .text -j .sdata -j .data -j .dynamic \
+         -j .dynsym -j .rel -j .rela -j .reloc \
+         $(FORMAT) $< $@