Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wasm/js: use standard library syscall package #4461

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
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
3 changes: 2 additions & 1 deletion interp/interpreter.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,8 @@ func (r *runner) run(fn *function, params []value, parentMem *memoryView, indent
// already be emitted in initAll.
continue
case strings.HasPrefix(callFn.name, "runtime.print") || callFn.name == "runtime._panic" || callFn.name == "runtime.hashmapGet" || callFn.name == "runtime.hashmapInterfaceHash" ||
callFn.name == "os.runtime_args" || callFn.name == "internal/task.start" || callFn.name == "internal/task.Current" ||
callFn.name == "os.runtime_args" || callFn.name == "syscall.runtime_envs" ||
callFn.name == "internal/task.start" || callFn.name == "internal/task.Current" ||
callFn.name == "time.startTimer" || callFn.name == "time.stopTimer" || callFn.name == "time.resetTimer":
// These functions should be run at runtime. Specifically:
// * Print and panic functions are best emitted directly without
Expand Down
2 changes: 1 addition & 1 deletion loader/goroot.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ func listGorootMergeLinks(goroot, tinygoroot string, overrides map[string]bool)
// with the TinyGo version. This is the case on some targets.
func needsSyscallPackage(buildTags []string) bool {
for _, tag := range buildTags {
if tag == "baremetal" || tag == "nintendoswitch" || tag == "tinygo.wasm" {
if tag == "baremetal" || tag == "nintendoswitch" || tag == "wasip1" || tag == "wasip2" || tag == "wasm_unknown" {
return true
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/syscall/file_emulated.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//go:build baremetal || (wasm && !wasip1 && !wasip2) || wasm_unknown
//go:build baremetal || wasm_unknown

// This file emulates some file-related functions that are only available
// under a real operating system.
Expand Down
2 changes: 1 addition & 1 deletion src/syscall/file_hosted.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//go:build !(baremetal || (wasm && !wasip1 && !wasip2) || wasm_unknown)
//go:build !(baremetal || wasm_unknown)

// This file assumes there is a libc available that runs on a real operating
// system.
Expand Down
2 changes: 1 addition & 1 deletion src/syscall/syscall_nonhosted.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//go:build baremetal || js || wasm_unknown
//go:build baremetal || wasm_unknown

package syscall

Expand Down
2 changes: 1 addition & 1 deletion src/syscall/tables_nonhosted.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build baremetal || nintendoswitch || js || wasm_unknown
//go:build baremetal || nintendoswitch || wasm_unknown

package syscall

Expand Down
Loading