summaryrefslogtreecommitdiffstats
path: root/utils/gummiboot/patches/100-Makefile-get-nm-and-objcopy-tool-from-ENV-variable.patch
blob: 8241971b53eb84460b532372a81639218b9a771c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
From 32a605b069631bc41ad868ca35224fb4ec20c774 Mon Sep 17 00:00:00 2001
From: Christian Marangi <ansuelsmth@gmail.com>
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 <ansuelsmth@gmail.com>
---
 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) $< $@