<div dir="ltr">On Thu, May 5, 2016 at 5:26 PM, Joe Groff via swift-dev <span dir="ltr"><<a href="mailto:swift-dev@swift.org" target="_blank">swift-dev@swift.org</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class=""><br>
> On May 5, 2016, at 4:18 PM, Sangjin Han via swift-dev <<a href="mailto:swift-dev@swift.org">swift-dev@swift.org</a>> wrote:<br>
><br>
> Hi,<br>
><br>
> I made an experimental MSVC port. Of cause, dllimport/dllexport and the driver for linking and many other part is not implemented. But dynamic linking was possible with some trick.<br>
><br>
> I think it is useful for designing, my observation about the experimental building of libswiftCore.dll, libswiftSwiftOnoneSupport.dll and linking of Hello.exe - its source has only 'print("Hello")'.<br>
><br>
> 1) SWIFT_RUNTIME_EXPORT was not enough for dllexport.<br>
> Hello.obj needed defined in libswift*.dll<br>
> _swift_getExistentialTypeMetadata,<br>
> _TFs5printFTGSaP__9separatorSS10terminatorSS_T_,<br>
> _TMSS,<br>
> _TZvOs7Process5_argcVs5Int32,<br>
> swift_bufferAllocate, ....<br>
> Some of above are dllexported by the macro, but _T* are not. Maybe, it generated by swiftc.exe.<br>
> I used the utility 'dlltool.exe' from Cygwin/MinGW world. It extracts all symbols and generates 'allsymbol.def'.<br>
> With that .def, I could build the all-symbol-dllexported libswiftCore.dll.<br>
> (I'm hoping we can build it without this trick.)<br>
<br>
</span>The _T symbols are emitted by the Swift compiler. You should modify swiftc's IRGen to generate public symbols with LLVM's "dllexport" storage class when targeting Windows.</blockquote><div><br></div><div><a href="https://github.com/apple/swift/pull/2080">https://github.com/apple/swift/pull/2080</a> is a first cut attempt to do this.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class=""><font color="#888888"><br>
-Joe<br>
</font></span><div class=""><div class="h5">_______________________________________________<br>
swift-dev mailing list<br>
<a href="mailto:swift-dev@swift.org">swift-dev@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-dev" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-dev</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Saleem Abdulrasool<br>compnerd (at) compnerd (dot) org</div>
</div></div>