aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/syscall
diff options
context:
space:
mode:
authorAyke van Laethem <[email protected]>2024-11-18 11:49:30 +0100
committerAyke <[email protected]>2024-11-19 07:51:58 +0100
commit0087d4c6bf13a1bac648b0e61459d717bae87b02 (patch)
tree0c75b286e01daa580468482305ef044a1d7cc4a0 /src/syscall
parent289fceb3eaf0829d1e3b65228b95a79bd5fc9389 (diff)
downloadtinygo-0087d4c6bf13a1bac648b0e61459d717bae87b02.tar.gz
tinygo-0087d4c6bf13a1bac648b0e61459d717bae87b02.zip
syscall: use wasi-libc tables for wasm/js target
Instead of using fake tables for errno and others, use the ones that correspond to wasi-libc.
Diffstat (limited to 'src/syscall')
-rw-r--r--src/syscall/errno_other.go2
-rw-r--r--src/syscall/errno_wasilibc.go (renamed from src/syscall/errno_wasip1.go)2
-rw-r--r--src/syscall/syscall_libc.go2
-rw-r--r--src/syscall/syscall_libc_wasi.go4
-rw-r--r--src/syscall/syscall_nonhosted.go2
-rw-r--r--src/syscall/tables_nonhosted.go2
6 files changed, 8 insertions, 6 deletions
diff --git a/src/syscall/errno_other.go b/src/syscall/errno_other.go
index 3a06ac018..8c58f5f01 100644
--- a/src/syscall/errno_other.go
+++ b/src/syscall/errno_other.go
@@ -1,4 +1,4 @@
-//go:build !wasip1 && !wasip2
+//go:build !js && !wasip1 && !wasip2
package syscall
diff --git a/src/syscall/errno_wasip1.go b/src/syscall/errno_wasilibc.go
index c494d7da0..efb97260f 100644
--- a/src/syscall/errno_wasip1.go
+++ b/src/syscall/errno_wasilibc.go
@@ -1,4 +1,4 @@
-//go:build wasip1
+//go:build wasip1 || js
package syscall
diff --git a/src/syscall/syscall_libc.go b/src/syscall/syscall_libc.go
index d8293efde..0ef978428 100644
--- a/src/syscall/syscall_libc.go
+++ b/src/syscall/syscall_libc.go
@@ -1,4 +1,4 @@
-//go:build nintendoswitch || wasip1 || wasip2
+//go:build js || nintendoswitch || wasip1 || wasip2
package syscall
diff --git a/src/syscall/syscall_libc_wasi.go b/src/syscall/syscall_libc_wasi.go
index 06169bb2b..bbf81cd05 100644
--- a/src/syscall/syscall_libc_wasi.go
+++ b/src/syscall/syscall_libc_wasi.go
@@ -1,4 +1,6 @@
-//go:build wasip1 || wasip2
+//go:build js || wasip1 || wasip2
+
+// Note: also including js in here because it also uses wasi-libc.
package syscall
diff --git a/src/syscall/syscall_nonhosted.go b/src/syscall/syscall_nonhosted.go
index 4867d70f6..a0965692f 100644
--- a/src/syscall/syscall_nonhosted.go
+++ b/src/syscall/syscall_nonhosted.go
@@ -1,4 +1,4 @@
-//go:build baremetal || js || wasm_unknown
+//go:build baremetal || wasm_unknown
package syscall
diff --git a/src/syscall/tables_nonhosted.go b/src/syscall/tables_nonhosted.go
index e66620cbf..a45834827 100644
--- a/src/syscall/tables_nonhosted.go
+++ b/src/syscall/tables_nonhosted.go
@@ -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