0002-Fix-linking-for-non-host-compatible-targets.patch 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. From fc05ced797b87286b8ec7303fe32bf200a072972 Mon Sep 17 00:00:00 2001
  2. From: Esben Haabendal <esben@haabendal.dk>
  3. Date: Mon, 18 Mar 2019 11:14:31 +0100
  4. Subject: [PATCH] Fix linking for non-host compatible targets
  5. Without this, gummiboot build system will use host 'ld' when linking
  6. target binary, which is obviously not a good idea.
  7. Signed-off-by: Esben Haabendal <esben@haabendal.dk>
  8. ---
  9. Makefile.am | 4 ++--
  10. configure.ac | 4 ++++
  11. 2 files changed, 6 insertions(+), 2 deletions(-)
  12. diff --git a/Makefile.am b/Makefile.am
  13. index 6568a355ed74..9051dd44edd9 100644
  14. --- a/Makefile.am
  15. +++ b/Makefile.am
  16. @@ -142,7 +142,7 @@ $(top_builddir)/src/efi/%.o: $(top_srcdir)/src/efi/%.c $(addprefix $(top_srcdir)
  17. $(AM_V_CC)$(EFI_CC) $(efi_cppflags) $(efi_cflags) -c $< -o $@
  18. $(gummiboot_solib): $(gummiboot_objects)
  19. - $(AM_V_CCLD)$(LD) $(efi_ldflags) $(gummiboot_objects) \
  20. + $(AM_V_CCLD)$(EFI_LD) $(efi_ldflags) $(gummiboot_objects) \
  21. -o $@ -lefi -lgnuefi $(shell $(CC) -print-libgcc-file-name); \
  22. nm -D -u $@ | grep ' U ' && exit 1 || :
  23. .DELETE_ON_ERROR: $(gummboot_solib)
  24. @@ -177,7 +177,7 @@ $(top_builddir)/src/efi/%.o: $(top_srcdir)/src/efi/%.c $(addprefix $(top_srcdir)
  25. $(AM_V_CC)$(EFI_CC) $(efi_cppflags) $(efi_cflags) -c $< -o $@
  26. $(stub_solib): $(stub_objects)
  27. - $(AM_V_CCLD)$(LD) $(efi_ldflags) $(stub_objects) \
  28. + $(AM_V_CCLD)$(EFI_LD) $(efi_ldflags) $(stub_objects) \
  29. -o $@ -lefi -lgnuefi $(shell $(CC) -print-libgcc-file-name); \
  30. nm -D -u $@ | grep ' U ' && exit 1 || :
  31. .DELETE_ON_ERROR: $(gummboot_solib)
  32. diff --git a/configure.ac b/configure.ac
  33. index 27bbe1d73396..b948696c220b 100644
  34. --- a/configure.ac
  35. +++ b/configure.ac
  36. @@ -40,6 +40,10 @@ dnl Don't try to use things like -std=c99 for efi compilation
  37. EFI_CC=$CC
  38. AC_SUBST([EFI_CC])
  39. +dnl Allow specifying linker compatible with the compiler
  40. +EFI_LD=$LD
  41. +AC_SUBST([EFI_LD])
  42. +
  43. AC_PROG_CC_C99
  44. AM_PROG_CC_C_O
  45. AC_PROG_GCC_TRADITIONAL
  46. --
  47. 2.21.0