authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-05-27 17:08:28-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-05-29 15:22:48-07:00
logbf959666e8013518660b188a365cbd383d516af3
tree21a19ad0d4c9a39db0b56ca87032f2837dc2055f
parentb3c6a3b047cb248afb0d61ae723ae41aeab9289b

compiler: don't depend on skip_non_native option

The dev environment system solves this use case better

4 files changed, 0 insertions(+), 33 deletions(-)

build.zig-1
......@@ -233,7 +233,6 @@ pub fn build(b: *std.Build) !void {
233233 exe.root_module.addOptions("build_options", exe_options);
234234
235235 exe_options.addOption(u32, "mem_leak_frames", mem_leak_frames);
236 exe_options.addOption(bool, "skip_non_native", skip_non_native);
237236 exe_options.addOption(bool, "have_llvm", enable_llvm);
238237 exe_options.addOption(bool, "llvm_has_m68k", llvm_has_m68k);
239238 exe_options.addOption(bool, "llvm_has_csky", llvm_has_csky);
src/link/Elf.zig-12
......@@ -1691,9 +1691,6 @@ pub fn updateFunc(
16911691 func_index: InternPool.Index,
16921692 mir: *const codegen.AnyMir,
16931693) link.File.UpdateNavError!void {
1694 if (build_options.skip_non_native and builtin.object_format != .elf) {
1695 @panic("Attempted to compile for object format that was disabled by build configuration");
1696 }
16971694 return self.zigObjectPtr().?.updateFunc(self, pt, func_index, mir);
16981695}
16991696
......@@ -1702,9 +1699,6 @@ pub fn updateNav(
17021699 pt: Zcu.PerThread,
17031700 nav: InternPool.Nav.Index,
17041701) link.File.UpdateNavError!void {
1705 if (build_options.skip_non_native and builtin.object_format != .elf) {
1706 @panic("Attempted to compile for object format that was disabled by build configuration");
1707 }
17081702 return self.zigObjectPtr().?.updateNav(self, pt, nav);
17091703}
17101704
......@@ -1714,9 +1708,6 @@ pub fn updateContainerType(
17141708 ty: InternPool.Index,
17151709 success: bool,
17161710) link.File.UpdateContainerTypeError!void {
1717 if (build_options.skip_non_native and builtin.object_format != .elf) {
1718 @panic("Attempted to compile for object format that was disabled by build configuration");
1719 }
17201711 return self.zigObjectPtr().?.updateContainerType(pt, ty, success) catch |err| switch (err) {
17211712 error.OutOfMemory => |e| return e,
17221713 };
......@@ -1728,9 +1719,6 @@ pub fn updateExports(
17281719 exported: Zcu.Exported,
17291720 export_indices: []const Zcu.Export.Index,
17301721) link.File.UpdateExportsError!void {
1731 if (build_options.skip_non_native and builtin.object_format != .elf) {
1732 @panic("Attempted to compile for object format that was disabled by build configuration");
1733 }
17341722 return self.zigObjectPtr().?.updateExports(self, pt, exported, export_indices);
17351723}
17361724
src/link/MachO.zig-9
......@@ -3075,16 +3075,10 @@ pub fn updateFunc(
30753075 func_index: InternPool.Index,
30763076 mir: *const codegen.AnyMir,
30773077) link.File.UpdateNavError!void {
3078 if (build_options.skip_non_native and builtin.object_format != .macho) {
3079 @panic("Attempted to compile for object format that was disabled by build configuration");
3080 }
30813078 return self.getZigObject().?.updateFunc(self, pt, func_index, mir);
30823079}
30833080
30843081pub fn updateNav(self: *MachO, pt: Zcu.PerThread, nav: InternPool.Nav.Index) link.File.UpdateNavError!void {
3085 if (build_options.skip_non_native and builtin.object_format != .macho) {
3086 @panic("Attempted to compile for object format that was disabled by build configuration");
3087 }
30883082 return self.getZigObject().?.updateNav(self, pt, nav);
30893083}
30903084
......@@ -3098,9 +3092,6 @@ pub fn updateExports(
30983092 exported: Zcu.Exported,
30993093 export_indices: []const Zcu.Export.Index,
31003094) link.File.UpdateExportsError!void {
3101 if (build_options.skip_non_native and builtin.object_format != .macho) {
3102 @panic("Attempted to compile for object format that was disabled by build configuration");
3103 }
31043095 return self.getZigObject().?.updateExports(self, pt, exported, export_indices);
31053096}
31063097
src/link/Wasm.zig-11
......@@ -3192,10 +3192,6 @@ pub fn updateFunc(
31923192 func_index: InternPool.Index,
31933193 any_mir: *const codegen.AnyMir,
31943194) !void {
3195 if (build_options.skip_non_native and builtin.object_format != .wasm) {
3196 @panic("Attempted to compile for object format that was disabled by build configuration");
3197 }
3198
31993195 dev.check(.wasm_backend);
32003196
32013197 // This linker implementation only works with codegen backend `.stage2_wasm`.
......@@ -3279,9 +3275,6 @@ pub fn updateFunc(
32793275// Generate code for the "Nav", storing it in memory to be later written to
32803276// the file on flush().
32813277pub fn updateNav(wasm: *Wasm, pt: Zcu.PerThread, nav_index: InternPool.Nav.Index) !void {
3282 if (build_options.skip_non_native and builtin.object_format != .wasm) {
3283 @panic("Attempted to compile for object format that was disabled by build configuration");
3284 }
32853278 const zcu = pt.zcu;
32863279 const ip = &zcu.intern_pool;
32873280 const nav = ip.getNav(nav_index);
......@@ -3378,10 +3371,6 @@ pub fn updateExports(
33783371 exported: Zcu.Exported,
33793372 export_indices: []const Zcu.Export.Index,
33803373) !void {
3381 if (build_options.skip_non_native and builtin.object_format != .wasm) {
3382 @panic("Attempted to compile for object format that was disabled by build configuration");
3383 }
3384
33853374 const zcu = pt.zcu;
33863375 const gpa = zcu.gpa;
33873376 const ip = &zcu.intern_pool;