[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
Tue Mar 5 06:53:35 EST 2013


Hi Boris,

   On Mon, 4 Mar 2013 14:48:45 +0200
   Boris Kolpackov <boris at codesynthesis.com> wrote:

   > > A plugin can be simply given by its short name (no dots or slashes).
   > 
   > This functionality was added in GCC 4.6 and is not available in 4.5.

We live in a complicated world. So http://gcc.gnu.org/onlinedocs/gcc-4.5.1/gccint/Plugins.html, when saying  

	"On most systems, you can query this plugin directory by invoking 
         gcc -print-file-name=plugin (replace if needed gcc with the appropriate 
	 program path)."

is wrong? The earliest available gcc-4.5 version is 4.5.1-r1 on my system. Passing -print-file-name=plugin works: 
	
	$ sudo gcc-config  x86_64-pc-linux-gnu-4.5.1
 	* Switching native-compiler to x86_64-pc-linux-gnu-4.5.1 ...

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

   > Because of that and also because ODB can be installed into a separate  
   > --prefix compared to GCC, I don't think it would be a good idea to
   > install the plugin into the GCC sub-directory by default. So we could
   > have a configure option like --default-plugin-dir.

Sounds good. BTW, don't forget to update the error message informing the user that he should install the plugin into the same directory as odb (list the actual search path instead.) 

   > 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. If it's not cross-compilation, maybe one could extract this information by comparison of the results of '-print-filename=gcc' and '-print-sysroot' ?

  $ echo "gcc='$(gcc -print-file-name=gcc)'"
  gcc='/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.2/../../../../lib64/gcc'

  $ echo "sysroot='$(gcc -print-sysroot)'"
  sysroot=''

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.) So, with cross-compilation, I'd think the plugin needs to be installed relative to the compiler determined by the '--host' configure option (an outline of the terminology is at http://gcc.gnu.org/onlinedocs/gccint/Configure-Terms.html.)



Hugo
  



More information about the odb-users mailing list