From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1XuSXg-0005N1-KC for mharc-grub-devel@gnu.org; Fri, 28 Nov 2014 15:53:28 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58853) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XuSXX-0005Dh-BQ for grub-devel@gnu.org; Fri, 28 Nov 2014 15:53:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XuSXQ-0004SZ-CD for grub-devel@gnu.org; Fri, 28 Nov 2014 15:53:19 -0500 Received: from mail-wg0-x233.google.com ([2a00:1450:400c:c00::233]:33311) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XuSXQ-0004SQ-5E for grub-devel@gnu.org; Fri, 28 Nov 2014 15:53:12 -0500 Received: by mail-wg0-f51.google.com with SMTP id k14so9539221wgh.24 for ; Fri, 28 Nov 2014 12:53:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type; bh=cOXDrbkenoPUVBrV1ASY1NFdpCSMbWyxFxSTZBNosF4=; b=KyZhDVRQUgSCft779lq0weya56vgOPQvsbxLYHisRrCv1PGZbbuRBoOJP6i73qHPvt a1wpkcP5bSwknGp48AHkzqPWCVAU8sikuiPKATkzmyEttDAQEyr6ZqhwtvqnfIelmV0N j2u0JXLFuNG1/2wjO+KhLAI3/LeGN+JzDuX9yTk7lhc9z2+XBjhFf+1rOCKY3hkzbVxt SsM/HghU3qzM4yhjc3GdHc0BKZjl+3eLwcZvsAaLzOE26BhzbxkWjIuzyY9F2K1sVtGe HGdKE7V937I93rPKqLdoYD6M+3XAlQsePB3Lh+gc4EHeQC8ZsBOfMsZOWn4EcBqToqbr jTCQ== X-Received: by 10.180.96.41 with SMTP id dp9mr55106883wib.13.1417207991517; Fri, 28 Nov 2014 12:53:11 -0800 (PST) Received: from [10.222.38.128] ([212.213.198.101]) by mx.google.com with ESMTPSA id vm8sm16491936wjc.6.2014.11.28.12.53.10 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Nov 2014 12:53:10 -0800 (PST) Message-ID: <5478CA6D.9020904@gmail.com> Date: Fri, 28 Nov 2014 21:18:05 +0200 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.2.0 MIME-Version: 1.0 To: The development of GNU GRUB Subject: Re: grub-core/osdep/unix/hostdisk.c: remove support for ancient glibc References: <20141121200040.GA4858@euler> In-Reply-To: <20141121200040.GA4858@euler> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="89AoUW4wtEQ4pbjdnTdEcjcdX6KFdmVg6" X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c00::233 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, 28 Nov 2014 20:53:26 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --89AoUW4wtEQ4pbjdnTdEcjcdX6KFdmVg6 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 21.11.2014 22:00, Felix Janda wrote: > Hello, >=20 > 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. >=20 Don't assume that nobody will try to compile with ancient glibc. If you want to raise the supported version for glibc you need to add a configure check for presence of long offsets to configure and fail it if it's not available. It should also be documented in INSTALL. > --Felix >=20 > 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__ =3D=3D 2) && (__GLIBC_MINOR__ = < 1))) > -/* Maybe libc doesn't have large file support. */ > -# include /* _llseek */ > -# endif /* (GLIBC < 2) || ((__GLIBC__ =3D=3D 2) && (__GLIBC_MINOR < 1)= ) */ > #endif /* __linux__ */ > =20 > grub_uint64_t > @@ -79,24 +74,6 @@ > return st.st_size; > } > =20 > -#if defined(__linux__) && (!defined(__GLIBC__) || \ > - ((__GLIBC__ < 2) || ((__GLIBC__ =3D=3D 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 =3D (loff_t) off; > - if (_llseek (fd, offset >> 32, offset & 0xffffffff, &result, SEEK_SE= T)) > - 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 @@ > =20 > return 0; > } > -#endif > =20 > =20 > /* Read LEN bytes from FD in BUF. Return less than or equal to zero if= an >=20 > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > https://lists.gnu.org/mailman/listinfo/grub-devel >=20 --89AoUW4wtEQ4pbjdnTdEcjcdX6KFdmVg6 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iF4EAREKAAYFAlR4ym0ACgkQmBXlbbo5nOvRGwD/fGyGazr0yl+m5cpjJRK+UHGU Iv9m9ixasHtkgN32v0sBAKYULROQcklQL569tnUThuDGKJFgU0Y8JLk/Uua8FC7j =2mkS -----END PGP SIGNATURE----- --89AoUW4wtEQ4pbjdnTdEcjcdX6KFdmVg6--