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: Better initial PCH validity checking


On Tue, Oct 21, 2003 at 04:46:29PM -0700, Geoff Keating wrote:
> 
> On Oct 21, 2003, at 4:34 PM, Syd Polk wrote:
> 
> >
> >On Oct 21, 2003, at 4:27 PM, Geoffrey Keating wrote:
> >
> >>
> >>This patch improves the PCH validity checking.  It puts in an initial
> >>check that the host, target, and GCC version number are consistent.
> >>It's a preliminary step towards fixing some of the other PCH validity
> >>checking issues (like -fpic on x86), plus the error messages are nicer
> >>than before.
> >>
> >>Some notes:
> >>- I didn't check the build system.  Maybe later, if anyone finds it's
> >>  a problem.
> >>- I believe that at least the first few bytes of the structure are the
> >>  same on every system on which GCC is hosted; if not, we should move
> >>  to an array of unsigned char.
> >>- The string that's checked is the canonical host or target name.
> >>- Really, the thing that should be checked is something like the
> >>  checksum of the actual cc1 or cc1plus binary.  This should be good
> >>  enough for the moment, though.
> >
> >The problem with this approach is things like prebinding which touch 
> >the binaries. The check sum will have to ignore those sections that 
> >prebinding touches.
> 
> I was thinking that you'd compute the checksum once, at build time; 
> it'd be horribly inefficient to compute it every time GCC was started.  
> The difficulty is in rearranging the Makefiles to do this; what you 
> want to do is link each executable with a dummy checksum, then compute 
> the checksum, then link it again.
> 
> Hmmm.  Now that I say that, it's not *that* hard...

Or you can be even simpler; checksum the object files.  That's more
than enough precision for this purpose.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


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