This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: compiler rebuild invalidates precompiled header
Geoff Keating <geoffk@desire.geoffk.org> writes:
> > Date: Mon, 17 May 2004 11:33:03 -0700
> > From: Mike Stump <mrs@apple.com>
>
> > That said, maybe we could bury the mod time of the compiler binary into
> > the PCH file. This avoids cksumming the .text segment or some other
> > change like that and is fairly sensitive to _any_ changes. Maybe the
> > driver, since it stats the file anyway, could pass that mod time of the
> > stat into the compiler on the command line and the compiler could write
> > that out to the PCH file and validate upon reading.
>
> I thought of that at the time. The problem is that it's too
> sensitive; modification times can change for many reasons (like NFS
> time skew, or copying a file from one place to another).
Check a few function addresses other than pch_init(). In particular,
check the address of some functions in libiberty. They will normally
follow all of the regular gcc functions in the executable, and are
those more likely to be perturbed by changes. pch_init() is in
c-pch.c which precedes libbackend.a and thus its address will normally
not change when any backend object file changes.
Ian