Swift as a cross-platform language and Windows support


(Thomas Roughton) #61

I've uploaded the source to https://gist.github.com/troughton/9fdecf4dc09b0406c444c28f40f80d43. It works correctly in debug mode but crashes in release mode; it's hitting an internalInvariant on line 31 of ArrayBody.swift. (As a side note, this is a Swift 2-era program that's been lightly modified, so the code style is very out of date).

From the looks of things, it does seem like the generic parameter to Builtin.allocWithTailElems_1 is invalid somehow, so that allocation is getting corrupted. I haven't investigated too thoroughly, though.

I'll note that I ran into an issue in the build process - SwiftPrivatePthreadExtras can't be built because the definition of _beginthreadex isn't found (perhaps because it's only building against the single-threaded CRT?). I disabled that target to get past the error.


official msvc build guide

however i still like to stick with cmake + native msbuild stye. I am start working at compile Swift without clang. Everything should be ok if the dependencies are available in windows

(Saleem Abdulrasool) #63

There are a number of deficiencies with MSVC. At least as of the 14.16.2703 toolset, the compiler has bugs with various template instantiations. It also doesn't support C11 (which we are using in a few places). Finally, MSVC doesn't support the swift calling convention. As I have put in the document, you can get the compiler to build with MSVC (although, that does require a few changes), but you cannot build the standard library without clang.