-
Notifications
You must be signed in to change notification settings - Fork 207
[WIP] Implement WindowsToolchain #252
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
CC @compnerd , I hope to get SPM fully usable on Windows through |
9e9ce5f
to
9fcd3f2
Compare
3e08737
to
9076ab2
Compare
@@ -258,3 +279,5 @@ extension DarwinToolchain { | |||
} | |||
|
|||
} | |||
|
|||
// TODO: See whether Windows needs `addArgsToLinkStdlib`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it will definitely needs arguments for that. At the very least, you need to ensure that the ucrt link matches the stdlib.
9aa1213
to
8b7b0df
Compare
I’m working on the linker part, and now I’m troubled by the following two question:
It’s fairly easy to configure the MSVC linkers and their LLVM drop-in substitutes (I think it can be done today), but what about not using |
Another question that I think only @compnerd is capable of answering... Are we going to include The dedicated place for it is |
The MinGW path should not use the WindowsToolchain but rather the GNUToolchain much Like the model in clang. MinGW is substantially different in ABI that you cannot mix and match the behavior. In fact there's a large number of other things that won't work - like linking because MinGW would require auto link extract that the Windows path does not use as the MINGW doesn't support linker directives. The other thing is that binutils isn't supported by swift because of issues with relocation handling. In general, MinGW isn't ready yet, and would require a lot more than just tweaking the driver. No, there's no reason to include clangrt, that isn't used on windows. |
clang_rt is required for sanitizer support. // Check that we're one of the known supported targets for sanitizers.
if !(targetTriple.isWindows || targetTriple.isDarwin || targetTriple.os == .linux) I’m seeing this line of code. It should mean that we are going to provide sanitizer support on Windows? |
7e9d341
to
4b69ec6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for updating this! It looks pretty good to me, but I'm not very familiar with Windows so I wasn't able to review it thoroughly.
It would be really great if we could include some basic tests alongside this change as well, at least for the platform-specific linking. I think a lot of the windows-related integration tests from the main Swift repo will continue to fail until MSVC runtime handling is added, I haven't looked into how complicated that is. Maybe a couple cases could be added to testLinking
in SwiftDriverTests.swift
that use the windows target?
4ee9697
to
ed1b8c2
Compare
Of course I will. However, there is still an unimplemented function (see the only unresolved review😂) which should be implemented before implementing tests. |
Shall we use MD or MT as default for Windows? @compnerd |
I don't think that we should have a default for the value. It must match the value for the runtime that you are building against. I suppose that one possibility is to query the |
I‘m thinking it necessary. It’s one of our goals to allow user run We can have multiple ways to infer though. plist is one of them, but maybe we also need a hard-coded default. |
If you are adamant that you must have a default, then you must serialize the compile options into the |
I‘d like to know if |
It is not, it is only something that is built on my builds of the toolchain; anyone building the toolchain manually will have to deal with that themselves. |
The Swift project moved the default branch to More detail about the branch update - https://forums.swift.org/t/updating-branch-names/40412 |
Implemented the Windows-specific toolchain.