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: PR/15448: add a compiler timestamp to PCH files


Paolo Bonzini <paolo.bonzini@lu.unisi.ch> writes:

> > I don't see how the current PCH implementation could work with PIE, so
> > I don't think this matters.  If somebody fixes PCH to work with PIE,
> > then it should be straightforward to extend that fix to improve this
> > algorithm for detecting an incompatible compiler version.
> 
> The thing I don't like about that approach is that doing the check in
> gt_pch_restore would be too late to stop using the PCH, and we would
> have to fail with a hard error.  But I guess that the case is rare
> enough that it can be tolerated.

I assume here you are talking about the case where PCH has been
modified to work with PIE.  Since I think that case will require
pointer swizzling, I think that the resulting PCH will almost always
work.  The cases where it would fail would be where basic structures
changed.  So you could put in a hash on structure types (which could
perhaps be done by the GC machinery, if it is not already done), or
just be disciplined and increase the PCH version number each time you
change a relevant structure.

Ian


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