-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
Choose platform triplets for android builds #72104
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
Following up to http://bugs.python.org/issue23968, I think we should choose different platform triplets for the android builds than we do for the linux builds. Not sure which ones. I saw the following gnu triplets used:
Looking at the two cross compilers from the Ubuntu archive, I see that the arm compiler defines a __ANDROID__ macro, while the i686 compiler doesn't, so it might be difficult to select the correct platform triplet. Could somebody check different compilers (clang as well) to see if this macro is defined? <gcc|clang> -E -dM - < /dev/null|grep -i android Not sure which architectures else should be defined, but aarch64 comes to my mind as well. |
In changeset 46567fda0b29, Xavier defined an autotools variable $ANDROID_API_LEVEL. This can be used to determine whether a specific compiler targets Android or not. |
hmm, should the android api level be part of the platform triplet? or are these not relevant for modules? |
In Android NDK, each API level comes with a different set of header files ($ANDROID_NDK/platforms/android-$ANDROID_API_LEVEL/arch-$ARCH/usr/include). In a strict sense, the API level should be included in platform triplet. At least the plat-* directory has different contents in different API levels. In practical, I haven't seen such a usage. |
here's a patch, not yet including the ABI levels. I think we didn't need them for Linux, and maybe start for Android without using them. You can later introduce these if you have to. |
Well, here's a list of cross compilers in Android NDK: $ ls $ANDROID_NDK/toolchains/*/prebuilt/*/bin/*-gcc | xargs -i basename '{}'
aarch64-linux-android-gcc
arm-linux-androideabi-gcc
mips64el-linux-android-gcc
mipsel-linux-android-gcc
i686-linux-android-gcc
x86_64-linux-android-gcc Does Python's platform triplet have the same meaning as GCC's --target? If so those names can be used. By the way, +1 for not including the API level. |
yes, it should follow the gnu triplets. I updated these, and added some for mips. However I can't check if the mips ones will do what they are supposed to do. Please could you check these if you have cross compilers available? |
CPython builds fine for MIPS with this patch. For MIPS64, apparently Android NDK is broken - it can't even compile a simple C file. |
OK found some wrong usages in my build script. Now MIPS64 builds fine, and PLATFORM_TRIPLET is detected as intended. I didn't test the build on actual devices, as I don't have a MIPS or MIPS64 device. |
I think that's good for now. The compiler checks maybe can be later adjusted. |
New changeset a931fdc4c4c4 by doko in branch 'default':
|
checked in. |
test_triplet_in_ext_suffix in test_sysconfig fails with the 'x86' Android platform. |
New changeset 676e6c3d30db by Xavier de Gaye in branch 'default': |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: