This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PING][PR gcov-profile/43341] Make layout of gcov structures fixed
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: Alexander Monakov <amonakov at ispras dot ru>
- Cc: gcc-patches at gcc dot gnu dot org, Nathan Sidwell <nathan at codesourcery dot com>, Jan Hubicka <hubicka at ucw dot cz>
- Date: Wed, 5 May 2010 11:46:39 +0200
- Subject: Re: [PING][PR gcov-profile/43341] Make layout of gcov structures fixed
- References: <alpine.LNX.2.00.1004222128210.308@monoid.intra.ispras.ru> <alpine.LNX.2.00.1005051318190.11133@monoid.intra.ispras.ru>
Hi,
> Programs with object files with non-default structure packing at the end of
> the TU segfault on 64-bit architectures with -fprofile-generate because the
> layout of runtime-generated gcov structures does not match the layout of the
> same structures in libgcov.
So the problem is that you compile libgcov with default setting but the object
files you link with with something like -fpack-all-structures-you-can-see
(and ABI breaking flag I believe we can have)?
>
> This patch shuffles the fields of the affected structures so that they can be
> packed without holes and sets 'packed' and 'aligned(sizeof(void*))' attributes
> on them.
This will break bootstrap with non-GCC compiler since gcov-io.h is included to
GCC sources. So at last we need to add some macros to avoid this being used
when buiding GCC.
This will break compatibility to old libgcov builds, but we do that from time
to time, so it seems to make sense, if there are no complains.
Honza