authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-08-25 23:33:59-04:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2022-08-25 23:33:59-04:00
logaa4544963caf4073fb90db396f42ca730febfe7e
tree7ff89b10cb380796c495d3992f74af1d5122f3de
parentd2ad8afff4c404f6e1a566cce3fa6e7f768503e5
parent29e90efbb131b21eb7f41425a4dd4b74e6989942
signaturebadge-question-mark Signed by PGP key 4AEE18F83AFDEB23

Merge pull request #12629 from motiejus/libresolv-abilists

glibc/abilists: add libresolv stubs

2 files changed, 3 insertions(+), 49 deletions(-)

lib/libc/glibc/abilists
Binary files a/lib/libc/glibc/abilists and b/lib/libc/glibc/abilists differ
src/glibc.zig+3-49
......@@ -41,29 +41,7 @@ pub const libs = [_]Lib{
4141 .{ .name = "rt", .sover = 1 },
4242 .{ .name = "ld", .sover = 2 },
4343 .{ .name = "util", .sover = 1 },
44};
45
46// glibc's naming of Zig architectures
47const Arch = enum(c_int) {
48 arm,
49 armeb,
50 aarch64,
51 aarch64_be,
52 mips,
53 mipsel,
54 mips64,
55 mips64el,
56 powerpc,
57 powerpc64,
58 powerpc64le,
59 riscv32,
60 riscv64,
61 sparc,
62 sparcv9,
63 sparcel,
64 s390x,
65 i386,
66 x86_64,
44 .{ .name = "resolv", .sover = 2 },
6745};
6846
6947pub const LoadMetaDataError = error{
......@@ -157,7 +135,7 @@ pub fn loadMetaData(gpa: Allocator, zig_lib_dir: fs.Dir) LoadMetaDataError!*ABI
157135 log.err("abilists: expected ABI name", .{});
158136 return error.ZigInstallationCorrupt;
159137 };
160 const arch_tag = std.meta.stringToEnum(Arch, arch_name) orelse {
138 const arch_tag = std.meta.stringToEnum(std.Target.Cpu.Arch, arch_name) orelse {
161139 log.err("abilists: unrecognized arch: '{s}'", .{arch_name});
162140 return error.ZigInstallationCorrupt;
163141 };
......@@ -171,7 +149,7 @@ pub fn loadMetaData(gpa: Allocator, zig_lib_dir: fs.Dir) LoadMetaDataError!*ABI
171149 };
172150
173151 targets[i] = .{
174 .arch = glibcToZigArch(arch_tag),
152 .arch = arch_tag,
175153 .os = .linux,
176154 .abi = abi_tag,
177155 };
......@@ -1139,30 +1117,6 @@ fn buildSharedLib(
11391117 try sub_compilation.updateSubCompilation();
11401118}
11411119
1142fn glibcToZigArch(arch_tag: Arch) std.Target.Cpu.Arch {
1143 return switch (arch_tag) {
1144 .arm => .arm,
1145 .armeb => .armeb,
1146 .aarch64 => .aarch64,
1147 .aarch64_be => .aarch64_be,
1148 .mips => .mips,
1149 .mipsel => .mipsel,
1150 .mips64 => .mips64,
1151 .mips64el => .mips64el,
1152 .powerpc => .powerpc,
1153 .powerpc64 => .powerpc64,
1154 .powerpc64le => .powerpc64le,
1155 .riscv32 => .riscv32,
1156 .riscv64 => .riscv64,
1157 .sparc => .sparc,
1158 .sparcv9 => .sparc64, // In glibc, sparc64 is called sparcv9.
1159 .sparcel => .sparcel,
1160 .s390x => .s390x,
1161 .i386 => .i386,
1162 .x86_64 => .x86_64,
1163 };
1164}
1165
11661120// Return true if glibc has crti/crtn sources for that architecture.
11671121pub fn needsCrtiCrtn(target: std.Target) bool {
11681122 return switch (target.cpu.arch) {