This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: do not define sys.implementation._multiarch on Android
Type: behavior Stage: resolved
Components: Cross-Build Versions: Python 3.7, Python 3.6
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: xdegaye Nosy List: Alex.Willmer, doko, ned.deily, python-dev, vstinner, xdegaye, yan12125, zach.ware
Priority: normal Keywords: patch

Created on 2016-12-01 08:06 by xdegaye, last changed 2022-04-11 14:58 by admin. This issue is now closed.

File name Uploaded Description Edit
android_multiarch.patch xdegaye, 2016-12-01 08:06 review
android_multiarch_2.patch xdegaye, 2016-12-03 15:05 review
Pull Requests
URL Status Linked Edit
PR 552 closed dstufft, 2017-03-31 16:36
Messages (7)
msg282140 - (view) Author: Xavier de Gaye (xdegaye) * (Python triager) Date: 2016-12-01 08:06
Android is not a multiarch system and the unix build system can cross compile non-multiarch systems as well as multiarch systems.  This is a follow up of the decisions implemented in issue 28046 and the patch fixes also an oversight made in this issue in

Also tested with the patch in issue 28833 that implements cross compilation of third-party extension modules.
Please run autoconf after installing the patch.
msg282149 - (view) Author: Chih-Hsuan Yen (yan12125) * Date: 2016-12-01 08:56
Actually all UNIX-like platforms now have non-empty sys.implementation._multiarch now (msg273875). An idea is renaming it to something like target_architecture to make things clearer. It will be a triplet on all system, whether cross-built or not.
msg282156 - (view) Author: Matthias Klose (doko) * (Python committer) Date: 2016-12-01 10:49
> An idea is renaming it to something like target_architecture
> to make things clearer

Yes, that was my intent, and I think it is the right solution. using $(MACHDEP)_$(MULTIARCH) in the sysconfigdata name and probably in other places was not a good idea (introduced by the platdir removal).

There's no reason why this target_architecture could be used by any unix like platform.
msg282286 - (view) Author: Xavier de Gaye (xdegaye) * (Python triager) Date: 2016-12-03 15:05
The change made by the patch in handles the removing of the dangling underscore in the patch of issue 28833, it is not needed.
android_multiarch_2.patch is simpler: the change in has been removed and test_triplet_in_ext_suffix is now skipped when sys.implementation does not have the _multiarch attribute instead of only for android as previously.
msg282287 - (view) Author: Xavier de Gaye (xdegaye) * (Python triager) Date: 2016-12-03 15:11
The MULTIARCH triplet:
  * is used by the build system in the suffix of the name of the _sysconfigdata private module, it may have any value (including being empty) when the platform is non-multiarch - for example cross-compiling for an Android emulator with the 'foo-bar-foobar' MULTIARCH triplet works just fine (without the patch)
  * is not used by the interpreter
  * the Python user may not use it (sys.implementation_multiarch is private)
  * is not used in the standard library, except by the sysconfig modules to get the name of the _sysconfigdata module (and it may be empty)
  * is not needed any more to cross-compile non-multiarch platforms (even without the patch) since issue 28046, where platform-specific directories have been removed

On Android the MULTIARCH triplet adds the burden of having to maintain the list of Android processors and abis in through a set of complex conditionals (see below [1]) whose correctness is uncertain and not verified. This is useless and removed since it is not needed anymore.

[1] The Android set of conditionals in

#if defined(__ANDROID__)
# if defined(__x86_64__) && defined(__LP64__)
# elif defined(__i386__)
# elif defined(__aarch64__) && defined(__AARCH64EL__)
#  if defined(__ILP32__)
#  else
#  endif
# elif defined(__ARM_EABI__) && defined(__ARMEL__)
# elif defined(__mips_hard_float) && defined(_MIPSEL)
#  if _MIPS_SIM == _ABIO32
#  elif _MIPS_SIM == _ABI64
#  else
#   error unknown platform triplet
#  endif
# else
#   error unknown platform triplet
# endif
msg282859 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-12-10 16:35
New changeset b3ba41bf92c7 by Xavier de Gaye in branch '3.6':
Issue #28849: Do not define sys.implementation._multiarch on Android.

New changeset 40e8b39199da by Xavier de Gaye in branch 'default':
Issue #28849: Merge 3.6.
msg283214 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-12-14 19:38
New changeset ab3d870aa3bc by Xavier de Gaye in branch '3.6':
Issue #28849: Skip test_sysconfig.test_triplet_in_ext_suffix on non linux platforms.

New changeset 0ff181ca7558 by Xavier de Gaye in branch 'default':
Issue #28849: Merge 3.6.
Date User Action Args
2022-04-11 14:58:40adminsetgithub: 73035
2017-03-31 16:36:36dstufftsetpull_requests: + pull_request1088
2016-12-14 19:38:34python-devsetmessages: + msg283214
2016-12-11 19:30:08xdegayesetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2016-12-10 16:35:19python-devsetnosy: + python-dev
messages: + msg282859
2016-12-03 15:11:04xdegayesetmessages: + msg282287
2016-12-03 15:05:57xdegayesetfiles: + android_multiarch_2.patch

messages: + msg282286
2016-12-01 10:49:43dokosetmessages: + msg282156
2016-12-01 08:56:12yan12125setmessages: + msg282149
2016-12-01 08:06:07xdegayecreate