-
Notifications
You must be signed in to change notification settings - Fork 18k
x/mobile/cmd/gomobile: Provide support for other instruction sets used by Android (such as x86) #10743
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
Comments
I'm having a try myself. I will post a code review in a few days. |
This involves more than just changing in the gomobile cmd tool. The go tool is not officially supporting android on other architectures yet - see http://build.golang.org to see the supported os+arch combination. Much progress had been made in shared library buildmodes support for 1.5 so I guess it will not be very hard but it will still need touching various places on the main go tree. FYI the main go tree is frozen for 1.5, and for official release, we need a builder. |
I stopped working on this because I couldn't get around some issues in the main go tree. Maybe I will have another try in the future. |
Depends on #9327, which @hyangah is going to look at for Go 1.6. As you say @timcooijmans, there's a bit of subtlety there. Once #9327 is done, modifying the gomobile tool will be really easy. Assigning to myself so I don't forget it (somehow I missed this issue when it came in), but feel free to take it again. |
Just a little update. I created support for x86 in the gomobile tool (for gomobile bind, gomobile build does only arm currently since there is something with the nm-tool I have to get my head around). https://go-review.googlesource.com/13750 As mentioned in #9327 some elements are still missing in Go to support actual working libraries. |
CL https://golang.org/cl/15993 mentions this issue. |
access, connect, socket. In Android-L, logging is done by writing the log messages to the logd process through a unix domain socket. Also, changed the arg types of those syscall stubs to match linux programming APIs. For #10743 Change-Id: I66368a03316e253561e9e76aadd180c2cd2e48f3 Reviewed-on: https://go-review.googlesource.com/15993 Reviewed-by: David Crawshaw <crawshaw@golang.org>
CL https://golang.org/cl/15994 mentions this issue. |
CL https://golang.org/cl/15991 mentions this issue. |
CL https://golang.org/cl/16396 mentions this issue. |
Android linker does not handle TLS for us. We set up the TLS slot for g, as darwin/386,amd64 handle instead. This is disgusting and fragile. We will eventually fix this ugly hack by taking advantage of the recent TLS IE model implementation. (Instead of referencing an GOT entry, make the code sequence look into the TLS variable that holds the offset.) The TLS slot for g in android/amd64 assumes a fixed offset from %fs. See runtime/cgo/gcc_android_amd64.c for details. For #10743 Change-Id: I1a3fc207946c665515f79026a56ea19134ede2dd Reviewed-on: https://go-review.googlesource.com/15991 Reviewed-by: David Crawshaw <crawshaw@golang.org>
For #10743 Change-Id: Iec047821147a0e28edebf875fefe25993785702b Reviewed-on: https://go-review.googlesource.com/15994 Reviewed-by: David Crawshaw <crawshaw@golang.org>
For #10743 #10807 Change-Id: I35dedb52e2b47fe7ffc655d01f22ac05fe830bde Reviewed-on: https://go-review.googlesource.com/16396 Reviewed-by: David Crawshaw <crawshaw@golang.org>
I will change gomobile to build an app for android/x86 this week. -target=android/arm or -target=android/x86 or -target=android/x86_64 and -target=android packages for all the architectures available WDYT? |
CL https://golang.org/cl/17502 mentions this issue. |
Sounds good to me. |
CL https://golang.org/cl/17560 mentions this issue. |
CL https://golang.org/cl/17580 mentions this issue. |
3x the stripped ndk size - still smaller than the full NDK archive (400MB vs 120MB) Update golang/go#10743 Change-Id: I38e2abb01c64d38adbb5de55347ad92a9031aba6 Reviewed-on: https://go-review.googlesource.com/17502 Reviewed-by: David Crawshaw <crawshaw@golang.org>
CL https://golang.org/cl/17679 mentions this issue. |
CL https://golang.org/cl/17720 mentions this issue. |
CL https://golang.org/cl/17744 mentions this issue. |
CL https://golang.org/cl/17749 mentions this issue. |
These tar.gz include x86, x86_64 tools and libraries. This CL will be submitted once the files are available from dl servers. Updates golang/go#10743 Change-Id: I4dd59221f392d6daf4d13ab7af38d01b8e6f4546 Reviewed-on: https://go-review.googlesource.com/17560 Reviewed-by: David Crawshaw <crawshaw@golang.org>
This does not change the tool's behavior. The global ndkConfig 'ndk' holds info on all supported architectures with the latest Go and gomobile tools (tip), and provides Root and Toolchain methods that returns the current NDK installation directory and the toolchain info depending on the GOPATH and the current go version. The global androidEnv is a map from arch name to the env vars. ndkccpath is replaced by ndk.Root. For golang/go#10743 Change-Id: I70d8e7b3e9979836112eb82d50c468df4f4ab43f Reviewed-on: https://go-review.googlesource.com/17720 Reviewed-by: David Crawshaw <crawshaw@golang.org>
init command installs std for all the architectures supported by the current go tool version (as listed in androidEnv). build and bind commands pass the list of architectures to the underlying functions. The list is currently hard-coded []string{"arm"}. In a separate CL, the list will be populated from the -target flag value. Still targets arm devices only. For golang/go#10743 Change-Id: I62b5899859e76ad78a2dc55111e87aa13a68a1f9 Reviewed-on: https://go-review.googlesource.com/17749 Reviewed-by: David Crawshaw <crawshaw@golang.org>
Not updated the doc yet. Not useful for iOS yet. For golang/go#10743 Change-Id: Iaffc41af2c876aa5889c44aae459241af9ec206e Reviewed-on: https://go-review.googlesource.com/17580 Reviewed-by: David Crawshaw <crawshaw@golang.org>
For golang/go#10743 Change-Id: I374fae9d6e0a7926b26647fe462968df3c0e3298 Reviewed-on: https://go-review.googlesource.com/17679 Reviewed-by: David Crawshaw <crawshaw@golang.org>
Are there any blockers for supporting android/arm64? |
For golang/go#10743 Change-Id: Iec047821147a0e28edebf875fefe25993785702b Reviewed-on: https://go-review.googlesource.com/15994 Reviewed-by: David Crawshaw <crawshaw@golang.org>
For golang/go#10743 golang/go#10807 Change-Id: I35dedb52e2b47fe7ffc655d01f22ac05fe830bde Reviewed-on: https://go-review.googlesource.com/16396 Reviewed-by: David Crawshaw <crawshaw@golang.org>
CL https://golang.org/cl/20434 mentions this issue. |
CL https://golang.org/cl/20707 mentions this issue. |
forked from https://golang.org/cl/20434 - added app/internal/callfn package update. - changed hashes.go because -for some reason- the generated hashes don't match. - build_androidapp.go had to be changed to deal with openal package. Fixes golang/go#10743 Change-Id: Iaa3f55d80c5fd184338d27832dc5c90cb772bd6a Reviewed-on: https://go-review.googlesource.com/20707 Reviewed-by: David Crawshaw <crawshaw@golang.org> Reviewed-by: Elias Naur <elias.naur@gmail.com>
forked from https://golang.org/cl/20434 - added app/internal/callfn package update. - changed hashes.go because -for some reason- the generated hashes don't match. - build_androidapp.go had to be changed to deal with openal package. Fixes golang/go#10743 Change-Id: Iaa3f55d80c5fd184338d27832dc5c90cb772bd6a Reviewed-on: https://go-review.googlesource.com/20707 Reviewed-by: David Crawshaw <crawshaw@golang.org> Reviewed-by: Elias Naur <elias.naur@gmail.com>
Android doesn't only run on arm-based systems but also some other architectures are commonly used, such as x86 (mostly Intel Atom, but also the simulators) arm64 (also known as aarch64) and MIPS.
It would be great if at least x86 was supported.
The text was updated successfully, but these errors were encountered: