All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] gummiboot: fix linking for non-host compatible targets
@ 2019-03-26 13:07 Esben Haabendal
  2019-03-26 17:54 ` Thomas Petazzoni
  2019-03-26 20:33 ` Arnout Vandecappelle
  0 siblings, 2 replies; 4+ messages in thread
From: Esben Haabendal @ 2019-03-26 13:07 UTC (permalink / raw)
  To: buildroot

From: Esben Haabendal <esben@haabendal.dk>

Signed-off-by: Esben Haabendal <esben@haabendal.dk>
---
 ...king-for-non-host-compatible-targets.patch | 54 +++++++++++++++++++
 1 file changed, 54 insertions(+)
 create mode 100644 boot/gummiboot/0002-Fix-linking-for-non-host-compatible-targets.patch

diff --git a/boot/gummiboot/0002-Fix-linking-for-non-host-compatible-targets.patch b/boot/gummiboot/0002-Fix-linking-for-non-host-compatible-targets.patch
new file mode 100644
index 000000000000..7d53fb12490c
--- /dev/null
+++ b/boot/gummiboot/0002-Fix-linking-for-non-host-compatible-targets.patch
@@ -0,0 +1,54 @@
+From fc05ced797b87286b8ec7303fe32bf200a072972 Mon Sep 17 00:00:00 2001
+From: Esben Haabendal <esben@haabendal.dk>
+Date: Mon, 18 Mar 2019 11:14:31 +0100
+Subject: [PATCH 2/2] Fix linking for non-host compatible targets
+
+Without this, gummiboot build system will use host 'ld' when linking
+target binary, which is obviously not a good idea.
+
+Signed-off-by: Esben Haabendal <esben@haabendal.dk>
+---
+ Makefile.am  | 4 ++--
+ configure.ac | 4 ++++
+ 2 files changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index 6568a355ed74..9051dd44edd9 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -142,7 +142,7 @@ $(top_builddir)/src/efi/%.o: $(top_srcdir)/src/efi/%.c $(addprefix $(top_srcdir)
+ 	$(AM_V_CC)$(EFI_CC) $(efi_cppflags) $(efi_cflags) -c $< -o $@
+ 
+ $(gummiboot_solib): $(gummiboot_objects)
+-	$(AM_V_CCLD)$(LD) $(efi_ldflags) $(gummiboot_objects) \
++	$(AM_V_CCLD)$(EFI_LD) $(efi_ldflags) $(gummiboot_objects) \
+ 		-o $@ -lefi -lgnuefi $(shell $(CC) -print-libgcc-file-name); \
+ 	nm -D -u $@ | grep ' U ' && exit 1 || :
+ .DELETE_ON_ERROR: $(gummboot_solib)
+@@ -177,7 +177,7 @@ $(top_builddir)/src/efi/%.o: $(top_srcdir)/src/efi/%.c $(addprefix $(top_srcdir)
+ 	$(AM_V_CC)$(EFI_CC) $(efi_cppflags) $(efi_cflags) -c $< -o $@
+ 
+ $(stub_solib): $(stub_objects)
+-	$(AM_V_CCLD)$(LD) $(efi_ldflags) $(stub_objects) \
++	$(AM_V_CCLD)$(EFI_LD) $(efi_ldflags) $(stub_objects) \
+ 		-o $@ -lefi -lgnuefi $(shell $(CC) -print-libgcc-file-name); \
+ 	nm -D -u $@ | grep ' U ' && exit 1 || :
+ .DELETE_ON_ERROR: $(gummboot_solib)
+diff --git a/configure.ac b/configure.ac
+index 27bbe1d73396..b948696c220b 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -40,6 +40,10 @@ dnl Don't try to use things like -std=c99 for efi compilation
+ EFI_CC=$CC
+ AC_SUBST([EFI_CC])
+ 
++dnl Allow specifying linker compatible with the compiler
++EFI_LD=$LD
++AC_SUBST([EFI_LD])
++
+ AC_PROG_CC_C99
+ AM_PROG_CC_C_O
+ AC_PROG_GCC_TRADITIONAL
+-- 
+2.21.0
+
-- 
2.21.0

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

* [Buildroot] [PATCH] gummiboot: fix linking for non-host compatible targets
  2019-03-26 13:07 [Buildroot] [PATCH] gummiboot: fix linking for non-host compatible targets Esben Haabendal
@ 2019-03-26 17:54 ` Thomas Petazzoni
  2019-03-26 20:33 ` Arnout Vandecappelle
  1 sibling, 0 replies; 4+ messages in thread
From: Thomas Petazzoni @ 2019-03-26 17:54 UTC (permalink / raw)
  To: buildroot

On Tue, 26 Mar 2019 14:07:57 +0100
Esben Haabendal <esben.haabendal@gmail.com> wrote:

> From: Esben Haabendal <esben@haabendal.dk>
> 
> Signed-off-by: Esben Haabendal <esben@haabendal.dk>
> ---
>  ...king-for-non-host-compatible-targets.patch | 54 +++++++++++++++++++
>  1 file changed, 54 insertions(+)
>  create mode 100644 boot/gummiboot/0002-Fix-linking-for-non-host-compatible-targets.patch

Applied to master, thanks. A slightly more verbose commit log would
have been nice, but ok.

Thanks,

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

* [Buildroot] [PATCH] gummiboot: fix linking for non-host compatible targets
  2019-03-26 13:07 [Buildroot] [PATCH] gummiboot: fix linking for non-host compatible targets Esben Haabendal
  2019-03-26 17:54 ` Thomas Petazzoni
@ 2019-03-26 20:33 ` Arnout Vandecappelle
  2019-03-27 22:28   ` Esben Haabendal
  1 sibling, 1 reply; 4+ messages in thread
From: Arnout Vandecappelle @ 2019-03-26 20:33 UTC (permalink / raw)
  To: buildroot



On 26/03/2019 14:07, Esben Haabendal wrote:
> + $(gummiboot_solib): $(gummiboot_objects)
> +-	$(AM_V_CCLD)$(LD) $(efi_ldflags) $(gummiboot_objects) \
> ++	$(AM_V_CCLD)$(EFI_LD) $(efi_ldflags) $(gummiboot_objects) \
> + 		-o $@ -lefi -lgnuefi $(shell $(CC) -print-libgcc-file-name); \
                                             ^^^^ Shouldn't this be EFI_CC?
> + 	nm -D -u $@ | grep ' U ' && exit 1 || :

 Is nm the same on all architectures? Of course, since gummiboot is x86 only, it
doesn't matter much.

 Regards,
 Arnout

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

* [Buildroot] [PATCH] gummiboot: fix linking for non-host compatible targets
  2019-03-26 20:33 ` Arnout Vandecappelle
@ 2019-03-27 22:28   ` Esben Haabendal
  0 siblings, 0 replies; 4+ messages in thread
From: Esben Haabendal @ 2019-03-27 22:28 UTC (permalink / raw)
  To: buildroot

Arnout Vandecappelle <arnout@mind.be> writes:

> On 26/03/2019 14:07, Esben Haabendal wrote:
>> + $(gummiboot_solib): $(gummiboot_objects)
>> +-	$(AM_V_CCLD)$(LD) $(efi_ldflags) $(gummiboot_objects) \
>> ++	$(AM_V_CCLD)$(EFI_LD) $(efi_ldflags) $(gummiboot_objects) \
>> + 		-o $@ -lefi -lgnuefi $(shell $(CC) -print-libgcc-file-name); \
>                                              ^^^^ Shouldn't this be EFI_CC?

Yes, it probably should.

>> + 	nm -D -u $@ | grep ' U ' && exit 1 || :
>
>  Is nm the same on all architectures?

I assume nm is cross, so no.

> Of course, since gummiboot is x86 only, it doesn't matter much.

I can include support for specifying $(NM) also, but as you say, it
might not make a difference for anybody.  Unless, someone builds x86
images on non-x86 platforms.

/Esben

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

end of thread, other threads:[~2019-03-27 22:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-26 13:07 [Buildroot] [PATCH] gummiboot: fix linking for non-host compatible targets Esben Haabendal
2019-03-26 17:54 ` Thomas Petazzoni
2019-03-26 20:33 ` Arnout Vandecappelle
2019-03-27 22:28   ` Esben Haabendal

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.