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 code is intended to check whether a PCH is being loaded by a
different instance of the compiler.  See c_common_valid_pch().
However, the current test is fairly simple--it just checks whether the
address of the function pch_init() is the same.  That is probably a
safe enough check for released versions of gcc, but it is not very
safe for developers rebuilding the compiler after minor patches.

Ian


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