Tom Tromey wrote:
"Taras" == Taras Glek <[EMAIL PROTECTED]> writes:

Tom> LD_PRELOAD would work just as well as having gcc directly support
Tom> plugins, provided that certain internal things are never made
Tom> file-local.  Someone could write a helper library to make it
Tom> relatively simple to hook in.  But... I looked at this recently, and
Tom> since gcc is not linked with -rdynamic, it is a non-starter.

Taras> Tom, I don't know much about linkers and LD_PRELOAD. Would making
Taras> LD_PRELOAD work be easier than making an unstable plugin API?

Not really.

The difference would be that with LD_PRELOAD the gcc change would be
very small -- just linking with -rdynamic.  Maybe you could lobby a
Linux distro for this :-)


I'm not fully convinced that just LD_PRELOAD is enough to add poor man's plugin into GCC.

Plugins into GCC are expected to add optimisation passes (see file gcc/passes.c function init_optimization_passes and I don't understand what exactly LD_PRELOAD trick (unless you also redefine this very function init_optimization_passes in your ld_preload-ed plugin) would enable this.

So Tom or Taras, could you please elaborate on this? What tricks are you thinking of?

However, you are right in the sense that implementing naive plugins is technically easy; apparently the issue is political, not technical (i.e. let RMS accept or bless it).

--
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