cgo: add support for stdio in picolibc and wasi-libc

This adds support for stdio in picolibc and fixes wasm_exec.js so that
it can also support C puts. With this, C stdout works on all supported
platforms.
This commit is contained in:
Ayke van Laethem
2021-09-24 01:39:56 +02:00
committed by Ron Evans
parent 1645f45c1a
commit 14bb90c3c0
11 changed files with 158 additions and 7 deletions
+5
View File
@@ -46,6 +46,11 @@ func libc_free(ptr unsafe.Pointer) {
free(ptr)
}
//export runtime_putchar
func runtime_putchar(c byte) {
putchar(c)
}
//go:linkname syscall_Exit syscall.Exit
func syscall_Exit(code int) {
exit(code)