aboutsummaryrefslogtreecommitdiff
path: root/src/glibc.zig
diff options
context:
space:
mode:
authorMotiejus Jakštys <motiejus@uber.com>2022-08-25 16:46:32 +0300
committerMotiejus Jakštys <motiejus@uber.com>2022-08-25 16:46:32 +0300
commit29e90efbb131b21eb7f41425a4dd4b74e6989942 (patch)
treebcf3115e9a3a2ce30972115b949e3dc1bd63a5f6 /src/glibc.zig
parentea785f70ef5148f372c897e503e71c080b69e8da (diff)
downloadzig-29e90efbb131b21eb7f41425a4dd4b74e6989942.tar.gz
zig-29e90efbb131b21eb7f41425a4dd4b74e6989942.zip
src/glibc: remove redundant Arch
abilists now use Zig's arch, no need for a separate one.
Diffstat (limited to 'src/glibc.zig')
-rw-r--r--src/glibc.zig51
1 files changed, 2 insertions, 49 deletions
diff --git a/src/glibc.zig b/src/glibc.zig
index c02989294b..4e33867169 100644
--- a/src/glibc.zig
+++ b/src/glibc.zig
@@ -44,29 +44,6 @@ pub const libs = [_]Lib{
.{ .name = "resolv", .sover = 2 },
};
-// glibc's naming of Zig architectures
-const Arch = enum(c_int) {
- arm,
- armeb,
- aarch64,
- aarch64_be,
- mips,
- mipsel,
- mips64,
- mips64el,
- powerpc,
- powerpc64,
- powerpc64le,
- riscv32,
- riscv64,
- sparc,
- sparc64,
- sparcel,
- s390x,
- i386,
- x86_64,
-};
-
pub const LoadMetaDataError = error{
/// The files that ship with the Zig compiler were unable to be read, or otherwise had malformed data.
ZigInstallationCorrupt,
@@ -158,7 +135,7 @@ pub fn loadMetaData(gpa: Allocator, zig_lib_dir: fs.Dir) LoadMetaDataError!*ABI
log.err("abilists: expected ABI name", .{});
return error.ZigInstallationCorrupt;
};
- const arch_tag = std.meta.stringToEnum(Arch, arch_name) orelse {
+ const arch_tag = std.meta.stringToEnum(std.Target.Cpu.Arch, arch_name) orelse {
log.err("abilists: unrecognized arch: '{s}'", .{arch_name});
return error.ZigInstallationCorrupt;
};
@@ -172,7 +149,7 @@ pub fn loadMetaData(gpa: Allocator, zig_lib_dir: fs.Dir) LoadMetaDataError!*ABI
};
targets[i] = .{
- .arch = glibcToZigArch(arch_tag),
+ .arch = arch_tag,
.os = .linux,
.abi = abi_tag,
};
@@ -1140,30 +1117,6 @@ fn buildSharedLib(
try sub_compilation.updateSubCompilation();
}
-fn glibcToZigArch(arch_tag: Arch) std.Target.Cpu.Arch {
- return switch (arch_tag) {
- .arm => .arm,
- .armeb => .armeb,
- .aarch64 => .aarch64,
- .aarch64_be => .aarch64_be,
- .mips => .mips,
- .mipsel => .mipsel,
- .mips64 => .mips64,
- .mips64el => .mips64el,
- .powerpc => .powerpc,
- .powerpc64 => .powerpc64,
- .powerpc64le => .powerpc64le,
- .riscv32 => .riscv32,
- .riscv64 => .riscv64,
- .sparc => .sparc,
- .sparc64 => .sparc64,
- .sparcel => .sparcel,
- .s390x => .s390x,
- .i386 => .i386,
- .x86_64 => .x86_64,
- };
-}
-
// Return true if glibc has crti/crtn sources for that architecture.
pub fn needsCrtiCrtn(target: std.Target) bool {
return switch (target.cpu.arch) {