From owner-freebsd-toolchain@FreeBSD.ORG Sun Mar 2 13:26:21 2014 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 12000B08; Sun, 2 Mar 2014 13:26:21 +0000 (UTC) Received: from tensor.andric.com (tensor.andric.com [IPv6:2001:7b8:3a7:1:2d0:b7ff:fea0:8c26]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 92DB61139; Sun, 2 Mar 2014 13:26:20 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7::102d:ec60:fc74:8c90] (unknown [IPv6:2001:7b8:3a7:0:102d:ec60:fc74:8c90]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 67B0F5C45; Sun, 2 Mar 2014 14:16:47 +0100 (CET) Content-Type: multipart/signed; boundary="Apple-Mail=_CA67A0B3-1E8D-4622-BEA0-5F9531396F47"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: ctfconvert broken for C++ objects? From: Dimitry Andric In-Reply-To: <81C07491-7E51-4CF0-B257-88ED998EE2A0@FreeBSD.org> Date: Sun, 2 Mar 2014 14:16:40 +0100 Message-Id: References: <216B816A-8ADA-438F-B834-8C386C5BC460@FreeBSD.org> <20140220172608.GA85526@freebsd.org> <81C07491-7E51-4CF0-B257-88ED998EE2A0@FreeBSD.org> To: "Justin T. Gibbs" X-Mailer: Apple Mail (2.1874) Cc: freebsd-toolchain@freebsd.org X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Mar 2014 13:26:21 -0000 --Apple-Mail=_CA67A0B3-1E8D-4622-BEA0-5F9531396F47 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 On 21 Feb 2014, at 23:47, Justin T. Gibbs wrote: > On Feb 20, 2014, at 10:26 AM, Roman Divacky = wrote: >=20 >> The dwarf backend for ctfconvert was completely reimplemented a few = weeks ago. >> It's now based on elftoolchain libdwarf. >>=20 >> Test on current. >=20 > The failures I=92ve experienced occur when attempting to ctfconvert = the C++ code in the base (e.g. ATF or devd). You can replicate the = failures on head by applying the share/mk patch below (a version of my = previous patch rebased on head). I've just tried your patch, building devd, and it seemed to have worked just fine (though I had to use DEBUG_FLAGS=3D-g, otherwise ctfconvert would complain there was no type data to convert): $ make WITH_CTF=3Dx DEBUG_FLAGS=3D-g c++ -O2 -pipe -I. -I/usr/src/sbin/devd -g -Qunused-arguments = -fstack-protector -Wsystem-headers -Werror -Wall -Wno-format-y2k -W = -Wno-unused-parameter -Wpointer-arith -Wno-uninitialized -Wno-empty-body = -Wno-string-plus-int -Wno-unused-const-variable = -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality = -Wno-unused-function -Wno-enum-conversion -g -Wno-c++11-extensions -c = /usr/src/sbin/devd/devd.cc cc -O2 -pipe -I. -I/usr/src/sbin/devd -g -std=3Dgnu99 = -Qunused-arguments -fstack-protector -Wsystem-headers -Werror -Wall = -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes = -Wmissing-prototypes -Wpointer-arith -Wno-uninitialized = -Wno-pointer-sign -Wno-empty-body -Wno-string-plus-int = -Wno-unused-const-variable -Wno-tautological-compare -Wno-unused-value = -Wno-parentheses-equality -Wno-unused-function -Wno-enum-conversion -c = token.c ctfconvert -L VERSION -g token.o cc -O2 -pipe -I. -I/usr/src/sbin/devd -g -std=3Dgnu99 = -Qunused-arguments -fstack-protector -Wsystem-headers -Werror -Wall = -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes = -Wmissing-prototypes -Wpointer-arith -Wno-uninitialized = -Wno-pointer-sign -Wno-empty-body -Wno-string-plus-int = -Wno-unused-const-variable -Wno-tautological-compare -Wno-unused-value = -Wno-parentheses-equality -Wno-unused-function -Wno-enum-conversion -c = parse.c ctfconvert -L VERSION -g parse.o c++ -O2 -pipe -I. -I/usr/src/sbin/devd -g -Qunused-arguments = -fstack-protector -Wsystem-headers -Werror -Wall -Wno-format-y2k -W = -Wno-unused-parameter -Wpointer-arith -Wno-uninitialized -Wno-empty-body = -Wno-string-plus-int -Wno-unused-const-variable = -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality = -Wno-unused-function -Wno-enum-conversion -g -Wno-c++11-extensions = -static -o devd devd.o token.o parse.o -ll -lutil ctfmerge -L VERSION -g -o devd devd.o token.o parse.o gzip -cn /usr/src/sbin/devd/devd.8 > devd.8.gz gzip -cn /usr/src/sbin/devd/devd.conf.5 > devd.conf.5.gz $ ctfdump -S /usr/obj/usr/src/sbin/devd/devd - CTF Statistics = ------------------------------------------------------------- total number of data objects =3D 627 total number of functions =3D 31 total number of function arguments =3D 25 maximum argument list length =3D 2 average argument list length =3D 0.81 total number of types =3D 97 total number of integers =3D 9 total number of floats =3D 0 total number of pointers =3D 24 total number of arrays =3D 16 total number of func types =3D 6 total number of structs =3D 7 total number of unions =3D 2 total number of enums =3D 0 total number of forward tags =3D 4 total number of typedefs =3D 25 total number of volatile types =3D 0 total number of const types =3D 4 total number of restrict types =3D 0 total number of unknowns (holes) =3D 0 total number of struct members =3D 64 maximum number of struct members =3D 25 total size of all structs =3D 3492 maximum size of a struct =3D 3156 average number of struct members =3D 9.14 average size of a struct =3D 498.86 total number of union members =3D 6 maximum number of union members =3D 4 total size of all unions =3D 132 maximum size of a union =3D 128 average number of union members =3D 3.00 average size of a union =3D 66.00 total number of enum members =3D 0 maximum number of enum members =3D 0 total number of unique strings =3D 112 bytes of string data =3D 1051 maximum string length =3D 26 average string length =3D 9.38 > On a slightly related node, do you know why there is a FreeBSD version = ranged exclusion around bootstrapping the dtrace tools? >=20 > =46rom src/Makefile.inc1: > # dtrace tools are required for older bootstrap env and cross-build = =20 > .if ${MK_CDDL} !=3D "no" && \ = =20 > ((${BOOTSTRAPPING} < 1000034 && \ = =20 > !(${BOOTSTRAPPING} >=3D 901505 && ${BOOTSTRAPPING} < 999999)) = \ =20 > || (${MACHINE} !=3D ${TARGET} || ${MACHINE_ARCH} !=3D = ${TARGET_ARCH})) =20 > _dtrace_tools=3D cddl/usr.bin/sgsmsg cddl/lib/libctf lib/libelf \ = =20 > lib/libdwarf cddl/usr.bin/ctfconvert cddl/usr.bin/ctfmerge = =20 > .endif This was last changed by Brooks in r251689: "Be more agressive about bootstrapping ctfmerge and ctfconvert so builds from existing releases have a chance of working properly". The range check was modified from: ((${BOOTSTRAPPING} < 800038 && !(${BOOTSTRAPPING} >=3D 700112 && = ${BOOTSTRAPPING} < 799999)) to: ((${BOOTSTRAPPING} < 1000034 && !(${BOOTSTRAPPING} >=3D 901505 && = ${BOOTSTRAPPING} < 999999)) but maybe the 9.x range check is now too narrow? -Dimitry --Apple-Mail=_CA67A0B3-1E8D-4622-BEA0-5F9531396F47 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) iEYEARECAAYFAlMTLzwACgkQsF6jCi4glqOr8gCgne9nXvswgZZZexix7Vy/flYn O2oAoJ1WebZhoDeHna8a+QkYkqFIbKGF =7shc -----END PGP SIGNATURE----- --Apple-Mail=_CA67A0B3-1E8D-4622-BEA0-5F9531396F47--