mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-07-26 06:38:42 +00:00
2d477e069d
Go 1.26 changed syscall.loadlibrary, syscall.loadsystemlibrary, and syscall.getprocaddress from declarations to definitions in syscall/dll_windows.go. TinyGo's runtime also defines these via //go:linkname, causing "symbol multiply defined!" during LLVM module linking. Resolve this by detecting duplicate function definitions before calling llvm.LinkModules and turning the incoming duplicate into a declaration, so the runtime's version wins. TinyGo's implementations must take precedence because Go 1.26's versions depend on //go:cgo_import_dynamic, which TinyGo does not support. Also fix the signature of syscall_loadsystemlibrary to match the standard library (remove unused absoluteFilepath parameter). Signed-off-by: deadprogram <ron@hybridgroup.com>