From owner-freebsd-current@FreeBSD.ORG Sun Jan 11 12:07:36 2015 Return-Path: Delivered-To: current@freebsd.org Received: from mandree.no-ip.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4310FD92; Sun, 11 Jan 2015 12:07:36 +0000 (UTC) Received: from [IPv6:::1] (localhost6.localdomain6 [IPv6:::1]) by apollo.emma.line.org (Postfix) with ESMTP id A289D23CE98; Sun, 11 Jan 2015 13:07:34 +0100 (CET) Message-ID: <54B26782.9010403@FreeBSD.org> Date: Sun, 11 Jan 2015 13:07:30 +0100 From: Matthias Andree User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: current@freebsd.org, "Ted Y. Ts'o" Subject: Re: What happened to DIOCGDINFO? Fwd: [package - head-amd64-default][misc/e2fsprogs-libblkid] Failed for e2fsprogs-libblkid-1.42.12 in build References: <201501101948.t0AJmqqP067320@beefy2.isc.freebsd.org> <54B1D848.3090800@FreeBSD.org> <1420945507.14601.142.camel@freebsd.org> In-Reply-To: <1420945507.14601.142.camel@freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="8X4v2jtevdvJB574GpRNdPpjw095xGQnI" Cc: Warner Losh X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Jan 2015 12:07:36 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --8X4v2jtevdvJB574GpRNdPpjw095xGQnI Content-Type: multipart/mixed; boundary="------------040605070507090502030905" This is a multi-part message in MIME format. --------------040605070507090502030905 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Am 11.01.2015 um 04:05 schrieb Ian Lepore: >>> Ident: $FreeBSD: head/misc/e2fsprogs-libblkid/Makefile 37038= 8 2014-10-07 19:15:52Z mandree $ >>> Log URL: http://beefy2.isc.freebsd.org/data/head-amd64-default= /2015-01-10_14h05m40s/logs/e2fsprogs-libblkid-1.42.12.log >>> Build URL: http://beefy2.isc.freebsd.org/build.html?mastername=3D= head-amd64-default&build=3D2015-01-10_14h05m40s >>> Log: >> >>> cc -I. -I../../lib -I../../lib -I/wrkdirs/usr/ports/misc/e2fsprogs-li= bblkid/work/e2fsprogs-1.42.12/lib -I/usr/local/include -D_THREAD_SAFE -O2= -pipe -fstack-protector -fno-strict-aliasing -std=3Dgnu99 -DHAVE_CONFIG= _H -c getsize.c -o getsize.o >>> getsize.c:151:31: error: use of undeclared identifier 'DIOCGDINFO' >>> if (part >=3D 0 && (ioctl(fd, DIOCGDINFO, (char *)&la= b) >=3D 0)) { >>> ^ >>> 1 error generated. > It was removed in r276737. I don't know what replaces it. Ted, I am including a patch against e2fsprogs's "maint" branch to fix the build on the future FreeBSD 11+ versions. Please apply. Ian, Warner, *, I think I've got a hold of this; the replacement appears to be DIOCGMEDIASIZE from , and has been for more than a decade, so that I had forgotten about it. The e2fsprogs port has been using DIOCGMEDIASIZE for many years (phk added DIOCGMEDIASIZE on 2002-04-08, I added upstream support 2003-12-28 but it underwent a few revisions, not worth bothering IMO) judging from the source code comments, but one of the two getsize.c source files - the one in lib/blkid/ - lacks an #ifdef DIOCGDINFO guard and relies on #ifdef HAVE_SYS_DISKLABEL_H only and jams the build. The other one in lib/ext2fs/ had a guard that checked the actual ioctl #define. Fix has been committed without Git markup in the FreeBSD ports tree, r376742. Thanks everybody. Best regards, Matthias --------------040605070507090502030905 Content-Type: text/x-patch; name="0001-Fix-build-on-FreeBSD-11-that-removes-DIOCGDINFO.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename*0="0001-Fix-build-on-FreeBSD-11-that-removes-DIOCGDINFO.patch" =46rom 98ec1eeffd3e5752a775a73bec108945fe7a7a53 Mon Sep 17 00:00:00 2001 From: Matthias Andree Date: Sun, 11 Jan 2015 12:58:30 +0100 Subject: [PATCH] Fix build on FreeBSD 11 that removes DIOCGDINFO. The replacement DIOCGMEDIASIZE has been in e2fsprogs since end of 2003, but now the removal of the upstream system breaks the lib/blkid/getsize.c build. lib/ext2fs/getsize.c was unaffected because it had already been checking if this ioctl symbol was #defined. I haven't checked the situation on other BSDs, thus I am not sure if others have DIOCGMEDIASIZE, so I propose to leave the DIOCGDINFO in. Further cleanup opportunity: consolidate lib/blkid/getsize.c and lib/ext2fs/getsize.c. Signed-off-by: Matthias Andree --- lib/blkid/getsize.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/blkid/getsize.c b/lib/blkid/getsize.c index a5c40aa..dc4cc1b 100644 --- a/lib/blkid/getsize.c +++ b/lib/blkid/getsize.c @@ -127,7 +127,7 @@ blkid_loff_t blkid_get_dev_size(int fd) return (blkid_loff_t)this_floppy.size << 9; } #endif -#ifdef HAVE_SYS_DISKLABEL_H +#if defined(HAVE_SYS_DISKLABEL_H) && defined(DIOCGDINFO) { int part =3D -1; struct disklabel lab; @@ -154,7 +154,7 @@ blkid_loff_t blkid_get_dev_size(int fd) return pp->p_size << 9; } } -#endif /* HAVE_SYS_DISKLABEL_H */ +#endif /* defined(HAVE_SYS_DISKLABEL_H) && defined(DIOCGDINFO) */ { #if defined(HAVE_FSTAT64) && !defined(__OSX_AVAILABLE_BUT_DEPRECATED) struct stat64 st; --=20 2.2.1 --------------040605070507090502030905-- --8X4v2jtevdvJB574GpRNdPpjw095xGQnI 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 iEYEARECAAYFAlSyZ4YACgkQvmGDOQUufZWzKgCfeee1oigmNxQisnhS2Y+90E95 kmEAoL2bIhd3F8CMnonRa/FsIfkPsRWG =PgHD -----END PGP SIGNATURE----- --8X4v2jtevdvJB574GpRNdPpjw095xGQnI--