diff --git a/lib/std/Build/Configuration.zig b/lib/std/Build/Configuration.zig index 6eea9c9fffd24b817989fcaa2045ac1b39982501..fb24f8b5042a87979c638aeecdbc8743f0e74403 100644 --- a/lib/std/Build/Configuration.zig +++ b/lib/std/Build/Configuration.zig @@ -2443,7 +2443,6 @@ pub const TargetQuery = struct { elf, hex, macho, - spork8, plan9, raw, spirv, diff --git a/lib/std/Target.zig b/lib/std/Target.zig index 659caa75b5ed7f0cbd473f5f995cad5386d75c1d..17fd85e035125edbfe9fdc57c682802954adec18 100644 --- a/lib/std/Target.zig +++ b/lib/std/Target.zig @@ -104,7 +104,7 @@ pub const Os = struct { .plan9 => arch.plan9Ext(), else => switch (arch) { .wasm32, .wasm64 => ".wasm", - .spork8 => ".spork8", + .spork8 => ".bin", else => "", }, }; @@ -1065,7 +1065,6 @@ pub const ObjectFormat = enum { hex, /// The Mach object format used by macOS and other Apple platforms. macho, - spork8, /// The a.out format used by Plan 9 from Bell Labs. plan9, /// Machine code with no metadata. @@ -1081,7 +1080,6 @@ pub const ObjectFormat = enum { .coff => ".obj", .elf, .macho, .wasm => ".o", .hex => ".ihex", - .spork8 => ".spork8", .plan9 => arch.plan9Ext(), .raw => ".bin", .spirv => ".spv", @@ -1096,7 +1094,7 @@ pub const ObjectFormat = enum { else => switch (arch) { .spirv32, .spirv64 => .spirv, .wasm32, .wasm64 => .wasm, - .spork8 => .spork8, + .spork8 => .raw, else => .elf, }, }; diff --git a/lib/std/debug.zig b/lib/std/debug.zig index 768b6bca673d1fb22415b5de126e006ed2adbe13..1e83e71ba04025eda0c7f61a3be22ea259c5d610 100644 --- a/lib/std/debug.zig +++ b/lib/std/debug.zig @@ -75,8 +75,8 @@ pub fn TargetInfo(os: std.Target.Os.Tag, arch: std.Target.Cpu.Arch) type { else => @import("debug/SelfInfo/Elf.zig"), }, .macho => @import("debug/SelfInfo/MachO.zig"), - .plan9, .spirv, .wasm, .spork8 => void, - .c, .hex, .raw => unreachable, + .plan9, .spirv, .wasm, .raw, .hex => void, + .c => unreachable, }; } diff --git a/lib/std/zig.zig b/lib/std/zig.zig index edf19d1848c27eb51e703d7a632e8e8cdc50cdc9..e18a6414c6e9ba130640e061307c68b16ff02456 100644 --- a/lib/std/zig.zig +++ b/lib/std/zig.zig @@ -259,7 +259,6 @@ pub fn binNameAlloc(allocator: Allocator, options: BinNameOptions) error{OutOfMe .spirv => return std.fmt.allocPrint(allocator, "{s}.spv", .{root_name}), .hex => return std.fmt.allocPrint(allocator, "{s}.ihex", .{root_name}), .raw => return std.fmt.allocPrint(allocator, "{s}.bin", .{root_name}), - .spork8 => return std.fmt.allocPrint(allocator, "{s}.spork8", .{root_name}), .plan9 => switch (options.output_mode) { .Exe => return allocator.dupe(u8, root_name), .Obj => return std.fmt.allocPrint(allocator, "{s}{s}", .{ diff --git a/src/Compilation/Config.zig b/src/Compilation/Config.zig index 58a69ba70100065ab0175fd94319ebaf0ae8cce4..affb7cf5c1e9ddb85e137eaef26dcb7750966657 100644 --- a/src/Compilation/Config.zig +++ b/src/Compilation/Config.zig @@ -502,7 +502,7 @@ pub fn resolve(options: Options) ResolveError!Config { .windows, .uefi => .code_view, else => .{ .dwarf = .@"32" }, }, - .spirv, .hex, .raw, .plan9, .spork8 => .strip, + .spirv, .hex, .raw, .plan9 => .strip, }; }; diff --git a/src/codegen.zig b/src/codegen.zig index 17dcc14f7036d4631e3225890c0404f2dd828410..b4efad778181ae69f35265f5e5edfe29e565921a 100644 --- a/src/codegen.zig +++ b/src/codegen.zig @@ -80,7 +80,7 @@ pub fn legalizeFeatures(pt: Zcu.PerThread, nav_index: InternPool.Nav.Index) ?*co .stage2_x86, .stage2_riscv64, .stage2_sparc64, - .stage2_spork8, + .zsf_spork8, .stage2_spirv, => |backend| { dev.check(devFeatureForBackend(backend)); @@ -122,7 +122,7 @@ pub const AnyMir = union { .stage2_wasm => "wasm", .stage2_c => "c", .stage2_spirv => "spirv", - .stage2_spork8 => "spork8", + .zsf_spork8 => "spork8", else => unreachable, }; } @@ -140,7 +140,7 @@ pub const AnyMir = union { .stage2_wasm, .stage2_c, .stage2_spirv, - .stage2_spork8, + .zsf_spork8, => |backend_ct| @field(mir, tag(backend_ct)).deinit(gpa), } } @@ -170,7 +170,7 @@ pub fn generateFunction( .stage2_x86_64, .stage2_wasm, .stage2_c, - .stage2_spork8, + .zsf_spork8, .stage2_spirv, => |backend| { dev.check(devFeatureForBackend(backend)); diff --git a/src/link.zig b/src/link.zig index 1e9cbb18c059511eba1a631f21ed18068d3fdf35..9e200d1d1c850062ccfc5e95cfa10e74fcd98411 100644 --- a/src/link.zig +++ b/src/link.zig @@ -1300,9 +1300,11 @@ pub const File = struct { .plan9 => .plan9, .c => .c, .spirv => .spirv, - .spork8 => .spork8, .hex => @panic("TODO implement hex object format"), - .raw => @panic("TODO implement raw object format"), + // This may seem surprising at first, but with a little massaging, the spork8 linker + // could and probably should be generalized into a "raw linker" which is used to output + // bare machine code for any architecture for which a corresponding backend exists. + .raw => .spork8, }; } diff --git a/src/link/Spork8.zig b/src/link/Spork8.zig index 1baa60d166b667c20855b03b8a613509f7d0073f..3487387c55b2d52580494793ce34c5e11a36a764 100644 --- a/src/link/Spork8.zig +++ b/src/link/Spork8.zig @@ -47,7 +47,7 @@ pub fn createEmpty( options: link.File.OpenOptions, ) !*Spork8 { const target = comp.root_mod.resolved_target.result; - assert(target.ofmt == .spork8); + assert(target.ofmt == .raw); assert(comp.config.output_mode == .Exe); const io = comp.io; @@ -90,7 +90,7 @@ pub fn updateFunc( any_mir: *const codegen.AnyMir, ) !void { dev.check(.spork8_backend); - // This linker implementation only works with codegen backend `.stage2_spork8`. + // This linker implementation only works with `std.lang.CompilerBackend.zsf_spork8`. const mir = &any_mir.spork8; const zcu = pt.zcu; const gpa = zcu.gpa; diff --git a/src/target.zig b/src/target.zig index 02cd9c2f93561df3b191aa6e47be1e8b97eda5aa..48c29feb3899b97ce0a47f83cb64f6435263a435 100644 --- a/src/target.zig +++ b/src/target.zig @@ -189,7 +189,6 @@ pub fn hasLlvmSupport(target: *const std.Target, ofmt: std.Target.ObjectFormat) // LLVM does not support these object formats: .c, .plan9, - .spork8, => return false, .coff,