wasm: add support for GOOS=wasip1

This adds true GOOS=wasip1 support in addition to our existing
-target=wasi support. The old support for WASI isn't removed, but should
be treated as deprecated and will likely be removed eventually to reduce
the test burden.
This commit is contained in:
Ayke van Laethem
2023-08-10 22:36:35 +02:00
committed by Ron Evans
parent f4375d0452
commit a545f17d2e
40 changed files with 99 additions and 38 deletions
+1 -1
View File
@@ -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 linux && !baremetal && !wasi
//go:build linux && !baremetal && !wasi && !wasip1
package os
+1 -1
View File
@@ -6,7 +6,7 @@
// fairly similar: we use fdopendir, fdclosedir, and readdir from wasi-libc in
// a similar way that the darwin code uses functions from libc.
//go:build wasi
//go:build wasi || wasip1
package os
+1 -1
View File
@@ -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 darwin || linux
//go:build darwin || linux || wasip1
package os_test
+1 -1
View File
@@ -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 aix || darwin || dragonfly || freebsd || (js && wasm) || linux || netbsd || openbsd || solaris || windows
//go:build aix || darwin || dragonfly || freebsd || (js && wasm) || linux || netbsd || openbsd || solaris || wasip1 || windows
package os
+1 -1
View File
@@ -1,4 +1,4 @@
//go:build baremetal || (wasm && !wasi)
//go:build baremetal || (wasm && !wasi && !wasip1)
package os
+1 -1
View File
@@ -1,4 +1,4 @@
//go:build darwin || (linux && !baremetal)
//go:build darwin || (linux && !baremetal) || wasip1
// target wasi sets GOOS=linux and thus the +linux build tag,
// even though it doesn't show up in "tinygo info target -wasi"
+1 -1
View File
@@ -1,4 +1,4 @@
//go:build windows || darwin || (linux && !baremetal)
//go:build windows || darwin || (linux && !baremetal) || wasip1
package os_test
+1 -1
View File
@@ -1,4 +1,4 @@
//go:build !wasi
//go:build !wasi && !wasip1
package os_test
+1 -1
View File
@@ -1,4 +1,4 @@
//go:build wasi
//go:build wasi || wasip1
package os_test
+1 -2
View File
@@ -1,4 +1,4 @@
//go:build windows || darwin || (linux && !baremetal)
//go:build windows || darwin || (linux && !baremetal) || wasip1
package os_test
@@ -23,7 +23,6 @@ var dot = []string{
"os_test.go",
"types.go",
"stat_darwin.go",
"stat_linux.go",
}
func randomName() string {
+1 -1
View File
@@ -1,4 +1,4 @@
//go:build !baremetal && !js && !wasi
//go:build !baremetal && !js && !wasi && !wasip1
// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
+1 -1
View File
@@ -1,4 +1,4 @@
//go:build !windows && !baremetal && !js && !wasi
//go:build !windows && !baremetal && !js && !wasi && !wasip1
// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
+1 -1
View File
@@ -1,4 +1,4 @@
//go:build !baremetal && !js && !wasi
//go:build !baremetal && !js && !wasi && !wasip1
// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
+1 -1
View File
@@ -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 && !js && !wasi
//go:build !baremetal && !js && !wasi && !wasip1
package os
+1 -1
View File
@@ -1,4 +1,4 @@
//go:build baremetal || js || wasi
//go:build baremetal || js || wasi || wasip1
// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
@@ -1,9 +1,13 @@
//go:build linux && !baremetal
//go:build (linux && !baremetal) || wasip1
// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Note: this file is used for both Linux and WASI.
// Eventually it might be better to spit it up, and make the syscall constants
// match the typical WASI constants instead of the Linux-equivalents used here.
package os
import (
+1 -1
View File
@@ -1,4 +1,4 @@
//go:build baremetal || (wasm && !wasi)
//go:build baremetal || (wasm && !wasi && !wasip1)
// Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
+1 -1
View File
@@ -1,4 +1,4 @@
//go:build darwin || (linux && !baremetal)
//go:build darwin || (linux && !baremetal) || wasip1
// Copyright 2016 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
+1 -1
View File
@@ -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 && !js && !wasi
//go:build !baremetal && !js && !wasi && !wasip1
package os_test
+1 -1
View File
@@ -1,4 +1,4 @@
//go:build darwin || (linux && !baremetal)
//go:build darwin || (linux && !baremetal) || wasip1
// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style