OpenWrt-Devel-package-grub2-fix-musl-build.patch 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. From patchwork Thu Jun 25 09:51:31 2015
  2. Content-Type: text/plain; charset="utf-8"
  3. MIME-Version: 1.0
  4. Content-Transfer-Encoding: 7bit
  5. Subject: [OpenWrt-Devel,package] grub2: fix musl build
  6. X-Patchwork-Submitter: Dirk Neukirchen <dirkneukirchen@web.de>
  7. X-Patchwork-Id: 488325
  8. X-Patchwork-Delegate: jow@openwrt.org
  9. Message-Id: <558BCF23.40304@web.de>
  10. To: OpenWrt Development List <openwrt-devel@lists.openwrt.org>
  11. Date: Thu, 25 Jun 2015 11:51:31 +0200
  12. From: Dirk Neukirchen <dirkneukirchen@web.de>
  13. List-Id: OpenWrt Development List <openwrt-devel.lists.openwrt.org>
  14. fixes compile error:
  15. grub-core/osdep/unix/hostdisk.c: In function 'grub_util_fd_seek':
  16. grub-core/osdep/unix/hostdisk.c:89:14: error: invalid storage class for function '_llseek'
  17. static int _llseek (uint filedes, ulong hi, ulong lo,
  18. Signed-off-by: Dirk Neukirchen <dirkneukirchen@web.de>
  19. ---
  20. package/boot/grub2/patches/001-grub-musl.patch | 47 ++++++++++++++++++++++++++
  21. 1 file changed, 47 insertions(+)
  22. create mode 100644 package/boot/grub2/patches/001-grub-musl.patch
  23. diff --git a/package/boot/grub2/patches/001-grub-musl.patch b/package/boot/grub2/patches/001-grub-musl.patch
  24. new file mode 100644
  25. index 0000000..daba87f
  26. --- /dev/null
  27. +++ b/package/boot/grub2/patches/001-grub-musl.patch
  28. @@ -0,0 +1,47 @@
  29. +--- a/grub-core/osdep/unix/hostdisk.c
  30. ++++ b/grub-core/osdep/unix/hostdisk.c
  31. +@@ -48,11 +48,6 @@
  32. + #ifdef __linux__
  33. + # include <sys/ioctl.h> /* ioctl */
  34. + # include <sys/mount.h>
  35. +-# if !defined(__GLIBC__) || \
  36. +- ((__GLIBC__ < 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ < 1)))
  37. +-/* Maybe libc doesn't have large file support. */
  38. +-# include <linux/unistd.h> /* _llseek */
  39. +-# endif /* (GLIBC < 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR < 1)) */
  40. + #endif /* __linux__ */
  41. +
  42. + grub_uint64_t
  43. +@@ -79,24 +74,6 @@ grub_util_get_fd_size (grub_util_fd_t fd
  44. + return st.st_size;
  45. + }
  46. +
  47. +-#if defined(__linux__) && (!defined(__GLIBC__) || \
  48. +- ((__GLIBC__ < 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ < 1))))
  49. +- /* Maybe libc doesn't have large file support. */
  50. +-int
  51. +-grub_util_fd_seek (grub_util_fd_t fd, grub_uint64_t off)
  52. +-{
  53. +- loff_t offset, result;
  54. +- static int _llseek (uint filedes, ulong hi, ulong lo,
  55. +- loff_t *res, uint wh);
  56. +- _syscall5 (int, _llseek, uint, filedes, ulong, hi, ulong, lo,
  57. +- loff_t *, res, uint, wh);
  58. +-
  59. +- offset = (loff_t) off;
  60. +- if (_llseek (fd, offset >> 32, offset & 0xffffffff, &result, SEEK_SET))
  61. +- return -1;
  62. +- return GRUB_ERR_NONE;
  63. +-}
  64. +-#else
  65. + int
  66. + grub_util_fd_seek (grub_util_fd_t fd, grub_uint64_t off)
  67. + {
  68. +@@ -107,7 +84,6 @@ grub_util_fd_seek (grub_util_fd_t fd, gr
  69. +
  70. + return 0;
  71. + }
  72. +-#endif
  73. +
  74. +
  75. + /* Read LEN bytes from FD in BUF. Return less than or equal to zero if an