1 From patchwork Thu Jun 25 09:51:31 2015
2 Content-Type: text/plain; charset="utf-8"
4 Content-Transfer-Encoding: 7bit
5 Subject: [OpenWrt-Devel,package] grub2: fix musl build
6 X-Patchwork-Submitter: Dirk Neukirchen <dirkneukirchen@web.de>
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>
16 grub-core/osdep/unix/hostdisk.c: In function 'grub_util_fd_seek':
17 grub-core/osdep/unix/hostdisk.c:89:14: error: invalid storage class for function '_llseek'
18 static int _llseek (uint filedes, ulong hi, ulong lo,
20 Signed-off-by: Dirk Neukirchen <dirkneukirchen@web.de>
22 package/boot/grub2/patches/001-grub-musl.patch | 47 ++++++++++++++++++++++++++
23 1 file changed, 47 insertions(+)
24 create mode 100644 package/boot/grub2/patches/001-grub-musl.patch
26 diff --git a/package/boot/grub2/patches/001-grub-musl.patch b/package/boot/grub2/patches/001-grub-musl.patch
28 index 0000000..daba87f
30 +++ b/package/boot/grub2/patches/001-grub-musl.patch
32 +--- a/grub-core/osdep/unix/hostdisk.c
33 ++++ b/grub-core/osdep/unix/hostdisk.c
36 + # include <sys/ioctl.h> /* ioctl */
37 + # include <sys/mount.h>
38 +-# if !defined(__GLIBC__) || \
39 +- ((__GLIBC__ < 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ < 1)))
40 +-/* Maybe libc doesn't have large file support. */
41 +-# include <linux/unistd.h> /* _llseek */
42 +-# endif /* (GLIBC < 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR < 1)) */
43 + #endif /* __linux__ */
46 +@@ -79,24 +74,6 @@ grub_util_get_fd_size (grub_util_fd_t fd
50 +-#if defined(__linux__) && (!defined(__GLIBC__) || \
51 +- ((__GLIBC__ < 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ < 1))))
52 +- /* Maybe libc doesn't have large file support. */
54 +-grub_util_fd_seek (grub_util_fd_t fd, grub_uint64_t off)
56 +- loff_t offset, result;
57 +- static int _llseek (uint filedes, ulong hi, ulong lo,
58 +- loff_t *res, uint wh);
59 +- _syscall5 (int, _llseek, uint, filedes, ulong, hi, ulong, lo,
60 +- loff_t *, res, uint, wh);
62 +- offset = (loff_t) off;
63 +- if (_llseek (fd, offset >> 32, offset & 0xffffffff, &result, SEEK_SET))
65 +- return GRUB_ERR_NONE;
69 + grub_util_fd_seek (grub_util_fd_t fd, grub_uint64_t off)
71 +@@ -107,7 +84,6 @@ grub_util_fd_seek (grub_util_fd_t fd, gr
78 + /* Read LEN bytes from FD in BUF. Return less than or equal to zero if an