From c931bc73948a794301ebbe33d429614dc9dcf534 Mon Sep 17 00:00:00 2001 From: Ayke van Laethem Date: Tue, 27 Aug 2024 15:47:19 +0200 Subject: [PATCH] wasip2: do not export the _start function It seems to have been replaced with the Component Model `run` function. --- src/runtime/runtime_wasm_wasip2.go | 10 +--------- targets/wasip2.json | 3 ++- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/src/runtime/runtime_wasm_wasip2.go b/src/runtime/runtime_wasm_wasip2.go index ca189aad..57e6623d 100644 --- a/src/runtime/runtime_wasm_wasip2.go +++ b/src/runtime/runtime_wasm_wasip2.go @@ -13,19 +13,11 @@ type timeUnit int64 //export wasi:cli/run@0.2.0#run func __wasi_cli_run_run() uint32 { - _start() - return 0 -} - -//export _start -func _start() { // These need to be initialized early so that the heap can be initialized. heapStart = uintptr(unsafe.Pointer(&heapStartSymbol)) heapEnd = uintptr(wasm_memory_size(0) * wasmPageSize) run() -} - -func init() { + return 0 } var args []string diff --git a/targets/wasip2.json b/targets/wasip2.json index 3d6f68c6..7735e12d 100644 --- a/targets/wasip2.json +++ b/targets/wasip2.json @@ -17,7 +17,8 @@ ], "ldflags": [ "--stack-first", - "--no-demangle" + "--no-demangle", + "--no-entry" ], "extra-files": [ "src/runtime/asm_tinygowasm.S"