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

ld.lld: error: undefined hidden symbol: __math_invalidf #30

Open
funkycode opened this issue Apr 21, 2024 · 5 comments
Open

ld.lld: error: undefined hidden symbol: __math_invalidf #30

funkycode opened this issue Apr 21, 2024 · 5 comments

Comments

@funkycode
Copy link

funkycode commented Apr 21, 2024

I built tinygo from source as per official documentation (on gentoo here)
tried to run ping pong example on nicenano

$ sudo ~/go/bin/mecha flash -i wazero -m nicenano
Building TinyGo module ping
Done.
   code    data     bss |   flash     ram
      9       0       0 |       9       0
Application built. Now flashing...
ld.lld: error: undefined hidden symbol: __math_invalidf
>>> referenced by sf_sqrt.c:0 (/home/zogg/dev/tinygo/lib/picolibc/newlib/libm/math/sf_sqrt.c:0)
>>>               sf_sqrt.c.o:(sqrtf) in archive /root/.cache/tinygo/picolibc-thumbv7em-unknown-unknown-eabi-cortex-m4/lib.a
>>> did you mean: __math_invalid
>>> defined in: /root/.cache/tinygo/picolibc-thumbv7em-unknown-unknown-eabi-cortex-m4/lib.a(math_err_invalid)
failed to run tool: ld.lld
error: failed to link /tmp/tinygo2142027620/main: exit status 1
/usr/local/bin/tinygo flash -size short -stack-size 8kb -tags wazero -target nicenano -monitor .: exit status 1

btw i tried to do use only tinygo and wazero and get the same results

$ tinygo version                                                                                                                                                                                                          
tinygo version 0.31.2 linux/amd64 (using go version go1.22.2 and LLVM version 17.0.1)
@deadprogram
Copy link
Member

Hello @funkycode thanks for the report. I think this is actually related more to your TinyGo custom build than Mechanoid itself.

Can you flash the normal blinky1 program on your board?

tinygo flash -target nicenano examples/blinky1

Perhaps you can open an issue in the TinyGo repo to resolve. It might require some docs update for gentoo? Not sure on that one.

@funkycode
Copy link
Author

Tinygo does work in general, but not with wazero/wasm host.
Will open ticket there 🙏🏽

@evacchi
Copy link

evacchi commented Apr 22, 2024

please notice the wazero team currently is not actively maintaining support for this type of cross-build, we merely assisted the mechanoid team to upstream their patches ;)

@deadprogram
Copy link
Member

Sorry if I was unclear. I doubt it is anything specific to Wazero, rather is something to do with the custom TinyGo install. I meant to
suggest opening issue in TinyGo repo, not Wazero repo.

@deadprogram
Copy link
Member

Also see tinygo-org/tinygo#3530

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