-
Notifications
You must be signed in to change notification settings - Fork 137
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
Segfault while linking wasm binaries against libopenlibm #271
Comments
In such cases there's two things that one should try first:
EDIT: you may need to disable optimizations, too. |
Hey this ended up being a bit of a rat's nest to untangle but I found a workaround. It turned out my binary wasn't exporting any symbols, because I was failing to find the symbols from openlibm when compiling. I'm not sure if this should be considered a clang bug, or a macOS bug, or what. |
I have some basic c code to run the naive bayes function, and I'm using libopenlibm for
logf
andpowf
.Building libopenlibm with gnu make and running the executable natively works exactly as expected. However, generating a wasm binary linked against libopenlibm.a results in a SIGSEV and an invalid memory address or null pointer dereference error.
I tried linking in libopenlibm built with gnu make with no arguments and with ARCH=wasm32. Linking the wasm binary against both libraries resulted in the same error as above.
Any suggestions?
The text was updated successfully, but these errors were encountered: