Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

linker could not find symbol ... #4828

Open
jakebailey opened this issue Mar 24, 2025 · 3 comments
Open

linker could not find symbol ... #4828

jakebailey opened this issue Mar 24, 2025 · 3 comments

Comments

@jakebailey
Copy link

I'm trying to build a version of the Go port of the TypeScript compiler with tinygo. The code is here: https://github.com/microsoft/typescript-go/tree/main/cmd/tsgo

When I just do a regular build, I get:

$ ~/tinygo/bin/tinygo build -o tsgo-tinygo ./cmd/tsgo
/home/jabaile/tinygo/src/internal/futex/futex_linux.c:24: linker could not find symbol syscall
../../../../usr/local/lib/tinygo/lib/bdwgc/misc.c:896: linker could not find symbol strtoul
../../../../usr/local/lib/tinygo/lib/bdwgc/misc.c:1037: linker could not find symbol open
../../../../usr/local/lib/tinygo/lib/bdwgc/misc.c:1128: linker could not find symbol atol
../../../../usr/local/lib/tinygo/lib/bdwgc/misc.c:1139: linker could not find symbol atoi
../../../../usr/local/lib/tinygo/lib/bdwgc/misc.c:1148: linker could not find symbol atol
../../../../usr/local/lib/tinygo/lib/bdwgc/misc.c:1160: linker could not find symbol atoi
../../../../usr/local/lib/tinygo/lib/bdwgc/misc.c:1173: linker could not find symbol atoi
../../../../usr/local/lib/tinygo/lib/bdwgc/os_dep.c:235: linker could not find symbol open
../../../../usr/local/lib/tinygo/lib/bdwgc/os_dep.c:1170: linker could not find symbol open
../../../../usr/local/lib/tinygo/lib/bdwgc/os_dep.c:1200: linker could not find symbol strtoul
../../../../usr/local/lib/tinygo/lib/bdwgc/os_dep.c:2916: linker could not find symbol strtoul
../../../../usr/local/lib/tinygo/lib/bdwgc/os_dep.c:3849: linker could not find symbol fcntl
../../../../usr/local/lib/tinygo/lib/bdwgc/os_dep.c:3946: linker could not find symbol uname

But, I definitely have glibc installed such that those should be found.

Am I just "holding it wrong", and there's a different way to build a plain binary for my system?

@aykevl
Copy link
Member

aykevl commented Mar 25, 2025

A tinygo clean should fix this.

(We should eventually really fix this issue, but for now tinygo clean is a workaround - essentially, you have a stale cache).

@jakebailey
Copy link
Author

Thanks, a tinygo clean did fix this. That explains why I was making more progress when I switched to trying out a wasm build. Unfortunately I crash at runtime though other problems, but, those are already reported 😄

@ben-krieger
Copy link
Contributor

tinygo clean fixed some of my missing symbols (strtoul, atol, etc. - same as OP). However, there are two that remain and seem to be related to Go 1.24 changes:

[nix...]-go-1.24.1/share/go/src/crypto/internal/sysrand/rand.go:48: linker could not find symbol crypto/internal/sysrand.fatal
[nix...]-tinygo-0.37.0/share/tinygo/src/internal/syscall/unix/getrandom.go:26: linker could not find symbol runtime.vgetrandom

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants