Plug-ins on Windows

Joern Rennecke amylaar@spamcop.net
Sun Jul 4 06:53:00 GMT 2010


Quoting Kyle Girard <kyle@kdmanalytics.com>:

> A generic linked-in plugin ability would definitely solve my
> plugin-on-windows problem.  From what I've been reading on this list it
> looks like I'm going to have to do some sort of similar hack to gcc to
> get my plugin working on windows at least in the short term.

I hacked GNU hello 1.3 a little to make it work as a linked-in GCC plugin,
thus bringing much needed mail reader funtionality to GCC.  Well, at least
on unix-like systems with mailboxes it does.

So during configuration, I added:
--enable-link-plugins=all
alternatively, it should be possible to specify a list, although I
haven't tested this.

When you've built your compiler, you can access the GNU hello functionality
via -fplugin / -fplugin-arg:

[amylaar@laria gcc]$ ./xgcc -B. -fplugin=hello -fplugin-arg-hello-h -x  
c /dev/null -c
This is GNU Hello, THE greeting printing program.
Usage: -fplugin=hello
{ -fplugin-arg-hello([h[elp]] | [t[raditional]] | [v[ersion]] | [m[ail]]) }
   h[elp]                        Print a summary of the options
   t[raditional]         Use traditional greeting format
   v[ersion]                     Print plugin version information
   m[ail]                        Print your mail
[amylaar@laria gcc]$ ./xgcc -B. -fplugin=hello  
-fplugin-arg-hello-sailor -x c /dev/null -c
Nothing happens here.

The attached patch still has some rough edges, like missing main gcc
ChangeLog, missing documentation, no dso building implemented (should  
eventually work both in-tree to be installed in the plugin dir and
out-of-tree with a previous built compiler).

I though it'd make sense to ask first if the patch so far goes in the  
right direction.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: link-plugin-diff.bz2
Type: application/x-bzip2
Size: 37885 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/20100704/f10763e8/attachment.bz2>


More information about the Gcc mailing list