authorgravatar for vasyapulopapik@gmail.comKleshzz <vasyapulopapik@gmail.com> 2026-08-26 10:02:45+03:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-08-27 14:35:44+02:00
logc3723c05f0349efb6f2b28655f886d58853a9d3a
treea44f9b8de818027e77ee3151a6ae0e041d123bf1
parent896bd9e1538ed9d06ff6b212e3df1da978c7e34e

std.Target: add gba os tag


7 files changed, 23 insertions(+), 0 deletions(-)

lib/std/Build/Configuration.zig+1
......@@ -2401,6 +2401,7 @@ pub const TargetQuery = struct {
24012401 @"3ds",
24022402 wiiu,
24032403 @"switch",
2404 gba,
24042405 psx,
24052406 ps3,
24062407 ps4,
lib/std/Target.zig+16
......@@ -51,6 +51,7 @@ pub const Os = struct {
5151 @"3ds",
5252 wiiu,
5353 @"switch",
54 gba,
5455
5556 psx,
5657 ps3,
......@@ -167,6 +168,7 @@ pub const Os = struct {
167168 .ps3,
168169 .ps4,
169170 .ps5,
171 .gba,
170172
171173 .emscripten,
172174
......@@ -407,6 +409,7 @@ pub const Os = struct {
407409 .ps3,
408410 .ps4,
409411 .ps5,
412 .gba,
410413
411414 .emscripten,
412415
......@@ -933,6 +936,7 @@ pub const Abi = enum {
933936 .uefi => .msvc,
934937 .@"3ds" => .eabihf,
935938 .wiiu => .eabihf,
939 .gba => .eabi,
936940 .psx => .eabi,
937941 .psp => .eabihf,
938942 .vita => .eabihf,
......@@ -2071,10 +2075,12 @@ pub const Cpu = struct {
20712075 .arm => switch (os.tag) {
20722076 .@"3ds" => &arm.cpu.mpcore,
20732077 .vita => &arm.cpu.cortex_a9,
2078 .gba => &arm.cpu.arm7tdmi,
20742079 else => &arm.cpu.baseline,
20752080 },
20762081 .thumb => switch (os.tag) {
20772082 .vita => &arm.cpu.cortex_a9,
2083 .gba => &arm.cpu.arm7tdmi,
20782084 else => &arm.cpu.baseline,
20792085 },
20802086 .armeb, .thumbeb => &arm.cpu.baseline,
......@@ -2306,6 +2312,7 @@ pub fn requiresLibC(target: *const Target) bool {
23062312 .ps3,
23072313 .ps4,
23082314 .ps5,
2315 .gba,
23092316 .psp,
23102317 .vita,
23112318 .mesa3d,
......@@ -2474,6 +2481,7 @@ pub const DynamicLinker = struct {
24742481 .@"3ds",
24752482 .wiiu,
24762483 .@"switch",
2484 .gba,
24772485
24782486 .emscripten,
24792487 .wasi,
......@@ -2913,6 +2921,7 @@ pub const DynamicLinker = struct {
29132921 .@"3ds",
29142922 .wiiu,
29152923 .@"switch",
2924 .gba,
29162925
29172926 .psx,
29182927 .psp,
......@@ -3492,6 +3501,13 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) ?u16 {
34923501 .longdouble => return 128,
34933502 },
34943503
3504 .gba => switch (c_type) {
3505 .char => return 8,
3506 .short, .ushort => return 16,
3507 .int, .uint, .long, .ulong, .float => return 32,
3508 .longlong, .ulonglong, .double, .longdouble => return 64,
3509 },
3510
34953511 .psx => switch (c_type) {
34963512 .char => return 8,
34973513 .short, .ushort => return 16,
lib/std/debug.zig+1
......@@ -520,6 +520,7 @@ pub fn defaultPanic(msg: []const u8, first_trace_addr: ?usize) noreturn {
520520 .@"3ds",
521521 .wiiu,
522522 .@"switch",
523 .gba,
523524
524525 .psx,
525526 .psp,
lib/std/start.zig+1
......@@ -79,6 +79,7 @@ comptime {
7979 .@"3ds",
8080 .wiiu,
8181 .@"switch",
82 .gba,
8283
8384 .psx,
8485 .psp,
lib/std/zig/llvm/Builder.zig+1
......@@ -295,6 +295,7 @@ pub fn tripleForTarget(allocator: Allocator, target: *const std.Target) ![]const
295295 .@"3ds",
296296 .wiiu,
297297 .@"switch",
298 .gba,
298299 .ashetos,
299300 => "unknown",
300301 };
src/Compilation.zig+1
......@@ -6297,6 +6297,7 @@ fn addCommonCCArgs(
62976297 .@"3ds" => try argv.append("-D__3DS__"),
62986298 .wiiu => try argv.append("-D__WIIU__"),
62996299 .@"switch" => try argv.append("-D__SWITCH__"),
6300 .gba => try argv.append("-D__GBA__"),
63006301 .psx => try argv.append("-D__psx__"),
63016302 .psp => try argv.append("-D__PSP__"),
63026303 .vita => try argv.append("-D__vita__"),
test/llvm_targets.zig+2
......@@ -54,6 +54,7 @@ const targets = [_]std.Target.Query{
5454 .{ .cpu_arch = .arm, .os_tag = .freestanding, .abi = .eabi },
5555 .{ .cpu_arch = .arm, .os_tag = .freestanding, .abi = .eabihf },
5656 .{ .cpu_arch = .arm, .os_tag = .fuchsia, .abi = .eabihf },
57 .{ .cpu_arch = .arm, .os_tag = .gba, .abi = .eabi },
5758 .{ .cpu_arch = .arm, .os_tag = .haiku, .abi = .eabihf },
5859 .{ .cpu_arch = .arm, .os_tag = .linux, .abi = .androideabi },
5960 .{ .cpu_arch = .arm, .os_tag = .linux, .abi = .eabi },
......@@ -263,6 +264,7 @@ const targets = [_]std.Target.Query{
263264 .{ .cpu_arch = .thumb, .os_tag = .freestanding, .abi = .eabi },
264265 .{ .cpu_arch = .thumb, .os_tag = .freestanding, .abi = .eabihf },
265266 .{ .cpu_arch = .thumb, .os_tag = .fuchsia, .abi = .eabihf },
267 .{ .cpu_arch = .thumb, .os_tag = .gba, .abi = .eabi },
266268 .{ .cpu_arch = .thumb, .os_tag = .linux, .abi = .eabi },
267269 .{ .cpu_arch = .thumb, .os_tag = .linux, .abi = .eabihf },
268270 .{ .cpu_arch = .thumb, .os_tag = .linux, .abi = .musleabi },