File tree 1 file changed +8
-1
lines changed
Sources/SwiftDriver/Toolchains
1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -109,6 +109,13 @@ extension WindowsToolchain {
109
109
targetTriple: Triple ,
110
110
targetVariantTriple: Triple ? ,
111
111
diagnosticsEngine: DiagnosticsEngine ) throws {
112
+ // The default linker `LINK.exe` can use `/LTCG:INCREMENTAL` to enable LTO,
113
+ // and LLVM LTOs are available through `lld-link`. Both LTO methods still need
114
+ // additional work to be integrated, so disable this option for now.
115
+ if parsedOptions. hasArgument ( . lto) {
116
+ // TODO: LTO support on Windows
117
+ throw ToolchainValidationError . argumentNotSupported ( " -lto= " )
118
+ }
112
119
// Windows executables should be profiled with ETW, whose support needs to be
113
120
// implemented before we can enable the option.
114
121
if parsedOptions. hasArgument ( . profileGenerate) {
@@ -137,7 +144,7 @@ extension WindowsToolchain {
137
144
case . illegalCrtName( let argument) :
138
145
return " \( argument) is not a valid C Runtime for Windows "
139
146
case . sdkNotFound:
140
- return " swift development on Windows always requires SDK of the target platform "
147
+ return " swift development on Windows always requires the SDK of target platform "
141
148
}
142
149
}
143
150
}
You can’t perform that action at this time.
0 commit comments