This is the mail archive of the gcc@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: compiler rebuild invalidates precompiled header


"Jan Beulich" <JBeulich@novell.com> writes:

> Trying to run the libstdc++ testsuite after a couple of rebuilds to the
> compiler all I got was internal compiler errors for each and every
> compiled file. Investigating this, I had to learn that the precompiled
> header stores not just configuration values, but also pointers created
> during the previous build (e.g. into the compiler image itself). This
> would be fine, if the precompiled header would be considered invalid by
> a compiler build different from the one that created it. That, however,
> is not done, and what I'm trying to find out is whether this is
> intentional (in which case I'd consider precompiled headers useless for
> anyone trying to work on the compiler itself), and if so if there is any
> suggested workaround for this (other than manually deleting the
> precompiled headers each time the compiler gets rebuilt).
> Obviously, I'd consider this a bug with the suggested solution of
> adding a timestamp (or even better a random value of good quality) to
> the compiler that it then stores into the precompiled header and
> verifies when it loads it).

The PCH machinery checks that the version string is the same.  This is
good enough for released builds and for snapshots.  If you're actually
working on the compiler, the Makefiles should ensure that PCH files
are rebuilt; if they're not doing this, that's a bug, please make a
patch.

It would be possible to have more complicated machinery that makes a
checksum of the compiler executable, but it doesn't seem worth it if
the alternative is just fixing a Makefile (and you would have to do
that anyway).

-- 
- Geoffrey Keating <geoffk@geoffk.org>


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