[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 25 06:15:47 EDT 2013


Hi Boris,


  Boris Kolpackov <boris at codesynthesis.com> wrote:
  > Ok, I've implemented support for installing the ODB plugin into the
  > default GCC plugin directory. Everything works pretty much exactly
  > as discussed in our prior exchange. Here is the patch:
  > 
  > http://scm.codesynthesis.com/?p=odb/odb.git;a=patch;h=a2dee162af41c80827ff60d87c08ea981b55b31b
  > 
  > Please give it a try and let me know if there are any issues.

Looks good! I gather that the installer has to set "--with-gcc-plugin-dir" in order make use of this feature.  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. Good!

  > 
  > 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. If you actually need to support different GCC versions by different code in the plugin itself, then factoring out GCC version specifics is certainly a reasonable approach, also with regard to maintainability. I found it often very hard to read and understand what #ifdef'ed code really does after all. 

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.


Hugo



More information about the odb-users mailing list