0002-Fix-build-for-openrisc-with-uClibc.patch 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. From aa902671bf1e0e808fd994bd6b403d70af7ab6dd Mon Sep 17 00:00:00 2001
  2. From: Baruch Siach <baruch@tkos.co.il>
  3. Date: Tue, 3 Apr 2018 20:02:14 +0300
  4. Subject: [PATCH] Fix build for openrisc with uClibc
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. uClibc defines EM_OR1K instead of EM_OPENRISC for the OpenRISC ELF
  9. e_machine ID. Use EM_OR1K when EM_OPENRISC is not defined.
  10. This fixes the following build failure:
  11. In file included from nlist.c:44:0:
  12. nlist.c: In function ‘__elf_is_okay__’:
  13. local-elf.h:224:23: error: ‘EM_OPENRISC’ undeclared (first use in this function)
  14. #define ELF_TARG_MACH EM_OPENRISC
  15. ^
  16. nlist.c:77:26: note: in expansion of macro ‘ELF_TARG_MACH’
  17. if (ehdr->e_machine == ELF_TARG_MACH &&
  18. ^
  19. Signed-off-by: Baruch Siach <baruch@tkos.co.il>
  20. ---
  21. Upstream status: sent to libbsd@lists.freedesktop.org
  22. src/local-elf.h | 4 ++++
  23. 1 file changed, 4 insertions(+)
  24. diff --git a/src/local-elf.h b/src/local-elf.h
  25. index 1faf182f87d7..79f7d026f6c9 100644
  26. --- a/src/local-elf.h
  27. +++ b/src/local-elf.h
  28. @@ -221,7 +221,11 @@
  29. #elif defined(__or1k__)
  30. +#if defined(EM_OPENRISC)
  31. #define ELF_TARG_MACH EM_OPENRISC
  32. +#else
  33. +#define ELF_TARG_MACH EM_OR1K
  34. +#endif
  35. #define ELF_TARG_CLASS ELFCLASS32
  36. #define ELF_TARG_DATA ELFDATA2MSB
  37. --
  38. 2.16.3