Writing a plugin requires use of a range of headers (such as gcc-plugin.h) which are not installed. Here is an example: $ /opt/gccsvn/bin/gcc -v --save-temps -Dmy_gcc_plugin_EXPORTS -fPIC -o dumb_plugin-orig.c.o -c dumb_plugin-orig.c Using built-in specs. Target: x86_64-unknown-linux-gnu Configured with: /home/bradh/devel/gcc-svn/configure --prefix=/opt/gccsvn --enable-plugins : (reconfigured) /home/bradh/devel/gcc-svn/configure --prefix=/opt/gccsvn --enable-plugins : (reconfigured) /home/bradh/devel/gcc-svn/configure --prefix=/opt/gccsvn --enable-plugins : (reconfigured) /home/bradh/devel/gcc-svn/configure --prefix=/opt/gccsvn --enable-plugins Thread model: posix gcc version 4.5.0 20090502 (experimental) (GCC) COLLECT_GCC_OPTIONS='-v' '-save-temps' '-Dmy_gcc_plugin_EXPORTS' '-fPIC' '-o' 'dumb_plugin-orig.c.o' '-c' '-mtune=generic' /opt/gccsvn/libexec/gcc/x86_64-unknown-linux-gnu/4.5.0/cc1 -E -quiet -v -Dmy_gcc_plugin_EXPORTS dumb_plugin-orig.c -mtune=generic -fPIC -fpch-preprocess -o dumb_plugin-orig.i ignoring nonexistent directory "/opt/gccsvn/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/../../../../x86_64-unknown-linux-gnu/include" #include "..." search starts here: #include <...> search starts here: /usr/local/include /opt/gccsvn/include /opt/gccsvn/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/include /opt/gccsvn/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/include-fixed /usr/include End of search list. dumb_plugin-orig.c:1: fatal error: gcc-plugin.h: No such file or directory compilation terminated.
Created attachment 17791 [details] .i of trivial example Source was only one line: #include "gcc-plugin.h"
Subject: Re: New: gcc does not install appropriate plugin headers On Sat, 2 May 2009, bradh at frogmouth dot net wrote: > Writing a plugin requires use of a range of headers (such as gcc-plugin.h) > which are not installed. Here is an example: > > $ /opt/gccsvn/bin/gcc -v --save-temps -Dmy_gcc_plugin_EXPORTS -fPIC -o > dumb_plugin-orig.c.o -c dumb_plugin-orig.c You'd need to use a -I option pointing to the plugin headers install directory anyway; they aren't going to be installed in the default search path, since they are headers for the host, not the target, and depend on the exact GCC configuration, and multiple differently configured copies of GCC for different targets can be installed in the same prefix. But it doesn't look like the patch to install plugin headers under libsubdir/plugin/include has yet been reviewed/approved.
Looks like the install is now dealing with this.