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

Hugo.Mildenberger at web.de Hugo.Mildenberger at web.de
Mon Mar 4 05:01:53 EST 2013


Starting with odb-2.2.*, the 'odb.so' plugin gets installed into '/usr/libexec/odb/odb.so'. This is much better than installing into /usr/bin, but the odb plugin still depends on the version of gcc it was compiled with. So, if you switch between gcc versions, the plugin does not match the compiler version. On Gentoo at least, plugins can be installed into '/usr/libexec/gcc/<os>/<gcc-version>/plugin/', which should solve this problem because gcc then selects the right path depending on its own version.

http://gcc.gnu.org/onlinedocs/gccint/Plugins-loading.html#Plugins-loading says:
 
  A plugin can be simply given by its short name (no dots or slashes). When simply passing 
  -fplugin=name, the plugin is loaded from the  plugin directory, so -fplugin=name is the same 
  as -fplugin=`gcc -print-file-name=plugin`/name.so, using backquote shell syntax to query 
  the plugin directory.

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

$ sudo gcc-config x86_64-pc-linux-gnu-4.6.3
 * Switching native-compiler to x86_64-pc-linux-gnu-4.6.3 ...

$ source /etc/profile

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




More information about the odb-users mailing list