This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: libsanitizer merge from upstream r191666
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Evgeniy Stepanov <eugeni dot stepanov at gmail dot com>
- Cc: Peter Bergner <bergner at vnet dot ibm dot com>, Konstantin Serebryany <konstantin dot s dot serebryany at gmail dot com>, Jack Howarth <howarth at bromo dot med dot uc dot edu>, Alexander Potapenko <glider at google dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>, Dodji Seketeli <dodji at redhat dot com>, Dmitry Vyukov <dvyukov at google dot com>, Bill Schmidt <wschmidt at zalov dot cz>
- Date: Tue, 5 Nov 2013 19:45:31 +0100
- Subject: Re: libsanitizer merge from upstream r191666
- Authentication-results: sourceware.org; auth=none
- References: <20131030070317 dot GA27813 at tucnak dot zalov dot cz> <CAGQ9bdz1FMOngnBBmuCU4UqyTNh_jvRr0=_psZMjCpoQj6zBiQ at mail dot gmail dot com> <20131102172515 dot GA13302 at bromo dot med dot uc dot edu> <CAGQ9bdyaNob-Q_e0_YAhM9NUX3gLpj7eHD5JXfamKNGOXqa5iw at mail dot gmail dot com> <1383611584 dot 5700 dot 45 dot camel at otta> <CAGQ9bdyEu_io7ReR2HBbRdJQeHCtfidGVr85Fx4uZaS0XhCRGA at mail dot gmail dot com> <20131105071912 dot GD27813 at tucnak dot zalov dot cz> <1383667034 dot 5700 dot 54 dot camel at otta> <1383674821 dot 5700 dot 57 dot camel at otta> <CABMLtrhAiLybgf422PvRiWA8oXk-_qFnVa9ZdYnSh6p1gLsz-g at mail dot gmail dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Tue, Nov 05, 2013 at 10:17:09AM -0800, Evgeniy Stepanov wrote:
> On Tue, Nov 5, 2013 at 10:07 AM, Peter Bergner <bergner@vnet.ibm.com> wrote:
> > On Tue, 2013-11-05 at 09:57 -0600, Peter Bergner wrote:
> >> On Tue, 2013-11-05 at 08:19 +0100, Jakub Jelinek wrote:
> >> > Note, not even glibc itself includes <asm/stat.h>, so the chances of that
> >> > header actually working for you are low. glibc instead just defines the
> >> > structures itself for each of the architectures.
> >>
> >> I have to agree, including kernel header files is always frowned upon
> >> and very risky. Jakub, do you think we should be doing the same thing
> >> here that glibc does, namely having libsanitizer defining its own
> >> structures?
> >
> > One other problem is the use of __old_kernel_stat in the libsanitizer
> > sources. The PPC64 kernel was created after the change to the current
> > stat, so it doesn't define __old_kernel_stat since it never had one.
>
> In fact, we do define our own structures. Kernel headers are limited
> to one or two files just to verify that our definitions are binary
> compatible.
>
> __old_kernel_stat issue must be solvable with a reasonable amount of #ifdefs.
Perhaps that verification should be done instead just by testing this,
say by calling both libasan stat* and corresponding glibc stat* on the same
files and comparing? You can do the latter through say dlsym/dlvsym.
Some kernel headers are really better to be avoided, because, as you could
already partly see now or in the past, some of them were never really
properly tested to be usable from userland, or at least not in every distro
and it's version out there. Kernel headers used by glibc itself internally
have a higher chance of working than others.
Jakub