build: fix link runtime multiple times

This commit is contained in:
xushiwei
2024-05-01 13:30:13 +08:00
parent 8ae97f73d0
commit 014d0262da
4 changed files with 150 additions and 10 deletions

View File

@@ -1,14 +1,12 @@
package main
import (
"unsafe"
"github.com/goplus/llgo/internal/runtime/c"
)
func main() {
s := c.Str("Hi\n")
s2 := c.Alloca(4)
c.Memcpy(s2, unsafe.Pointer(s), 4)
c.Memcpy(s2, c.Pointer(s), 4)
c.Printf(c.Str("%s"), s2)
}