msg274041 - (view) |
Author: Matthias Klose (doko) *  |
Date: 2016-08-31 17:23 |
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: - i686-linux-android - arm-linux-androidabi 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. |
|
msg274046 - (view) |
Author: (yan12125) * |
Date: 2016-08-31 17:44 |
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. |
|
|
msg274049 - (view) |
Author: Matthias Klose (doko) *  |
Date: 2016-08-31 17:59 |
hmm, should the android api level be part of the platform triplet? or are these not relevant for modules? |
|
|
msg274055 - (view) |
Author: (yan12125) * |
Date: 2016-08-31 18:14 |
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. |
|
|
msg274154 - (view) |
Author: Matthias Klose (doko) *  |
Date: 2016-09-01 17:06 |
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. |
|
|
msg274156 - (view) |
Author: (yan12125) * |
Date: 2016-09-01 17:48 |
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. |
|
|
msg274166 - (view) |
Author: Matthias Klose (doko) *  |
Date: 2016-09-01 18:40 |
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? |
|
|
msg274171 - (view) |
Author: (yan12125) * |
Date: 2016-09-01 19:25 |
CPython builds fine for MIPS with this patch. For MIPS64, apparently Android NDK is broken - it can't even compile a simple C file. |
|
|
msg274174 - (view) |
Author: (yan12125) * |
Date: 2016-09-01 19:42 |
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. |
|
|
msg274176 - (view) |
Author: Matthias Klose (doko) *  |
Date: 2016-09-01 20:02 |
I think that's good for now. The compiler checks maybe can be later adjusted. |
|
|
msg274177 - (view) |
Author: Roundup Robot (python-dev)  |
Date: 2016-09-01 20:05 |
New changeset a931fdc4c4c4 by doko in branch 'default': - Issue #27917: Set platform triplets for Android builds. https://hg.python.org/cpython/rev/a931fdc4c4c4 |
|
|
msg274178 - (view) |
Author: Matthias Klose (doko) *  |
Date: 2016-09-01 20:06 |
checked in. |
|
|
msg275838 - (view) |
Author: Xavier de Gaye (xdegaye) *  |
Date: 2016-09-11 19:38 |
test_triplet_in_ext_suffix in test_sysconfig fails with the 'x86' Android platform. |
|
|
msg275839 - (view) |
Author: Roundup Robot (python-dev)  |
Date: 2016-09-11 19:40 |
New changeset 676e6c3d30db by Xavier de Gaye in branch 'default': Issue #27917: Fix test_triplet_in_ext_suffix for the 'x86' Android platform. https://hg.python.org/cpython/rev/676e6c3d30db |
|
|