Skip to content
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

x/mobile/cmd/gomobile: Provide support for other instruction sets used by Android (such as x86) #10743

Closed
timcooijmans opened this issue May 7, 2015 · 21 comments

Comments

@timcooijmans
Copy link
Contributor

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.

@timcooijmans timcooijmans changed the title x/mobile/gomobile: Provide support for other instruction sets used by Android (such as x86) x/mobile/cmd/gomobile: Provide support for other instruction sets used by Android (such as x86) May 7, 2015
@timcooijmans
Copy link
Contributor Author

I'm having a try myself. I will post a code review in a few days.

@hyangah
Copy link
Contributor

hyangah commented May 11, 2015

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.

@ianlancetaylor ianlancetaylor added this to the Unreleased milestone Jun 3, 2015
@timcooijmans
Copy link
Contributor Author

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.

@crawshaw
Copy link
Member

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.

@crawshaw crawshaw self-assigned this Jul 27, 2015
@timcooijmans
Copy link
Contributor Author

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.

@gopherbot
Copy link

CL https://golang.org/cl/15993 mentions this issue.

hyangah added a commit that referenced this issue Oct 20, 2015
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>
@gopherbot
Copy link

CL https://golang.org/cl/15994 mentions this issue.

@gopherbot
Copy link

CL https://golang.org/cl/15991 mentions this issue.

@gopherbot
Copy link

CL https://golang.org/cl/16396 mentions this issue.

hyangah added a commit that referenced this issue Oct 28, 2015
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>
hyangah added a commit that referenced this issue Oct 28, 2015
For #10743

Change-Id: Iec047821147a0e28edebf875fefe25993785702b
Reviewed-on: https://go-review.googlesource.com/15994
Reviewed-by: David Crawshaw <crawshaw@golang.org>
hyangah added a commit that referenced this issue Oct 28, 2015
For #10743 #10807

Change-Id: I35dedb52e2b47fe7ffc655d01f22ac05fe830bde
Reviewed-on: https://go-review.googlesource.com/16396
Reviewed-by: David Crawshaw <crawshaw@golang.org>
@hyangah
Copy link
Contributor

hyangah commented Dec 7, 2015

I will change gomobile to build an app for android/x86 this week.
One question is how to configure to create or not to create the fat binary.
We are thinking to extend -target flag to accept a comma-separated list of
android/{architecture} names.

-target=android/arm or -target=android/x86 or -target=android/x86_64

and

-target=android packages for all the architectures available

WDYT?

@crawshaw

@gopherbot
Copy link

CL https://golang.org/cl/17502 mentions this issue.

@crawshaw
Copy link
Member

crawshaw commented Dec 8, 2015

Sounds good to me.

@gopherbot
Copy link

CL https://golang.org/cl/17560 mentions this issue.

@gopherbot
Copy link

CL https://golang.org/cl/17580 mentions this issue.

hyangah added a commit to golang/mobile that referenced this issue Dec 10, 2015
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>
@gopherbot
Copy link

CL https://golang.org/cl/17679 mentions this issue.

@gopherbot
Copy link

CL https://golang.org/cl/17720 mentions this issue.

@gopherbot
Copy link

CL https://golang.org/cl/17744 mentions this issue.

@gopherbot
Copy link

CL https://golang.org/cl/17749 mentions this issue.

hyangah added a commit to golang/mobile that referenced this issue Dec 12, 2015
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>
hyangah added a commit to golang/mobile that referenced this issue Dec 14, 2015
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>
hyangah added a commit to golang/mobile that referenced this issue Dec 14, 2015
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>
hyangah added a commit to golang/mobile that referenced this issue Dec 16, 2015
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>
hyangah added a commit to golang/mobile that referenced this issue Jan 8, 2016
For golang/go#10743

Change-Id: I374fae9d6e0a7926b26647fe462968df3c0e3298
Reviewed-on: https://go-review.googlesource.com/17679
Reviewed-by: David Crawshaw <crawshaw@golang.org>
@fernand
Copy link

fernand commented Jan 20, 2016

Are there any blockers for supporting android/arm64?

fsouza pushed a commit to fsouza/go that referenced this issue Feb 25, 2016
For golang/go#10743

Change-Id: Iec047821147a0e28edebf875fefe25993785702b
Reviewed-on: https://go-review.googlesource.com/15994
Reviewed-by: David Crawshaw <crawshaw@golang.org>
fsouza pushed a commit to fsouza/go that referenced this issue Feb 25, 2016
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>
@gopherbot
Copy link

CL https://golang.org/cl/20434 mentions this issue.

@gopherbot
Copy link

CL https://golang.org/cl/20707 mentions this issue.

@golang golang locked and limited conversation to collaborators Mar 14, 2017
imWildCat pushed a commit to imWildCat/go-mobile that referenced this issue Apr 10, 2021
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>
imWildCat pushed a commit to imWildCat/go-mobile that referenced this issue Apr 11, 2021
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>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants