| ... | ... | @@ -86,50 +86,73 @@ pub fn targetTriple(allocator: Allocator, target: std.Target) ![:0]u8 { |
| 86 | 86 | .spirv64 => return error.@"LLVM backend does not support SPIR-V", |
| 87 | 87 | }; |
| 88 | 88 | |
| 89 | | const llvm_os = switch (target.os.tag) { |
| 90 | | .freestanding => "unknown", |
| 91 | | .ananas => "ananas", |
| 92 | | .cloudabi => "cloudabi", |
| 93 | | .dragonfly => "dragonfly", |
| 94 | | .freebsd => "freebsd", |
| 95 | | .fuchsia => "fuchsia", |
| 96 | | .ios => "ios", |
| 97 | | .kfreebsd => "kfreebsd", |
| 98 | | .linux => "linux", |
| 99 | | .lv2 => "lv2", |
| 100 | | .macos => "macosx", |
| 101 | | .netbsd => "netbsd", |
| 102 | | .openbsd => "openbsd", |
| 103 | | .solaris => "solaris", |
| 104 | | .windows => "windows", |
| 105 | | .zos => "zos", |
| 106 | | .haiku => "haiku", |
| 107 | | .minix => "minix", |
| 108 | | .rtems => "rtems", |
| 109 | | .nacl => "nacl", |
| 110 | | .aix => "aix", |
| 111 | | .cuda => "cuda", |
| 112 | | .nvcl => "nvcl", |
| 113 | | .amdhsa => "amdhsa", |
| 114 | | .ps4 => "ps4", |
| 115 | | .elfiamcu => "elfiamcu", |
| 116 | | .tvos => "tvos", |
| 117 | | .watchos => "watchos", |
| 118 | | .mesa3d => "mesa3d", |
| 119 | | .contiki => "contiki", |
| 120 | | .amdpal => "amdpal", |
| 121 | | .hermit => "hermit", |
| 122 | | .hurd => "hurd", |
| 123 | | .wasi => "wasi", |
| 124 | | .emscripten => "emscripten", |
| 125 | | .uefi => "windows", |
| 126 | | |
| 127 | | .opencl, |
| 128 | | .glsl450, |
| 129 | | .vulkan, |
| 130 | | .plan9, |
| 131 | | .other, |
| 132 | | => "unknown", |
| 89 | const llvm_os = blk: { |
| 90 | if (target.os.tag.isDarwin()) { |
| 91 | const min_version = target.os.version_range.semver.min; |
| 92 | const llvm_os = switch (target.os.tag) { |
| 93 | .macos => "macosx", |
| 94 | .ios => "ios", |
| 95 | .tvos => "tvos", |
| 96 | .watchos => "watchos", |
| 97 | else => unreachable, |
| 98 | }; |
| 99 | break :blk try std.fmt.allocPrintZ(allocator, "{s}{d}.{d}.{d}", .{ |
| 100 | llvm_os, |
| 101 | min_version.major, |
| 102 | min_version.minor, |
| 103 | min_version.patch, |
| 104 | }); |
| 105 | } |
| 106 | |
| 107 | const llvm_os = switch (target.os.tag) { |
| 108 | .freestanding => "unknown", |
| 109 | .ananas => "ananas", |
| 110 | .cloudabi => "cloudabi", |
| 111 | .dragonfly => "dragonfly", |
| 112 | .freebsd => "freebsd", |
| 113 | .fuchsia => "fuchsia", |
| 114 | .kfreebsd => "kfreebsd", |
| 115 | .linux => "linux", |
| 116 | .lv2 => "lv2", |
| 117 | .netbsd => "netbsd", |
| 118 | .openbsd => "openbsd", |
| 119 | .solaris => "solaris", |
| 120 | .windows => "windows", |
| 121 | .zos => "zos", |
| 122 | .haiku => "haiku", |
| 123 | .minix => "minix", |
| 124 | .rtems => "rtems", |
| 125 | .nacl => "nacl", |
| 126 | .aix => "aix", |
| 127 | .cuda => "cuda", |
| 128 | .nvcl => "nvcl", |
| 129 | .amdhsa => "amdhsa", |
| 130 | .ps4 => "ps4", |
| 131 | .elfiamcu => "elfiamcu", |
| 132 | .mesa3d => "mesa3d", |
| 133 | .contiki => "contiki", |
| 134 | .amdpal => "amdpal", |
| 135 | .hermit => "hermit", |
| 136 | .hurd => "hurd", |
| 137 | .wasi => "wasi", |
| 138 | .emscripten => "emscripten", |
| 139 | .uefi => "windows", |
| 140 | |
| 141 | .opencl, |
| 142 | .glsl450, |
| 143 | .vulkan, |
| 144 | .plan9, |
| 145 | .other, |
| 146 | => "unknown", |
| 147 | |
| 148 | .macos, |
| 149 | .ios, |
| 150 | .tvos, |
| 151 | .watchos, |
| 152 | => unreachable, |
| 153 | }; |
| 154 | |
| 155 | break :blk llvm_os; |
| 133 | 156 | }; |
| 134 | 157 | |
| 135 | 158 | const llvm_abi = switch (target.abi) { |