| ... | @@ -18,7 +18,6 @@ const start_sym_name = if (native_arch.isMIPS()) "__start" else "_start"; | ... | @@ -18,7 +18,6 @@ const start_sym_name = if (native_arch.isMIPS()) "__start" else "_start"; |
| 18 | // Until then, we have simplified logic here for self-hosted. TODO remove this once | 18 | // Until then, we have simplified logic here for self-hosted. TODO remove this once |
| 19 | // self-hosted is capable enough to handle all of the real start.zig logic. | 19 | // self-hosted is capable enough to handle all of the real start.zig logic. |
| 20 | pub const simplified_logic = | 20 | pub const simplified_logic = |
| 21 | builtin.zig_backend == .stage2_wasm or | | |
| 22 | (builtin.zig_backend == .stage2_x86_64 and (builtin.link_libc or builtin.os.tag == .plan9)) or | 21 | (builtin.zig_backend == .stage2_x86_64 and (builtin.link_libc or builtin.os.tag == .plan9)) or |
| 23 | builtin.zig_backend == .stage2_x86 or | 22 | builtin.zig_backend == .stage2_x86 or |
| 24 | builtin.zig_backend == .stage2_aarch64 or | 23 | builtin.zig_backend == .stage2_aarch64 or |
| ... | @@ -43,8 +42,6 @@ comptime { | ... | @@ -43,8 +42,6 @@ comptime { |
| 43 | if (!@hasDecl(root, "wWinMainCRTStartup") and !@hasDecl(root, "mainCRTStartup")) { | 42 | if (!@hasDecl(root, "wWinMainCRTStartup") and !@hasDecl(root, "mainCRTStartup")) { |
| 44 | @export(wWinMainCRTStartup2, .{ .name = "wWinMainCRTStartup" }); | 43 | @export(wWinMainCRTStartup2, .{ .name = "wWinMainCRTStartup" }); |
| 45 | } | 44 | } |
| 46 | } else if (builtin.os.tag == .wasi and @hasDecl(root, "main")) { | | |
| 47 | @export(wasiMain2, .{ .name = "_start" }); | | |
| 48 | } else if (builtin.os.tag == .opencl) { | 45 | } else if (builtin.os.tag == .opencl) { |
| 49 | if (@hasDecl(root, "main")) | 46 | if (@hasDecl(root, "main")) |
| 50 | @export(spirvMain2, .{ .name = "main" }); | 47 | @export(spirvMain2, .{ .name = "main" }); |
| ... | @@ -116,22 +113,6 @@ fn callMain2() noreturn { | ... | @@ -116,22 +113,6 @@ fn callMain2() noreturn { |
| 116 | exit2(0); | 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 | fn spirvMain2() callconv(.Kernel) void { | 116 | fn spirvMain2() callconv(.Kernel) void { |
| 136 | root.main(); | 117 | root.main(); |
| 137 | } | 118 | } |