Skip to content

std.Target: Remove more dead OS/architecture tags #20870

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Aug 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/compiler/aro/aro/Compilation.zig
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ fn generateSystemDefines(comp: *Compilation, w: anytype) !void {
\\#define __sparc_v9__ 1
\\
),
.sparc, .sparcel => try w.writeAll(
.sparc => try w.writeAll(
\\#define __sparc__ 1
\\#define __sparc 1
\\
Expand Down Expand Up @@ -534,7 +534,7 @@ pub fn generateBuiltinMacros(comp: *Compilation, system_defines_mode: SystemDefi

if (system_defines_mode == .include_system_defines) {
try buf.appendSlice(
\\#define __VERSION__ "Aro
\\#define __VERSION__ "Aro
++ @import("../backend.zig").version_str ++ "\"\n" ++
\\#define __Aro__
\\
Expand Down
2 changes: 1 addition & 1 deletion lib/compiler/aro/aro/Driver/GCCDetector.zig
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ fn collectLibDirsAndTriples(
biarch_libdirs.appendSliceAssumeCapacity(&RISCV32LibDirs);
biarch_triple_aliases.appendSliceAssumeCapacity(&RISCV32Triples);
},
.sparc, .sparcel => {
.sparc => {
lib_dirs.appendSliceAssumeCapacity(&SPARCv8LibDirs);
triple_aliases.appendSliceAssumeCapacity(&SPARCv8Triples);
biarch_libdirs.appendSliceAssumeCapacity(&SPARCv9LibDirs);
Expand Down
18 changes: 3 additions & 15 deletions lib/compiler/aro/aro/target.zig
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,12 @@ pub fn intPtrType(target: std.Target) Type {
.xcore,
.hexagon,
.m68k,
.spir,
.spirv32,
.arc,
.avr,
=> return .{ .specifier = .int },

.sparc, .sparcel => switch (target.os.tag) {
.sparc => switch (target.os.tag) {
.netbsd, .openbsd => {},
else => return .{ .specifier = .int },
},
Expand Down Expand Up @@ -133,7 +132,7 @@ pub fn defaultFunctionAlignment(target: std.Target) u8 {
return switch (target.cpu.arch) {
.arm, .armeb => 4,
.aarch64, .aarch64_be => 4,
.sparc, .sparcel, .sparc64 => 4,
.sparc, .sparc64 => 4,
.riscv64 => 2,
else => 1,
};
Expand Down Expand Up @@ -427,7 +426,7 @@ pub fn ldEmulationOption(target: std.Target, arm_endianness: ?std.builtin.Endian
.powerpc64le => "elf64lppc",
.riscv32 => "elf32lriscv",
.riscv64 => "elf64lriscv",
.sparc, .sparcel => "elf32_sparc",
.sparc => "elf32_sparc",
.sparc64 => "elf64_sparc",
.loongarch32 => "elf32loongarch",
.loongarch64 => "elf64loongarch",
Expand Down Expand Up @@ -467,13 +466,11 @@ pub fn get32BitArchVariant(target: std.Target) ?std.Target {
.powerpcle,
.riscv32,
.sparc,
.sparcel,
.thumb,
.thumbeb,
.x86,
.xcore,
.nvptx,
.spir,
.kalimba,
.lanai,
.wasm32,
Expand All @@ -487,7 +484,6 @@ pub fn get32BitArchVariant(target: std.Target) ?std.Target {
.aarch64_be => copy.cpu.arch = .armeb,
.nvptx64 => copy.cpu.arch = .nvptx,
.wasm64 => copy.cpu.arch = .wasm32,
.spir64 => copy.cpu.arch = .spir,
.spirv64 => copy.cpu.arch = .spirv32,
.loongarch64 => copy.cpu.arch = .loongarch32,
.mips64 => copy.cpu.arch = .mips,
Expand All @@ -513,7 +509,6 @@ pub fn get64BitArchVariant(target: std.Target) ?std.Target {
.lanai,
.m68k,
.msp430,
.sparcel,
.spu_2,
.xcore,
.xtensa,
Expand All @@ -526,7 +521,6 @@ pub fn get64BitArchVariant(target: std.Target) ?std.Target {
.bpfel,
.nvptx64,
.wasm64,
.spir64,
.spirv64,
.loongarch64,
.mips64,
Expand All @@ -550,7 +544,6 @@ pub fn get64BitArchVariant(target: std.Target) ?std.Target {
.powerpcle => copy.cpu.arch = .powerpc64le,
.riscv32 => copy.cpu.arch = .riscv64,
.sparc => copy.cpu.arch = .sparc64,
.spir => copy.cpu.arch = .spir64,
.spirv32 => copy.cpu.arch = .spirv64,
.thumb => copy.cpu.arch = .aarch64,
.thumbeb => copy.cpu.arch = .aarch64_be,
Expand Down Expand Up @@ -597,7 +590,6 @@ pub fn toLLVMTriple(target: std.Target, buf: []u8) []const u8 {
.riscv64 => "riscv64",
.sparc => "sparc",
.sparc64 => "sparc64",
.sparcel => "sparcel",
.s390x => "s390x",
.thumb => "thumb",
.thumbeb => "thumbeb",
Expand All @@ -607,8 +599,6 @@ pub fn toLLVMTriple(target: std.Target, buf: []u8) []const u8 {
.xtensa => "xtensa",
.nvptx => "nvptx",
.nvptx64 => "nvptx64",
.spir => "spir",
.spir64 => "spir64",
.spirv32 => "spirv32",
.spirv64 => "spirv64",
.kalimba => "kalimba",
Expand All @@ -624,8 +614,6 @@ pub fn toLLVMTriple(target: std.Target, buf: []u8) []const u8 {

const llvm_os = switch (target.os.tag) {
.freestanding => "unknown",
.ananas => "ananas",
.cloudabi => "cloudabi",
.dragonfly => "dragonfly",
.freebsd => "freebsd",
.fuchsia => "fuchsia",
Expand Down
1 change: 0 additions & 1 deletion lib/compiler/aro/aro/toolchains/Linux.zig
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,6 @@ fn getOSLibDir(target: std.Target) []const u8 {
.powerpc,
.powerpcle,
.sparc,
.sparcel,
=> return "lib32",
else => {},
}
Expand Down
2 changes: 1 addition & 1 deletion lib/compiler_rt/atomics.zig
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const largest_atomic_size = switch (arch) {
// On SPARC systems that lacks CAS and/or swap instructions, the only
// available atomic operation is a test-and-set (`ldstub`), so we force
// every atomic memory access to go through the lock.
.sparc, .sparcel => if (cpu.features.featureSetHas(.hasleoncasa)) @sizeOf(usize) else 0,
.sparc => if (cpu.features.featureSetHas(.hasleoncasa)) @sizeOf(usize) else 0,

// XXX: On x86/x86_64 we could check the presence of cmpxchg8b/cmpxchg16b
// and set this parameter accordingly.
Expand Down
2 changes: 1 addition & 1 deletion lib/compiler_rt/clear_cache.zig
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ fn clear_cache(start: usize, end: usize) callconv(.C) void {
else => false,
};
const sparc = switch (arch) {
.sparc, .sparc64, .sparcel => true,
.sparc, .sparc64 => true,
else => false,
};
const apple = switch (os) {
Expand Down
Loading