From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1Xu0A3-0004eA-Ut for mharc-grub-devel@gnu.org; Thu, 27 Nov 2014 09:35:11 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45830) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xu09x-0004aU-Ht for grub-devel@gnu.org; Thu, 27 Nov 2014 09:35:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xu09r-0006L5-QZ for grub-devel@gnu.org; Thu, 27 Nov 2014 09:35:05 -0500 Received: from mail-la0-x22a.google.com ([2a00:1450:4010:c03::22a]:56778) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xu09r-0006Kr-IN for grub-devel@gnu.org; Thu, 27 Nov 2014 09:34:59 -0500 Received: by mail-la0-f42.google.com with SMTP id s18so4333831lam.29 for ; Thu, 27 Nov 2014 06:34:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=Or5Z0/bxvMNa1Mjlw3SDeZim/yE3iQc6c1m156nwMfs=; b=oyn6zFak0EXPvq0fYEQ/mTGktpL22kmvAK74XymPUSCsvzAkPoJSwg1AfW53Wl1r/l VurTsF72B1DxrkeAUqJ4lcjXz+KdQs5ObMhC2208HRwBeQidl7EuGD6lqKFlli9JCHH7 3Hm28DwJz+UdpNedRxAbAnijfNkYrqeeN2wDQ6Wm3yx+fSWTszYO6BMHKs4YI6BXEXGA /3MrO0G9Ae5TNIvqm93O7cof4YOIpu7UYiQBHN3F9gPqCNoNCOVzv/r3qqOWI4aajZ2c yPw+aFHQwPjnT/PJ+D12Nbrs2BcvbzQeX3g4g45gI9e/qE9X0+ON2951od1ojvgPRHiZ CzPA== X-Received: by 10.112.157.194 with SMTP id wo2mr39269307lbb.55.1417098898744; Thu, 27 Nov 2014 06:34:58 -0800 (PST) Received: from opensuse.site (ppp91-76-149-193.pppoe.mtu-net.ru. [91.76.149.193]) by mx.google.com with ESMTPSA id li3sm1928670lbc.31.2014.11.27.06.34.57 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Nov 2014 06:34:58 -0800 (PST) Date: Thu, 27 Nov 2014 17:34:56 +0300 From: Andrei Borzenkov To: Felix Janda Subject: Re: grub-core/osdep/unix/hostdisk.c: remove support for ancient glibc Message-ID: <20141127173456.598c173a@opensuse.site> In-Reply-To: <20141121200040.GA4858@euler> References: <20141121200040.GA4858@euler> X-Mailer: Claws Mail 3.11.0 (GTK+ 2.24.25; x86_64-suse-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c03::22a Cc: grub-devel@gnu.org, daggs 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: Thu, 27 Nov 2014 14:35:10 -0000 =D0=92 Fri, 21 Nov 2014 21:00:41 +0100 Felix Janda =D0=BF=D0=B8=D1=88=D0=B5=D1=82: > 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 Could you replace glibc version check with configure test for llseek? This should cover your case as well. > --Felix >=20 > diff -ur a/grub-2.02~beta2/grub-core/osdep/unix/hostdisk.c b/grub-2.02~be= ta2/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_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 @@ > =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