Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions compiler/symbol.go
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,13 @@ func (c *compilerContext) parsePragmas(info *functionInfo, f *ssa.Function) {
}
}
}

// If both //go:wasmexport and //go:export or //export are declared,
// only honor go:wasmexport.
if info.wasmExport != "" {
// TODO: log warning?
info.exported = false
}
}

// Check whether this function can be used in //go:wasmimport or
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,19 @@ import (
"unsafe"

"internal/wasi/cli/v0.2.0/environment"
wasiclirun "internal/wasi/cli/v0.2.0/run"
monotonicclock "internal/wasi/clocks/v0.2.0/monotonic-clock"

"internal/cm"
)

type timeUnit int64

//export wasi:cli/[email protected]#run
func __wasi_cli_run_run() uint32 {
// 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()
return 0
func init() {
wasiclirun.Exports.Run = func() cm.BoolResult {
callMain()
return false
}
}

var args []string
Expand Down Expand Up @@ -51,3 +52,6 @@ func sleepTicks(d timeUnit) {
func ticks() timeUnit {
return timeUnit(monotonicclock.Now())
}

func beforeExit() {
}
2 changes: 1 addition & 1 deletion src/runtime/runtime_wasmentry.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//go:build tinygo.wasm && !wasip2 && !js
//go:build tinygo.wasm && !js

package runtime

Expand Down
1 change: 1 addition & 0 deletions targets/wasip2.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"cpu": "generic",
"features": "+bulk-memory,+mutable-globals,+nontrapping-fptoint,+sign-ext",
"build-tags": ["tinygo.wasm", "wasip2"],
"buildmode": "c-shared",
"goos": "linux",
"goarch": "arm",
"linker": "wasm-ld",
Expand Down
Loading