From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1XrvWb-0001k7-SC for mharc-grub-devel@gnu.org; Fri, 21 Nov 2014 16:13:53 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41342) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XruOW-0005Uk-Il for grub-devel@gnu.org; Fri, 21 Nov 2014 15:01:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XruOQ-0000wG-28 for grub-devel@gnu.org; Fri, 21 Nov 2014 15:01:28 -0500 Received: from mx02.posteo.de ([89.146.194.165]:59240) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XruOP-0000v2-SH for grub-devel@gnu.org; Fri, 21 Nov 2014 15:01:21 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by mx02.posteo.de (Postfix) with ESMTP id DB32F258D261 for ; Fri, 21 Nov 2014 21:01:19 +0100 (CET) X-Virus-Scanned: amavisd-new at posteo.de Received: from posteo.de ([10.125.125.178]) (using TLS) by localhost (amavis1.posteo.de [10.125.125.165]) (amavisd-new, port 10026) with ESMTPS id TK7bFlCjyGIT for ; Fri, 21 Nov 2014 21:01:05 +0100 (CET) Received: from mail.posteo.de (localhost [127.0.0.1]) by mail.posteo.de (Postfix) with ESMTPSA id 3jkpXx20r9zPjkB for ; Fri, 21 Nov 2014 21:01:04 +0100 (CET) Date: Fri, 21 Nov 2014 21:00:41 +0100 From: Felix Janda To: grub-devel@gnu.org Subject: grub-core/osdep/unix/hostdisk.c: remove support for ancient glibc Message-ID: <20141121200040.GA4858@euler> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.22 (2013-10-16) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 89.146.194.165 X-Mailman-Approved-At: Fri, 21 Nov 2014 16:13:53 -0500 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Nov 2014 20:01:34 -0000 Hello, the file grub-core/osdep/unix/hostdisk.c has special code for glibc<2.1, which gets also pulled in for other libcs (such as musl libc) and makes compilation fail for them because the code uses glibc internals. The easiest way to fix is just to remove the code as the below patch does. --Felix diff -ur a/grub-2.02~beta2/grub-core/osdep/unix/hostdisk.c b/grub-2.02~beta2/grub-core/osdep/unix/hostdisk.c --- a/grub-2.02~beta2/grub-core/osdep/unix/hostdisk.c +++ b/grub-2.02~beta2/grub-core/osdep/unix/hostdisk.c @@ -48,11 +48,6 @@ #ifdef __linux__ # include /* ioctl */ # include -# if !defined(__GLIBC__) || \ - ((__GLIBC__ < 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ < 1))) -/* Maybe libc doesn't have large file support. */ -# include /* _llseek */ -# endif /* (GLIBC < 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR < 1)) */ #endif /* __linux__ */ grub_uint64_t @@ -79,24 +74,6 @@ return st.st_size; } -#if defined(__linux__) && (!defined(__GLIBC__) || \ - ((__GLIBC__ < 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ < 1)))) - /* Maybe libc doesn't have large file support. */ -int -grub_util_fd_seek (grub_util_fd_t fd, grub_uint64_t off) -{ - loff_t offset, result; - static int _llseek (uint filedes, ulong hi, ulong lo, - loff_t *res, uint wh); - _syscall5 (int, _llseek, uint, filedes, ulong, hi, ulong, lo, - loff_t *, res, uint, wh); - - offset = (loff_t) off; - if (_llseek (fd, offset >> 32, offset & 0xffffffff, &result, SEEK_SET)) - return -1; - return GRUB_ERR_NONE; -} -#else int grub_util_fd_seek (grub_util_fd_t fd, grub_uint64_t off) { @@ -107,7 +84,6 @@ return 0; } -#endif /* Read LEN bytes from FD in BUF. Return less than or equal to zero if an