tinygo-org / tinygo

Go compiler for small places. Microcontrollers, WebAssembly (WASM/WASI), and command-line tools. Based on LLVM.
https://tinygo.org
Other
14.72k stars 858 forks source link

tinygo build -gc none fails #4275

Open pierrec opened 1 month ago

pierrec commented 1 month ago

tinygo version 0.31.2 darwin/amd64 (using go version go1.22.3 and LLVM version 17.0.1)

tinygo build -gc none
ld.lld: error: undefined symbol: _runtime.alloc
>>> referenced by task_stack.go:75 (/usr/local/Cellar/tinygo/0.31.2/src/internal/task/task_stack.go:75)
>>>               /tmp/lto.tmp:(symbol _internal/task.start+0x19)
>>> referenced by task_stack.go:113 (/usr/local/Cellar/tinygo/0.31.2/src/internal/task/task_stack.go:113)
>>>               /tmp/lto.tmp:(symbol _internal/task.start+0xa)
failed to run tool: ld.lld
error: failed to link /var/folders/lb/nhsppbxs5_v27pn_x3kf66wc0000gn/T/tinygo1324987751/main: exit status 1

Note it works fine if used in combination of -scheduler none

dgryski commented 1 month ago

If you need a minimal garbage collector try -gc=leaking.

aykevl commented 3 weeks ago

This is the intended behavior. And one more reason why we should probably just remove this option.