> 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). >
Well, I definitely owe you some beer. The gcc I am using isn't trunk but the majority of the changes applied cleanly. I had to back port some changes from trunk to my version and do a little extra hack or two to get it to work on Windows but it works like a charm! On Windows, when you configure gcc it doesn't set ENABLE_PLUGIN because dynamically linked plugins are (rightfully so) unsupported and LINK_PLUGIN_NAMES doesn't get set by configure. Therefore I had to add LINK_PLUGIN_NAMES define to the compile options for opts.o in the gcc/Makefile.in. The exact same options your patch added for plugin.o, after that and fixing a missing return type and semi colon in plugin.c everything works like a charm. You definitely saved me quite a bit of time thanks again! I think if this patch was polished up it could be at least a short term solution for plugin support on Windows. Plus it's a cool feature on other platforms as well. Cheers, Kyle