[odb-users] odb-2.2.1 should install the odb.so plugin into $(gcc -print-file-name=plugin)

Boris Kolpackov boris at codesynthesis.com
Tue Mar 5 09:13:51 EST 2013


Hi Hugo,

Hugo.Mildenberger at web.de <Hugo.Mildenberger at web.de> writes:

> 	$ gcc --print-file-name=plugin
> 	/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.1/plugin

In GCC 4.5 this is the path where the plugin headers are installed (in
the include/ subdirectory). The code to load plugins from this directory
is just not there in GCC 4.5 (see gcc/plugin.c).


>    > On the other hand, if GCC is >=4.6 and ODB and GCC prefixes are the
>    > same, then I don't see any harm installing the plugin into GCC by
>    > default. The problem is there doesn't seem to be an easy way to
>    > figure out GCC's prefix.
> 
> I'm not sure what you have in mind here.

I mean if both ODB and GCC were built with the same --prefix, then it
makes sense to install the ODB plugin into the GCC's plugin directory
by default.


> If it's not cross-compilation [...]

Good point. If cross-compiling, we may not even be able to run host
GCC to detect any paths, including the plugin path (i.e.,
-print-file-name=plugin). This complicates things significantly.
Perhaps we should keep it simple and just provide an option that
can be used to specify the alternative plugin installation directory.


> It is my understanding that ODB acts more like a filter, in so far that ODB
> generates source code later to be processed by a C++ compiler (which does
> not need to be gcc, in principle at least.)

That's correct.


> So, with cross-compilation, I'd think the plugin needs to be installed
> relative to the compiler determined by the '--host' configure option

Yes, I agree. The thing is we may not be able to run this host GCC to
determine the plugin installation directory.

In fact, even with plugin headers, strictly speaking, things are broken
right now because we use build GCC (which may not even be built with
plugin support) instead of host GCC.

Boris



More information about the odb-users mailing list