make runtime compatible with wasm

This commit is contained in:
Li Jie
2025-04-08 16:50:47 +08:00
parent 7c81d9293b
commit be4737461a
183 changed files with 14122 additions and 647 deletions

View File

@@ -1,9 +1,7 @@
//go:build !wasm
package debug
/*
#cgo linux LDFLAGS: -lunwind
*/
import "C"
import (
"unsafe"
@@ -11,8 +9,7 @@ import (
)
const (
LLGoPackage = "link"
LLGoFiles = "_wrap/debug.c"
LLGoFiles = "_wrap/debug.c"
)
type Info struct {

View File

@@ -0,0 +1,33 @@
package debug
import (
"unsafe"
c "github.com/goplus/llgo/runtime/internal/clite"
)
type Info struct {
Fname *c.Char
Fbase c.Pointer
Sname *c.Char
Saddr c.Pointer
}
func Address() unsafe.Pointer {
panic("not implemented")
}
func Addrinfo(addr unsafe.Pointer, info *Info) c.Int {
panic("not implemented")
}
type Frame struct {
PC uintptr
Offset uintptr
SP unsafe.Pointer
Name string
}
func StackTrace(skip int, fn func(fr *Frame) bool) {
panic("not implemented")
}

View File

@@ -0,0 +1,7 @@
//go:build !linux
package debug
const (
LLGoPackage = "link"
)

View File

@@ -0,0 +1,7 @@
//go:build linux
package debug
const (
LLGoPackage = "link: -lunwind"
)