make-alpha
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Handling of SHELL by GNU make: not POSIX compliant


From: David Boyce
Subject: Re: Handling of SHELL by GNU make: not POSIX compliant
Date: Tue, 08 Oct 2002 11:20:40 -0400

At 09:56 AM 10/8/2002 -0400, Paul D. Smith wrote:
Have you looked at the proof-of-concept for this that Han-Wen Nienhuys
developed?  We talked about it a bit on make-alpha a few years ago and
he whipped up a very early sample--works only on Linux.  There's a link
at the bottom of my "Advanced Auto-Dependencies" web page:

  http://make.paulandlesley.org/autodep.html

As a matter of fact I just ran across this URL a couple of days ago and noticed the reference to his implementation. Unfortunately the link 404's. I'd love to look at it, so if anyone know where it went to please let me know. And if there are other tools in the same space I'd be happy to hear of them too, of course. I've looked into truss (that's SVR4/Solaris only), LD_AUDIT (same thing), strace (my understanding is this slows down processes quite a bit, it would be analogous to running your builds under control of a debugger).

Pros for the LD_PRELOAD technique appear to be that (a) it's relatively portable and (b) it's cheap. I've been building Perl 5.8.0 with my auditor turned on for a stress test and it seems to cost only a few percentage points over the unaudited build. This is for the raw list of files opened: if you were going to generate checksums for them it would take whatever time checksums take but that's orthogonal. Cons for LD_PRELOAD include (a) it won't audit a statically-linked binary, but those are pretty rare nowadays and I believe I can at least give a "Warning: unable to audit static binary 'foo'" message in that case, (b) it won't audit anything that uses syscall() directly; I don't think this is a significant concern and (c) since it's hooking into an undocumented user-space layer there's no way to be absolutely sure I've captured all the entry points which are capable of opening files. I think this last just requires some trial and error. For a few minutes I thought I couldn't handle mmap-ed files but then I realized mmap() takes a file descriptor which would have to have been gotten via open() anyway.

It currently works (where "works" is defined as "passes my suite of exactly 1 test") on Linux and Solaris. I believe the LD_PRELOAD concept is portable to modern versions of HPUX and AIX as well, though I haven't tried and shared library implementations are pretty different there. I'm sure it will *not* be portable to many more marginal and/or older Unix implementations. On Windows there are equivalent ways of intercepting system calls and I haven't ruled out playing with them but it would be a completely orthogonal piece of code.

If this discussion should come off the list just let me know.

-David





reply via email to

[Prev in Thread] Current Thread [Next in Thread]