| ... | @@ -164,14 +164,34 @@ pub fn targetTriple(allocator: Allocator, target: std.Target) ![]const u8 { | ... | @@ -164,14 +164,34 @@ pub fn targetTriple(allocator: Allocator, target: std.Target) ![]const u8 { |
| 164 | }; | 164 | }; |
| 165 | | 165 | |
| 166 | if (llvm_sub_arch) |sub| try llvm_triple.appendSlice(sub); | 166 | if (llvm_sub_arch) |sub| try llvm_triple.appendSlice(sub); |
| | 167 | try llvm_triple.append('-'); |
| 167 | | 168 | |
| 168 | // Unlike CPU backends, GPU backends actually care about the vendor tag. | 169 | try llvm_triple.appendSlice(switch (target.os.tag) { |
| 169 | try llvm_triple.appendSlice(switch (target.cpu.arch) { | 170 | .aix, |
| 170 | .amdgcn => if (target.os.tag == .mesa3d) "-mesa-" else "-amd-", | 171 | .zos, |
| 171 | .nvptx, .nvptx64 => "-nvidia-", | 172 | => "ibm", |
| 172 | .spirv64 => if (target.os.tag == .amdhsa) "-amd-" else "-unknown-", | 173 | .bridgeos, |
| 173 | else => "-unknown-", | 174 | .driverkit, |
| | 175 | .ios, |
| | 176 | .macos, |
| | 177 | .tvos, |
| | 178 | .visionos, |
| | 179 | .watchos, |
| | 180 | => "apple", |
| | 181 | .ps4, |
| | 182 | .ps5, |
| | 183 | => "scei", |
| | 184 | .amdhsa, |
| | 185 | .amdpal, |
| | 186 | => "amd", |
| | 187 | .cuda, |
| | 188 | .nvcl, |
| | 189 | => "nvidia", |
| | 190 | .mesa3d, |
| | 191 | => "mesa", |
| | 192 | else => "unknown", |
| 174 | }); | 193 | }); |
| | 194 | try llvm_triple.append('-'); |
| 175 | | 195 | |
| 176 | const llvm_os = switch (target.os.tag) { | 196 | const llvm_os = switch (target.os.tag) { |
| 177 | .freestanding => "unknown", | 197 | .freestanding => "unknown", |