| ... | ... | @@ -18,7 +18,6 @@ const start_sym_name = if (native_arch.isMIPS()) "__start" else "_start"; |
| 18 | 18 | // Until then, we have simplified logic here for self-hosted. TODO remove this once |
| 19 | 19 | // self-hosted is capable enough to handle all of the real start.zig logic. |
| 20 | 20 | pub const simplified_logic = |
| 21 | | builtin.zig_backend == .stage2_wasm or |
| 22 | 21 | (builtin.zig_backend == .stage2_x86_64 and (builtin.link_libc or builtin.os.tag == .plan9)) or |
| 23 | 22 | builtin.zig_backend == .stage2_x86 or |
| 24 | 23 | builtin.zig_backend == .stage2_aarch64 or |
| ... | ... | @@ -43,8 +42,6 @@ comptime { |
| 43 | 42 | if (!@hasDecl(root, "wWinMainCRTStartup") and !@hasDecl(root, "mainCRTStartup")) { |
| 44 | 43 | @export(wWinMainCRTStartup2, .{ .name = "wWinMainCRTStartup" }); |
| 45 | 44 | } |
| 46 | | } else if (builtin.os.tag == .wasi and @hasDecl(root, "main")) { |
| 47 | | @export(wasiMain2, .{ .name = "_start" }); |
| 48 | 45 | } else if (builtin.os.tag == .opencl) { |
| 49 | 46 | if (@hasDecl(root, "main")) |
| 50 | 47 | @export(spirvMain2, .{ .name = "main" }); |
| ... | ... | @@ -116,22 +113,6 @@ fn callMain2() noreturn { |
| 116 | 113 | exit2(0); |
| 117 | 114 | } |
| 118 | 115 | |
| 119 | | fn wasiMain2() callconv(.C) noreturn { |
| 120 | | switch (@typeInfo(@typeInfo(@TypeOf(root.main)).Fn.return_type.?)) { |
| 121 | | .Void => { |
| 122 | | root.main(); |
| 123 | | std.os.wasi.proc_exit(0); |
| 124 | | }, |
| 125 | | .Int => |info| { |
| 126 | | if (info.bits != 8 or info.signedness == .signed) { |
| 127 | | @compileError(bad_main_ret); |
| 128 | | } |
| 129 | | std.os.wasi.proc_exit(root.main()); |
| 130 | | }, |
| 131 | | else => @compileError("Bad return type main"), |
| 132 | | } |
| 133 | | } |
| 134 | | |
| 135 | 116 | fn spirvMain2() callconv(.Kernel) void { |
| 136 | 117 | root.main(); |
| 137 | 118 | } |