| ... | @@ -44,29 +44,6 @@ pub const libs = [_]Lib{ | ... | @@ -44,29 +44,6 @@ pub const libs = [_]Lib{ |
| 44 | .{ .name = "resolv", .sover = 2 }, | 44 | .{ .name = "resolv", .sover = 2 }, |
| 45 | }; | 45 | }; |
| 46 | | 46 | |
| 47 | // glibc's naming of Zig architectures | | |
| 48 | const Arch = enum(c_int) { | | |
| 49 | arm, | | |
| 50 | armeb, | | |
| 51 | aarch64, | | |
| 52 | aarch64_be, | | |
| 53 | mips, | | |
| 54 | mipsel, | | |
| 55 | mips64, | | |
| 56 | mips64el, | | |
| 57 | powerpc, | | |
| 58 | powerpc64, | | |
| 59 | powerpc64le, | | |
| 60 | riscv32, | | |
| 61 | riscv64, | | |
| 62 | sparc, | | |
| 63 | sparc64, | | |
| 64 | sparcel, | | |
| 65 | s390x, | | |
| 66 | i386, | | |
| 67 | x86_64, | | |
| 68 | }; | | |
| 69 | | | |
| 70 | pub const LoadMetaDataError = error{ | 47 | pub const LoadMetaDataError = error{ |
| 71 | /// The files that ship with the Zig compiler were unable to be read, or otherwise had malformed data. | 48 | /// The files that ship with the Zig compiler were unable to be read, or otherwise had malformed data. |
| 72 | ZigInstallationCorrupt, | 49 | ZigInstallationCorrupt, |
| ... | @@ -158,7 +135,7 @@ pub fn loadMetaData(gpa: Allocator, zig_lib_dir: fs.Dir) LoadMetaDataError!*ABI | ... | @@ -158,7 +135,7 @@ pub fn loadMetaData(gpa: Allocator, zig_lib_dir: fs.Dir) LoadMetaDataError!*ABI |
| 158 | log.err("abilists: expected ABI name", .{}); | 135 | log.err("abilists: expected ABI name", .{}); |
| 159 | return error.ZigInstallationCorrupt; | 136 | return error.ZigInstallationCorrupt; |
| 160 | }; | 137 | }; |
| 161 | const arch_tag = std.meta.stringToEnum(Arch, arch_name) orelse { | 138 | const arch_tag = std.meta.stringToEnum(std.Target.Cpu.Arch, arch_name) orelse { |
| 162 | log.err("abilists: unrecognized arch: '{s}'", .{arch_name}); | 139 | log.err("abilists: unrecognized arch: '{s}'", .{arch_name}); |
| 163 | return error.ZigInstallationCorrupt; | 140 | return error.ZigInstallationCorrupt; |
| 164 | }; | 141 | }; |
| ... | @@ -172,7 +149,7 @@ pub fn loadMetaData(gpa: Allocator, zig_lib_dir: fs.Dir) LoadMetaDataError!*ABI | ... | @@ -172,7 +149,7 @@ pub fn loadMetaData(gpa: Allocator, zig_lib_dir: fs.Dir) LoadMetaDataError!*ABI |
| 172 | }; | 149 | }; |
| 173 | | 150 | |
| 174 | targets[i] = .{ | 151 | targets[i] = .{ |
| 175 | .arch = glibcToZigArch(arch_tag), | 152 | .arch = arch_tag, |
| 176 | .os = .linux, | 153 | .os = .linux, |
| 177 | .abi = abi_tag, | 154 | .abi = abi_tag, |
| 178 | }; | 155 | }; |
| ... | @@ -1140,30 +1117,6 @@ fn buildSharedLib( | ... | @@ -1140,30 +1117,6 @@ fn buildSharedLib( |
| 1140 | try sub_compilation.updateSubCompilation(); | 1117 | try sub_compilation.updateSubCompilation(); |
| 1141 | } | 1118 | } |
| 1142 | | 1119 | |
| 1143 | fn glibcToZigArch(arch_tag: Arch) std.Target.Cpu.Arch { | | |
| 1144 | return switch (arch_tag) { | | |
| 1145 | .arm => .arm, | | |
| 1146 | .armeb => .armeb, | | |
| 1147 | .aarch64 => .aarch64, | | |
| 1148 | .aarch64_be => .aarch64_be, | | |
| 1149 | .mips => .mips, | | |
| 1150 | .mipsel => .mipsel, | | |
| 1151 | .mips64 => .mips64, | | |
| 1152 | .mips64el => .mips64el, | | |
| 1153 | .powerpc => .powerpc, | | |
| 1154 | .powerpc64 => .powerpc64, | | |
| 1155 | .powerpc64le => .powerpc64le, | | |
| 1156 | .riscv32 => .riscv32, | | |
| 1157 | .riscv64 => .riscv64, | | |
| 1158 | .sparc => .sparc, | | |
| 1159 | .sparc64 => .sparc64, | | |
| 1160 | .sparcel => .sparcel, | | |
| 1161 | .s390x => .s390x, | | |
| 1162 | .i386 => .i386, | | |
| 1163 | .x86_64 => .x86_64, | | |
| 1164 | }; | | |
| 1165 | } | | |
| 1166 | | | |
| 1167 | // Return true if glibc has crti/crtn sources for that architecture. | 1120 | // Return true if glibc has crti/crtn sources for that architecture. |
| 1168 | pub fn needsCrtiCrtn(target: std.Target) bool { | 1121 | pub fn needsCrtiCrtn(target: std.Target) bool { |
| 1169 | return switch (target.cpu.arch) { | 1122 | return switch (target.cpu.arch) { |