-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
cmd/cgo: building fully statically linked executable for Android fails when cgo is enabled #59942
Comments
(CC @golang/android) |
In triage, we're not sure if building a fully static Android executable is supported. Assigned to the only person in @golang/android for more thoughts and details. |
Android command-line app can be built as Android apk only use dynamically linked library. It would be cool if this feature could be implemented. |
Rust don't support building as I din't find a way to do so for golang. |
workaround termux/termux-packages@10e3b95 |
@eliasnaur would you mind take a look on this? Current implementation on Android use dlopen which causes two problems:
|
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?What did you do?
What did you expect to see?
successfully built
What did you see instead?
more
https://github.com/golang/go/blob/master/src/runtime/cgo/gcc_android.c
gcc_android.c rely on
liblog.so
andlibdl.so
Note: Android NDK do not provides
liblog.a
statically linked executable can not use functions in libdl.
to get runtime os SDK API Level, I usually use follwoing code:
The text was updated successfully, but these errors were encountered: