Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 2 Mar 2014 14:16:40 +0100
From:      Dimitry Andric <dim@FreeBSD.org>
To:        "Justin T. Gibbs" <gibbs@FreeBSD.org>
Cc:        freebsd-toolchain@freebsd.org
Subject:   Re: ctfconvert broken for C++ objects?
Message-ID:  <FFB0AF4E-BC44-49E5-8272-930668363A52@FreeBSD.org>
In-Reply-To: <81C07491-7E51-4CF0-B257-88ED998EE2A0@FreeBSD.org>
References:  <216B816A-8ADA-438F-B834-8C386C5BC460@FreeBSD.org> <20140220172608.GA85526@freebsd.org> <81C07491-7E51-4CF0-B257-88ED998EE2A0@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--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 <gibbs@FreeBSD.org> wrote:
> On Feb 20, 2014, at 10:26 AM, Roman Divacky <rdivacky@freebsd.org> =
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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?FFB0AF4E-BC44-49E5-8272-930668363A52>