-
- Downloads
cmd/link, runtime: support library mode on wasip1
This CL adds support of "library", i.e. c-shared, build mode on wasip1. When -buildmode=c-shared is set, it builds a Wasm module that is intended to be used as a library, instead of an executable. It does not have the _start function. Instead, it has an _initialize function, which initializes the runtime, but not call the main function. This is similar to the c-shared build mode on other platforms. One difference is that unlike cgo callbacks, where Ms are created on- demand, on Wasm we have only one M, so we just keep the M (and the G) for callbacks. For #65199. Change-Id: Ieb21da96b25c1a9f3989d945cddc964c26f9085b Reviewed-on: https://go-review.googlesource.com/c/go/+/604316 Reviewed-by:Achille Roussel <achille.roussel@gmail.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by:
Michael Knyszek <mknyszek@google.com>
Showing
- src/cmd/dist/test.go 2 additions, 1 deletionsrc/cmd/dist/test.go
- src/cmd/go/internal/load/pkg.go 6 additions, 1 deletionsrc/cmd/go/internal/load/pkg.go
- src/cmd/internal/obj/wasm/wasmobj.go 3 additions, 1 deletionsrc/cmd/internal/obj/wasm/wasmobj.go
- src/cmd/link/internal/ld/config.go 3 additions, 0 deletionssrc/cmd/link/internal/ld/config.go
- src/cmd/link/internal/ld/symtab.go 1 addition, 1 deletionsrc/cmd/link/internal/ld/symtab.go
- src/cmd/link/internal/wasm/asm.go 18 additions, 2 deletionssrc/cmd/link/internal/wasm/asm.go
- src/internal/platform/supported.go 2 additions, 1 deletionsrc/internal/platform/supported.go
- src/runtime/asm_wasm.s 6 additions, 0 deletionssrc/runtime/asm_wasm.s
- src/runtime/lock_js.go 0 additions, 3 deletionssrc/runtime/lock_js.go
- src/runtime/proc.go 14 additions, 1 deletionsrc/runtime/proc.go
- src/runtime/rt0_js_wasm.s 0 additions, 6 deletionssrc/runtime/rt0_js_wasm.s
- src/runtime/rt0_wasip1_wasm.s 4 additions, 0 deletionssrc/runtime/rt0_wasip1_wasm.s
- src/runtime/stubs_nonwasm.go 10 additions, 0 deletionssrc/runtime/stubs_nonwasm.go
- src/runtime/stubs_wasm.go 16 additions, 0 deletionssrc/runtime/stubs_wasm.go
Loading
Please register or sign in to comment