aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2022-01-13 15:18:47 +0000
committergingerBill <bill@gingerbill.org>2022-01-13 15:18:47 +0000
commite15f71466005ff84c6dc97cbfbd10d57f1193e7a (patch)
tree9ed6c6e25114c2599a90e7ec36f767aa63b43c7d
parent4f77151ebc7b9cd19f610545cf23a25a7373276d (diff)
Define wasm `_start` entry point in Odin code
-rw-r--r--core/runtime/entry_wasm.odin19
1 files changed, 19 insertions, 0 deletions
diff --git a/core/runtime/entry_wasm.odin b/core/runtime/entry_wasm.odin
new file mode 100644
index 000000000..125abc756
--- /dev/null
+++ b/core/runtime/entry_wasm.odin
@@ -0,0 +1,19 @@
+//+private
+//+build wasm32, wasm64
+package runtime
+
+import "core:intrinsics"
+
+when !ODIN_TEST && !ODIN_NO_ENTRY_POINT {
+ @(link_name="_start", linkage="strong", require, export)
+ _start :: proc "c" () {
+ context = default_context()
+ #force_no_inline _startup_runtime()
+ intrinsics.__entry_point()
+ }
+ @(link_name="_end", linkage="strong", require, export)
+ _end :: proc "c" () {
+ context = default_context()
+ #force_no_inline _cleanup_runtime()
+ }
+} \ No newline at end of file