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 {...@@ -233,7 +233,6 @@ pub fn build(b: *std.Build) !void {
233 exe.root_module.addOptions("build_options", exe_options);233 exe.root_module.addOptions("build_options", exe_options);
234234
235 exe_options.addOption(u32, "mem_leak_frames", mem_leak_frames);235 exe_options.addOption(u32, "mem_leak_frames", mem_leak_frames);
236 exe_options.addOption(bool, "skip_non_native", skip_non_native);
237 exe_options.addOption(bool, "have_llvm", enable_llvm);236 exe_options.addOption(bool, "have_llvm", enable_llvm);
238 exe_options.addOption(bool, "llvm_has_m68k", llvm_has_m68k);237 exe_options.addOption(bool, "llvm_has_m68k", llvm_has_m68k);
239 exe_options.addOption(bool, "llvm_has_csky", llvm_has_csky);238 exe_options.addOption(bool, "llvm_has_csky", llvm_has_csky);
src/link/Elf.zig-12
...@@ -1691,9 +1691,6 @@ pub fn updateFunc(...@@ -1691,9 +1691,6 @@ pub fn updateFunc(
1691 func_index: InternPool.Index,1691 func_index: InternPool.Index,
1692 mir: *const codegen.AnyMir,1692 mir: *const codegen.AnyMir,
1693) link.File.UpdateNavError!void {1693) 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 }
1697 return self.zigObjectPtr().?.updateFunc(self, pt, func_index, mir);1694 return self.zigObjectPtr().?.updateFunc(self, pt, func_index, mir);
1698}1695}
16991696
...@@ -1702,9 +1699,6 @@ pub fn updateNav(...@@ -1702,9 +1699,6 @@ pub fn updateNav(
1702 pt: Zcu.PerThread,1699 pt: Zcu.PerThread,
1703 nav: InternPool.Nav.Index,1700 nav: InternPool.Nav.Index,
1704) link.File.UpdateNavError!void {1701) 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 }
1708 return self.zigObjectPtr().?.updateNav(self, pt, nav);1702 return self.zigObjectPtr().?.updateNav(self, pt, nav);
1709}1703}
17101704
...@@ -1714,9 +1708,6 @@ pub fn updateContainerType(...@@ -1714,9 +1708,6 @@ pub fn updateContainerType(
1714 ty: InternPool.Index,1708 ty: InternPool.Index,
1715 success: bool,1709 success: bool,
1716) link.File.UpdateContainerTypeError!void {1710) 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 }
1720 return self.zigObjectPtr().?.updateContainerType(pt, ty, success) catch |err| switch (err) {1711 return self.zigObjectPtr().?.updateContainerType(pt, ty, success) catch |err| switch (err) {
1721 error.OutOfMemory => |e| return e,1712 error.OutOfMemory => |e| return e,
1722 };1713 };
...@@ -1728,9 +1719,6 @@ pub fn updateExports(...@@ -1728,9 +1719,6 @@ pub fn updateExports(
1728 exported: Zcu.Exported,1719 exported: Zcu.Exported,
1729 export_indices: []const Zcu.Export.Index,1720 export_indices: []const Zcu.Export.Index,
1730) link.File.UpdateExportsError!void {1721) 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 }
1734 return self.zigObjectPtr().?.updateExports(self, pt, exported, export_indices);1722 return self.zigObjectPtr().?.updateExports(self, pt, exported, export_indices);
1735}1723}
17361724
src/link/MachO.zig-9
...@@ -3075,16 +3075,10 @@ pub fn updateFunc(...@@ -3075,16 +3075,10 @@ pub fn updateFunc(
3075 func_index: InternPool.Index,3075 func_index: InternPool.Index,
3076 mir: *const codegen.AnyMir,3076 mir: *const codegen.AnyMir,
3077) link.File.UpdateNavError!void {3077) 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 }
3081 return self.getZigObject().?.updateFunc(self, pt, func_index, mir);3078 return self.getZigObject().?.updateFunc(self, pt, func_index, mir);
3082}3079}
30833080
3084pub fn updateNav(self: *MachO, pt: Zcu.PerThread, nav: InternPool.Nav.Index) link.File.UpdateNavError!void {3081pub 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 }
3088 return self.getZigObject().?.updateNav(self, pt, nav);3082 return self.getZigObject().?.updateNav(self, pt, nav);
3089}3083}
30903084
...@@ -3098,9 +3092,6 @@ pub fn updateExports(...@@ -3098,9 +3092,6 @@ pub fn updateExports(
3098 exported: Zcu.Exported,3092 exported: Zcu.Exported,
3099 export_indices: []const Zcu.Export.Index,3093 export_indices: []const Zcu.Export.Index,
3100) link.File.UpdateExportsError!void {3094) 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 }
3104 return self.getZigObject().?.updateExports(self, pt, exported, export_indices);3095 return self.getZigObject().?.updateExports(self, pt, exported, export_indices);
3105}3096}
31063097
src/link/Wasm.zig-11
...@@ -3192,10 +3192,6 @@ pub fn updateFunc(...@@ -3192,10 +3192,6 @@ pub fn updateFunc(
3192 func_index: InternPool.Index,3192 func_index: InternPool.Index,
3193 any_mir: *const codegen.AnyMir,3193 any_mir: *const codegen.AnyMir,
3194) !void {3194) !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
3199 dev.check(.wasm_backend);3195 dev.check(.wasm_backend);
32003196
3201 // This linker implementation only works with codegen backend `.stage2_wasm`.3197 // This linker implementation only works with codegen backend `.stage2_wasm`.
...@@ -3279,9 +3275,6 @@ pub fn updateFunc(...@@ -3279,9 +3275,6 @@ pub fn updateFunc(
3279// Generate code for the "Nav", storing it in memory to be later written to3275// Generate code for the "Nav", storing it in memory to be later written to
3280// the file on flush().3276// the file on flush().
3281pub fn updateNav(wasm: *Wasm, pt: Zcu.PerThread, nav_index: InternPool.Nav.Index) !void {3277pub 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 }
3285 const zcu = pt.zcu;3278 const zcu = pt.zcu;
3286 const ip = &zcu.intern_pool;3279 const ip = &zcu.intern_pool;
3287 const nav = ip.getNav(nav_index);3280 const nav = ip.getNav(nav_index);
...@@ -3378,10 +3371,6 @@ pub fn updateExports(...@@ -3378,10 +3371,6 @@ pub fn updateExports(
3378 exported: Zcu.Exported,3371 exported: Zcu.Exported,
3379 export_indices: []const Zcu.Export.Index,3372 export_indices: []const Zcu.Export.Index,
3380) !void {3373) !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
3385 const zcu = pt.zcu;3374 const zcu = pt.zcu;
3386 const gpa = zcu.gpa;3375 const gpa = zcu.gpa;
3387 const ip = &zcu.intern_pool;3376 const ip = &zcu.intern_pool;