tinygo
tinygo copied to clipboard
stub runtime_{Before,After}Exec for linkage
Fixes:
u-root/cmds/core/init$ GOARCH={arm64,amd64} tinygo build -tags noasm
/usr/lib/go-1.22/src/syscall/exec_unix.go:282: linker could not find symbol syscall.runtime_BeforeExec
/usr/lib/go-1.22/src/syscall/exec_unix.go:308: linker could not find symbol syscall.runtime_AfterExec
I copied BigGo/src/runtime/proc.go for this, duplicating the //go:linkname
In BigGo, exec calls are serialized because of golang/go#19546 but uses a rwlock whose implementation would require a lot of file import from BigGo or a merge of tinygo/bigGo runtime against current policy. I may follow this up with a simple sync/Mutex.
@leongross ?
I think you are addressing an important issue here, that has not been taken care of atm. I tried to implement sth similar bit quite did not get it working, although this would be a great benefit.
I think you are addressing an important issue here, that has not been taken care of atm. I tried to implement sth similar bit quite did not get it working, although this would be a great benefit.
I saw your PR. I haven't pulled it / attempted to run it but I think it's missing these stubs for some reason? Does it work without them?
@aykevl @deadprogram
On a kind of related note: https://github.com/tinygo-org/tinygo/pull/4384 implements the missing signals so the linker does not break the compilation
Thank you for the PR @archie2x and to @leongross for review. Now merging.
Thanks @deadprogram for merging.