cmd/cgo: building fully statically linked executable for Android fails when cgo is enabled #59942
Labels
compiler/runtime
Issues related to the Go compiler and/or runtime.
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
OS-Android
Milestone
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: