This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: libsanitizer merge from upstream r191666


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]