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

Boris Kolpackov boris at codesynthesis.com
Mon Mar 25 08:00:37 EDT 2013


Hi Hugo,

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

> I gather that the installer has to set "--with-gcc-plugin-dir" in order
> make use of this feature.

No, if GCC and ODB prefixes match (which will most definitely be the case
in your situation), then ODB will install the plugin into the GCC directory
automatically. If you specify --with-gcc-plugin-dir, then you force ODB
to install the plugin into the GCC directory regardless of the prefix.


> Yet, in order to make this change fully functional, I also need to tie
> the ODB installer to a Gentoo slot (a major ODB version, for all practical
> means), because else Portage removes the "old" version while installing
> the recompiled package. However, when emulating slots manually, I can
> now switch back and forth between compilers.

I am not sure I 100% understand what you mean by this but I think I
disagree. You don't need slots for the ODB compiler itself. You just
need to install a separate ODB plugin for each supported version of
GCC and single /usr/bin/odb will load the right one depending on the
version of GCC that is currently in effect.


>   > On a related note, this got me thinking that if one wants to support
>   > multiple versions of GCC, then the ODB compiler will probably have
>   > to be split into two packages: the ODB compiler driver (/usr/bin/odb
>   > plus documentation) and ODB plugin (odb.so, one for each GCC version).
> 
> This is what I naively assumed to be given in the first place, that the 
> GCC plugin actually was independent from the compiler driver.

It is. More precisely, the ODB compiler driver does not depend on the GCC
version. So you can have multiple plugins (one for each version of GCC
installed) and a single driver (/usr/bin/odb) and it will all work
automatically. I.e., you can do:

odb -x g++-4.5 ... # Load plugin for GCC 4.5
odb -x g++-4.6 ... # Load plugin for GCC 4.6
odb -x g++-4.7 ... # Load plugin for GCC 4.7


> Yet I still think that if you want to have different ODB (plugin/compiler)
> versions installed in parallel, you actually need to encode at least the
> plugin version into the plugin file name.

Yes, if one day we decide we want to support this, we can do that. Though
it sounds to me like the same approach that you will use to save/restore 
/usr/bin/odb can also be used to save/restore odb.so.

Boris



More information about the odb-users mailing list