Skip to content

Commit f3fd0e6

Browse files
committed
Use DarwinToolchain for apple-none targets
- When compiling for os none for apple, we should perfer using a Darwin toolchain (maybe a misnomer now) instead of a generic UNIX toolchain. This results in the driver selecting relevant tools for apple platforms, such as using ld64 over gold, etc.
1 parent a234bef commit f3fd0e6

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Sources/SwiftDriver/Driver/Driver.swift

+8-1
Original file line numberDiff line numberDiff line change
@@ -2954,12 +2954,19 @@ extension Triple {
29542954
return DarwinToolchain.self
29552955
case .linux:
29562956
return GenericUnixToolchain.self
2957-
case .freeBSD, .haiku, .openbsd, .noneOS:
2957+
case .freeBSD, .haiku, .openbsd:
29582958
return GenericUnixToolchain.self
29592959
case .wasi:
29602960
return WebAssemblyToolchain.self
29612961
case .win32:
29622962
return WindowsToolchain.self
2963+
case .noneOS:
2964+
switch self.vendor{
2965+
case .apple:
2966+
return DarwinToolchain.self
2967+
default:
2968+
return GenericUnixToolchain.self
2969+
}
29632970
default:
29642971
diagnosticsEngine.emit(.error_unknown_target(triple))
29652972
throw Driver.ErrorDiagnostics.emitted

0 commit comments

Comments
 (0)