On Tue, 2010-06-29 at 12:50 -0400, Diego Novillo wrote:
> On Tue, Jun 29, 2010 at 12:35, Basile Starynkevitch
> <bas...@starynkevitch.net> wrote:
> 
> > I agree, but a plugin could also do likewise, e.g. write memory contents
> > in some kind of persistent storage.
> 
> Why don't we cross that bridge when we get to it? 

[I am not sure to understand the above sentence. What is the bridge?
What is crossing it? Remember that I am not a native English speaker]

>  It seems odd to me
> that a plugin would want to wind itself very tightly around a specific
> lto1 binary.  I am not seeing an advantage to that kind of
> requirement.
> 

Well, taking the example previously given (a plugin implementing ccache
behavior, and perhaps caching & potentially reusing the translation of
most individual functions in some external database), I would believe it
will help a lot, for exactly the same reasons PCH wanted to have
executable_checksum & use it.
 
> In fact, I'd love to have a PCH implementation that does not need to
> tie itself to a specific binary.

I could agree in principle, however it would be much much more
inconvenient if PCH crashed GCC because a gcc-4.5.1 reloaded a PCH
produced by a gcc-4.5.0. Outputting a fatal incompatibility message is
much more acceptable than crashing (or giving wrong results), and I am
not sure we could guarantee that. (And I am not sure that LTO data
produced by gcc-4.5.0 can be used with gcc-4.5.1 or gcc-4.6.0, but I
really don't know).

All data produced by GCC (including its plugins) can be regenerated by
recompiling source code. I prefer the safety of incompatibility [which
is quite easy to implement] to the risk of crashing.

Besides, unless I am mistaken, we did state that a plugin shared object
is tied to a specific GCC version (so a plugin.so built for gcc-4.5.0
will not always work for gcc-4.5.1 without being recompiled) and I would
naturally extend that "requirement" to data stored by plugins (or even
to LTO or PCH data if needed). If we do make that extension, having some
simple machinery to help that requirement could be useful.  

The main "data" which is reusable from one version of GCC to the next is
the object *.o files produced by GCC (& processed by the linker), but
this is possible because there are tons of conventions & specifications
& formalizations of what exactly such object files contain (and dozens
of years of past experiments). We don't have such precise & experimented
definitions for other data produced by GCC or plugins (e.g. LTO or PCH
or an hypothetical ccache-like plugin data).

Cheers.
-- 
Basile STARYNKEVITCH         http://starynkevitch.net/Basile/
email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359
8, rue de la Faiencerie, 92340 Bourg La Reine, France
*** opinions {are only mines, sont seulement les miennes} ***


Reply via email to