summaryrefslogtreecommitdiffstats
path: root/package/python
diff options
context:
space:
mode:
authorChris Smart <mail@csmart.io>2017-02-22 14:14:23 +1100
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>2017-02-23 23:03:19 +0100
commit01464f56bd8a61b461fce4c108be299a47a6a405 (patch)
treef1c020bcbbe1d214c1a51afd0755d4b1cef876c5 /package/python
parent5bffdf2a1a478fc84cdf7ba124b8859cacd11843 (diff)
downloadbuildroot-01464f56bd8a61b461fce4c108be299a47a6a405.tar.gz
buildroot-01464f56bd8a61b461fce4c108be299a47a6a405.zip
package/python: apply unicode config to host build
Currently the host build of Python 2 defaults to narrow unicode (UCS2), ignoring the BR2_PACKAGE_PYTHON_UCS4 configuration option which may be set to wide (UCS4). This results in host and target Python packages which are incompatible in subtle ways. For example, installing wheels into the target fails when they are made with the host python, citing incompatibility (as can be seen by the package tags which may be "cp27u-manylinux1" instead of "cp27mu-manylinux1"). Compiling the host Python 2 with the same UCS configuration as the target ensures that the packages are compatible (and the tags match). This does not affect Python 3 as support for narrow unicode was deprecated in version 3.3, see https://www.python.org/dev/peps/pep-0393/ Thanks to Tony Breeds <tony@bakeyournoodle.com> for reporting this. Signed-off-by: Chris Smart <mail@csmart.io> [Thomas: add comment in the code.] Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'package/python')
-rw-r--r--package/python/python.mk3
1 files changed, 3 insertions, 0 deletions
diff --git a/package/python/python.mk b/package/python/python.mk
index 7b20434c94..281130c68b 100644
--- a/package/python/python.mk
+++ b/package/python/python.mk
@@ -105,6 +105,9 @@ endif
# Default is UCS2 w/o a conf opt
ifeq ($(BR2_PACKAGE_PYTHON_UCS4),y)
+# host-python must have the same UCS2/4 configuration as the target
+# python
+HOST_PYTHON_CONF_OPTS += --enable-unicode=ucs4
PYTHON_CONF_OPTS += --enable-unicode=ucs4
endif
OpenPOWER on IntegriCloud