authorgravatar for luuk@degram.devLuuk de Gram <luuk@degram.dev> 2021-11-22 21:16:55+01:00
committergravatar for luuk@degram.devLuuk de Gram <luuk@degram.dev> 2021-11-27 21:34:48+01:00
log90d8544d4066a8aa42f1fe1d8cd052e8099d8152
tree3be673b24da16548ed09cf57acb09c87f4be4471
parentaa61e03f244a72ea01f05c3ceea7c5fb5aadf1ff
signaturelock-open Commit is signed but in an unrecognized format.

wasm: Add temporary stage2 entrypoint for wasm


1 files changed, 7 insertions(+), 0 deletions(-)

lib/std/start.zig+7
...@@ -30,6 +30,8 @@ comptime {...@@ -30,6 +30,8 @@ comptime {
30 }30 }
31 } else if (builtin.os.tag == .windows) {31 } else if (builtin.os.tag == .windows) {
32 @export(wWinMainCRTStartup2, .{ .name = "wWinMainCRTStartup" });32 @export(wWinMainCRTStartup2, .{ .name = "wWinMainCRTStartup" });
33 } else if (builtin.os.tag == .wasi) {
34 @export(wasmMain2, .{ .name = "_start" });
33 } else {35 } else {
34 if (!@hasDecl(root, "_start")) {36 if (!@hasDecl(root, "_start")) {
35 @export(_start2, .{ .name = "_start" });37 @export(_start2, .{ .name = "_start" });
...@@ -98,6 +100,11 @@ fn callMain2() noreturn {...@@ -98,6 +100,11 @@ fn callMain2() noreturn {
98 exit2(0);100 exit2(0);
99}101}
100102
103fn wasmMain2() u8 {
104 root.main();
105 return 0;
106}
107
101fn wWinMainCRTStartup2() callconv(.C) noreturn {108fn wWinMainCRTStartup2() callconv(.C) noreturn {
102 root.main();109 root.main();
103 exit2(0);110 exit2(0);