kumquat-buildroot/package/python3
Vincent Fazio 58ba95b064 package/python3: fix cross builds when host and target use the same SOABI
When python performs a cross compile, it uses a host interpreter to run
steps on behalf of the foreign architecture to finalize the build.

When performing these steps, foreign modules may be loaded if the SOABI
matches that of the host. This can lead to issues if the modules are
linked against a libc not available on the host or if the binaries
include instructions unsupported by the host.

For now, patch the foreign libraries out of PYTHONPATH and explicitly
define the path to sysconfigdata so builds can complete without error.

This method currently passes all upstream CI pipelines [0] and should
also work (with some modifications) for the migration to 3.12 [1].

Fixes: http://autobuild.buildroot.net/results/c854080e003e9a7d525325073190b472a8f982aa/
[0]: https://github.com/python/cpython/pull/116294
[1]: https://lists.buildroot.org/pipermail/buildroot/2024-February/685369.html

Signed-off-by: Vincent Fazio <vfazio@gmail.com>
Tested-by: Yann E. MORIN <yann.morin.1998@free.fr>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
(cherry picked from commit d01e13c4d4)
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2024-05-06 13:47:15 +02:00
..
0001-Make-the-build-of-pyc-files-conditional.patch
0002-Disable-buggy_getaddrinfo-configure-test-when-cross-.patch
0003-Add-infrastructure-to-disable-the-build-of-certain-e.patch
0004-Adjust-library-header-paths-for-cross-compilation.patch
0005-Don-t-look-in-usr-lib-termcap-for-libraries.patch
0006-Don-t-add-multiarch-paths.patch
0007-Abort-on-failed-module-build.patch
0008-Serial-ioctl-workaround.patch
0009-Do-not-adjust-the-shebang-of-Python-scripts-for-cros.patch
0010-Misc-python-config.sh.in-ensure-sed-invocations-only.patch
0011-Add-an-option-to-disable-pydoc.patch
0012-Add-an-option-to-disable-lib2to3.patch
0013-Add-option-to-disable-the-sqlite3-module.patch
0014-Add-an-option-to-disable-the-tk-module.patch
0015-Add-an-option-to-disable-the-curses-module.patch
0016-Add-an-option-to-disable-expat.patch
0017-Add-an-option-to-disable-CJK-codecs.patch
0018-Add-an-option-to-disable-NIS.patch
0019-Add-an-option-to-disable-unicodedata.patch
0020-Add-an-option-to-disable-IDLE.patch
0021-Add-an-option-to-disable-decimal.patch
0022-Add-an-option-to-disable-the-ossaudiodev-module.patch
0023-Add-an-option-to-disable-openssl-support.patch
0024-Add-an-option-to-disable-the-readline-module.patch
0025-Add-options-to-disable-zlib-bzip2-and-xz-modules.patch
0026-python-config.sh-don-t-reassign-prefix.patch
0027-Add-an-option-to-disable-uuid-module.patch
0028-fix-building-on-older-distributions.patch
0029-configure.ac-fixup-CC-print-multiarch-output-for-mus.patch
0030-Add-an-option-to-disable-the-berkeleydb-module.patch
0031-lib-crypt-uClibc-ng-doesn-t-set-errno-when-encryptio.patch
0032-gh-115382-Fix-cross-compiles-when-host-and-target-us.patch
Config.in
Config.in.host
python3.hash
python3.mk