Plugin development under windows

David Malcolm
Mon Mar 27 14:09:00 GMT 2017

On Mon, 2017-03-27 at 11:18 +0000, Davide Piombo wrote:
> Hello,
> I'm interested in developing a plugin to parse some custom annotation
> in C+=
> + code.
> I already developed a preliminary version of this plugin under linux
> and it=  works fine.


> The final platform target of the plugin is (unfortunately ;-))
> Windows and = I tried to rebuild the plugin using MinGW compiler
> (both with
> the Linux ver= sion as well by using MSYS2 and win-builds MinGW
> compilers for windows) but=  the lack of POSIX includes breaks the
> build.

(FWIW I've worked a lot with gcc plugins, but not on Windows).

You say "the lack of POSIX includes breaks the build".
Can you give more specifics on what goes wrong?  Maybe someone here can
figure out a good workaround/bugfix.

Sorry if I'm being obtuse here, but you say "the final platform target
of the plugin is...Windows" - does that mean that
 - the compiler (and thus the plugin within it) are going to run on
Windows, and generate code for some (other?) system or that 
  - the compiler+plugin are going to run on some (other?) system, and
generate code intended to run on Windows?

(AIUI the former case would mean that Windows is the *host*, the latter
that it's the *target*).

I believe that compiler plugins needs to be built using the same build,
host and target configuration triplets as the compiler they're going to
be embedded in was built with.

> I looked around the documentation but I didn't find any reference
> regarding=  the use of GCC plugins under windows.
> I only found some old posts on some forums saying  that it is
> possible to d= o that and that exist some old gcc versions (custom
> windows rebuild of GCC =
> 4.6.1 to use dragonegg as plugin) that can run plugins.
> Substantially I'm writing just to ask:
> Can GCC plugins run on a windows build of GCC compiler (MinGW) ?

I suspect the answer is "you're the first person to try this in a
while; some things may need fixing" - but that's a guess :)

> If it is possible to do that, which is the correct way to build the
> plugin?

Good luck; I hope this is constructive.

More information about the Gcc mailing list