Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upsupport an armv7-android-linuxeabi target #33278
Comments
This comment has been minimized.
This comment has been minimized.
But the Our current nightly has following features enabled for the arm-linux-androideabi triplet: |
This comment has been minimized.
This comment has been minimized.
|
I believe the current ABIs supported by Android itself are listed here and although we have not thoroughly documented what our Android target is going for, it's defacto been going towards armeabi-v7a. So in that spirit we should just update our target spec to include Thumb (as mentioned by @nagisa), but I'm also curious about the |
This comment has been minimized.
This comment has been minimized.
|
So there are two different choices for how to pass floating-point arguments on ARM:
What does
Thumb is very desirable...the smaller the Rust runtime libraries were, the better from the perspective of our mobile team. I think we'd want to support |
This comment has been minimized.
This comment has been minimized.
|
I propose to define android target instruction sets and names based on official ABI list.
I think our android target If we look at the official list of ABIs, it is clear that we will want soon to support all the flavors, with instruction sets that are defined there. The wishes what we would want android targets to be are not relevant or would at least be very inconvenient to use. I propose this path forward:
There is also a precedent here: Rust iOS targets (which have to work on similar archs) are already prepared this way and they are easy to use: Also, if we follow this approach, the addition of "hf" to the name is not necessary, because the hf requirement comes implicitly from supporting a particular ABI. |
This comment has been minimized.
This comment has been minimized.
The usual approach in android-land when working with native code is to compile native code for multiple ABIs and then combine them into single "fat" apk that can work on different devices. Is is also possible to make "split" apks to reduce apk size. But the main point I want to make here that it would be easiest to do that if there was 1:1 mapping between android ABI and Rust target. That way, we could be sure we support all range of options with optimal configurations for each. |
This comment has been minimized.
This comment has been minimized.
|
Aligning Rust targets with Android ABI names makes sense to me. |
This comment has been minimized.
This comment has been minimized.
|
@Nercury yeah I'm inclined to agree, it definitely seems simplest if everything maps 1:1 with the official ABI list. cc @larsbergstrom, this may involve changing the definition of
That way Servo should always have a nightly with "fast Android" ? |
alexcrichton
added
I-nominated
T-tools
labels
May 2, 2016
This comment has been minimized.
This comment has been minimized.
|
@alexcrichton This should work fine for Servo! We already pass a special target triple to Rust different from the native dependencies on a few other ARM platforms, so we have support for mix-and-match in our driver (mach). |
This comment has been minimized.
This comment has been minimized.
The armeabi-v7a ABI requires VFPv3-D16, so this should be safe to use in the
This has one downside that may be unavoidable: The Android NDK toolchain uses the target triple Lastly, Android itself can be built with a "target variant" |
This comment has been minimized.
This comment has been minimized.
|
It concerns me that I don't see google defining target triples for all their ABI's - as @mbrubeck says they seem to just always use |
This comment has been minimized.
This comment has been minimized.
|
@brson I guess their idea is that the requested abi carries enough options for Of course, the "target variant" must match variant used for std libs. I am almost done with |
This comment has been minimized.
This comment has been minimized.
|
FYI, to cover all performance needs, users would be interested in these targets:
|
This comment has been minimized.
This comment has been minimized.
I think the float abi should be hard-float by default. It also seems to me like adding a different target for soft-float/hard-float distinction is not very interesting, because one can enable this by using some codegen flag when using the other target. |
This comment has been minimized.
This comment has been minimized.
|
@nagisa I am re-reading armeabi-v7a (armeabi-v7a-hard) section, looks like it should be ok to enable Hard-float ABI calls on However, latest docs do not mention this, except
Which leads me to conclusion that we should use the same setting for I agree that separate target for hard(er) float does not look practical. |
This comment has been minimized.
This comment has been minimized.
|
The tools team discussed this issue during triage yesterday, and the decision was to:
Along those lines, @Nercury could the new target be |
alexcrichton
removed
the
I-nominated
label
May 4, 2016
This comment has been minimized.
This comment has been minimized.
|
It was also thought that we may not want to change the current |
This comment has been minimized.
This comment has been minimized.
|
Can we even support |
This comment has been minimized.
This comment has been minimized.
|
Yes, LLVM has fallbacks which we can rely on. |
This comment has been minimized.
This comment has been minimized.
Yes, I changed latest name to be armv7, because android's LLVM configured for arm-v7a produces this header:
Which contains
I imagined to make use of rust std lib compiled with this option. However it is removed in latest android abi docs so I don't think we will make use of it. |
This comment has been minimized.
This comment has been minimized.
|
Yeah we can enable the "7a" features through LLVM features I think rather than having to communicate it as part of the triple name |
bors
added a commit
that referenced
this issue
May 8, 2016
This comment has been minimized.
This comment has been minimized.
|
This is done, and we now have nightlies, so closing. |
alexcrichton
closed this
Jun 28, 2016
mbrubeck
referenced this issue
Jun 29, 2016
Closed
Support new "armv7-android-linuxeabi" target triple #11921
This comment has been minimized.
This comment has been minimized.
learnopengles
commented
Dec 26, 2016
|
Hi team, I know this is closed but it seems steps 2 and 3 aren't yet implemented. Should we reopen this or open new tracking issues? |
froydnj commentedApr 29, 2016
•
edited
Firefox for Android compiles its code with
-march=armv7-a -mthumb -mfpu=vfp -mfloat-abi=softfp. Inrustcterms, I think this would be-C +vfp2,+v7-a,+thumb2. AFAICT, this is somewhat different than thearm-linux-androideabitarget, which appears to not assume the existence of an FPU, and also doesn't compile as Thumb where possible. When using Rust on Android, we'd like our Rust libraries to be just as well optimized as our C++ libraries, which means either a) having an official, tier-2 supported target; or b) compiling it ourselves.One could multiply ARM targets to no end, but this seems like a pretty reasonable target for many Android devices out there. Is it possible to have this target added and supported?
cc @alexcrichton