-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Rust called golang func by ffi failed on windows #115973
Comments
I don't see how we could begin to realistically solve this and make it stay solved? This is a missing function referenced by the Go code, and we don't know what steps CGo normally takes to make this compile and link correctly. It likely only links correctly by accident on Ubuntu. |
This program succussed on mac-pc |
On macOS all dynamic libraries which Go depend on are likely already depended on by Rust or added by default by the linker. On Windows this is likely not the case. You may want to open an issue for cgo_oligami as that crate is responsible for making sure everything necessary to successfully link Go is in place. |
As for the alpine issue, you may be hitting golang/go#13492. |
I search golang issue and found golang/go#17014. Golang is not support llvm on windows so Rust cannot link Golang staticlib on windows!! This is bad news, but I know reason. Thank you bjorn3, workingjubilee!! |
Coder went to the compiler one day, |
I added dependencies on mac because stackoverflow sample. |
Hi, I love rust and golang both!
Rust call golang by ffi.
windows11:
stable & beta & nightly:
wsl(ubuntu22):
stable & beta & nightly:
conplete
alpine(docker):
stable & beta & nightly: segmentation fault on golang func
code on https://github.com/oligami-0424/ffi-rust-go
I tried this code:
I expected to see this happen: success on all
Instead, this happened: success on only ubuntu
rustc --version --verbose
:windows11
ubuntu(wsl)
alpine
The text was updated successfully, but these errors were encountered: