Open awsong opened 1 year ago
CC @golang/android.
Same code works fine under linux and mac.
A Go shared library built with -buildmode=c-shared
relies on dynamic linker support to get command line arguments and environment variables. It's possible that the Android dynamic linker does not support that. This is probably essentially the same problem as #13492.
Not sure whether go build uses the same linker as c or not. But I did write a similar shared library in c which also read env vars in the library code that works fine under android.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I wrote a Go function named Foo(), whith calls os.UserConfigDir() and prints out the result or error. Function Foo() is exported to shared library through CGO, then is called in c program.
What did you expect to see?
What did you see instead?