<html><body><div>Hi all, and particularly Saleem, Hugh, and Han,</div><div><br data-mce-bogus="1"></div><div>I've been recently trying to build the Swift compiler, runtime, and core libraries on Windows against the MSVC runtime from master and have been running into some difficulties. I've managed to get Clang and swiftc built (and I hope to submit pull requests over the weekend with the fixes to enable this), but I've been unable to get the runtime and core libraries to build and link correctly.</div><div><br data-mce-bogus="1"></div><div>My understanding is that this is due to dllimport difficulties when linking the runtime into swiftCore as opposed to against any of the other supporting libraries, as discussed on this list a while ago [topic: swift (ABI) and Windows]. It seems as though changes have been made to the source pertaining to import/export linkage since that discussion (commit <span style="color: #24292e; font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14.4px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #f6f8fa; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;" data-mce-style="color: #24292e; font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14.4px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: #f6f8fa; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;">3105c6e</span>), but I'm not sure as to the impact of those changes on the Windows build.</div><div><br data-mce-bogus="1"></div><div>I've attempted cross-compiling from macOS and have run into issues with Mac-specific invocations being passed through to lld-link (which could perhaps be addressed by diving into the CMake configurations for LLVM/Clang but which might cause issues if I want to upstream my changes). Setting CMAKE_SYSTEM_NAME to Windows would likely address this specific issues but raise others, as it appears the Swift configuration assumes that cross-compiling for Windows happens with CMAKE_SYSTEM_NAME unchanged from the build machine.</div><div><br data-mce-bogus="1"></div><div> I've also looked into the MSVC specific instructions at <a data-mce-href="https://github.com/tinysun212" href="https://github.com/tinysun212">https://github.com/tinysun212</a>, but they seem somewhat incomplete and out of date; for instance, swiftRuntime doesn't seem to be built as a separate library anymore (although I may be mistaken that it ever was). </div><div><br data-mce-bogus="1"></div><div>As a secondary problem, there's also an open issue with regards to the Swift calling convention on Windows (<a data-mce-href="https://bugs.swift.org/browse/SR-4302" href="https://bugs.swift.org/browse/SR-4302">SR-4302</a>) that seems to be on hold; Saleem gave a pointer to a temporary solution but I've been unable to figure out how to implement it.</div><div><br data-mce-bogus="1"></div><div>If any of what I've stated here is incorrect or misinformed, please let me know. I'm willing to do what I can to help the porting effort and possibly eventually Swift development as a whole; my specific aim here is that I'm working on a Swift application that I'd like to bring cross-platform. Unfortunately, I have little experience or knowledge of the Microsoft development stack, so I may need some specific pointers or else to leave the more intricate parts to more experienced minds.<br></div><div><br data-mce-bogus="1"></div><div>Thanks,</div><div>Thomas Roughton</div></body></html>