c-shared support for Windows in Go 1.5?

503 views
Skip to first unread message

David Walther

unread,
Aug 17, 2015, 6:56:04 PM8/17/15
to golang-nuts
I ran go build on Mac OSX. The resulting c-shared library imported into a
dynamic scripting language (newLISP) beautifully.

Trying it on windows/amd64, looks like it isn't supported yet. Is this planned
for the 1.5 release?

go build -buildmode=c-shared test.go
=>
-buildmode=c-shared not supported on windows/amd64

David

Ian Lance Taylor

unread,
Aug 17, 2015, 7:24:17 PM8/17/15
to David Walther, golang-nuts
It will not be in the 1.5 release.

It would be nice if somebody worked on it for 1.6.

Ian

Mateusz Czapliński

unread,
Aug 19, 2015, 6:50:00 PM8/19/15
to golang-nuts, da...@clearbrookdistillery.com

What exactly is missing? Is it documented somewhere? In the code? Where would one start?
I don't promise anything, but I'm curious.

Thanks,
/Mateusz.

Ian Lance Taylor

unread,
Aug 19, 2015, 7:48:30 PM8/19/15
to Mateusz Czapliński, golang-nuts, David Walther
None of the required details are documented. Off the top of my head:

* Somebody needs to have a clear understanding of what is required (I
* do not).
* The compiler may to generate the code that Windows expects in a DLL.
I don't know if any change is required here or not.
* The linker will need to generate the relocations that Windows
expects in a DLL.
* The linker will need to generate the symbol table entries that
Windows expects in a DLL, for dllexport and dllimport.
* The linker will need to invoke a Windows tool to actually create a
DLL.

Ian
Reply all
Reply to author
Forward
0 new messages