On 30/06/2010 21:38, Kyle Girard wrote:
> Hello,
> 
> I am playing around with a plug-in for gcc but recently ran into the
> road block that plug-ins aren't supported on Windows.  Are there any
> plans to add support for the windows platform in the future?  If not,
> what are the issues with supporting Windows and how much effort would it
> be to add support?  I'm assuming that since it's not done already there
> has to be some difficulty somewhere...

  The main problem is that plugins rely on the property of the ELF format that
you can leave undefined references in a shared library and have them filled in
by symbols exported from the main exe at runtime; they use this to call the
various functions exported from GCC, like register_callback, and to access
global variables and so on.

  Although we could build plugins as Windows DLLs and have GCC load them at
runtime, if those DLLs needed to refer to anything in the main GCC executable,
it would have to be specifically linked to import it - and imports on Windows
have to explicitly specify the name of the DLL (or executable) they are
imported from.  That means that the plugin would need to explicitly refer to
cc1.exe or cc1plus.exe, etc; we'd need to build separate versions of the
plugin for each of the different GCC language compilers.

  (Long term, we might be able to extend the toolchain and libltdl to
co-operate to do this kind of deferred runtime linking for us, but that's not
imminent.)

> Would it be a lot faster/easier to create a custom gcc that
> has my plug-in compiled in directly for the windows platform?

  Yes, much!  At least for the foreseeable future.  Sorry.

    cheers,
      DaveK

Reply via email to