diff options
author | Ross Burton <ross.burton@intel.com> | 2016-07-06 10:54:29 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-07-20 10:28:49 +0100 |
commit | 6494a59552de5ce12e645b0cef8be30228b335a3 (patch) | |
tree | abd411bc0ecad6328a6abc61e079ecac5a6142f6 /meta/recipes-core | |
parent | 604778091e948db76f2b4476f90a6066a29789ae (diff) | |
download | poky-6494a59552de5ce12e645b0cef8be30228b335a3.tar.gz |
glibc: use the host locale archive in nativesdk builds
The nativesdk libc when used by buildtools has a hard requirement on supporting
a UTF-8 locale because Python 3 needs a UTF-8 locale. However we currently only
ship the C locale, which means that Python attempts to lookup the user's locale
(for example, en_NZ.UTF-8) in the locale archive under it's prefix it fails and
falls back to C. This the results in Python using ASCII instead of UTF-8 for
file encoding, and bitbake breaks.
Th obvious solution would be to ship all locales, but this would add
approximately 250MB to the size of the buildtools tarball (which is currently
around 30MB). Generating a binary locale archive reduces this down to 100MB,
but this is still a drastic increase in footprint. If we ship a subset of
locales in the tarball then there will be users whose locale isn't in the
tarball, and they'll have to change their locale to an "approved" one, which
isn't the best of messages to send to new users.
The alternative is to tell the nativesdk libc that the locale archive isn't
under it own prefix but is in fact at /usr/lib/locale/locale-archive, so the
buildtools libc uses the host locale archive. The locale archive format appears
to be at least fairly stable: our glibc 2.24 can read the locale archive
generated by glibc 2.17 (Centos 7).
[ YOCTO #9775 ]
(From OE-Core rev: 75321b6b0f2c0ac667b9350b387b01a188e195c8)
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core')
-rw-r--r-- | meta/recipes-core/glibc/glibc_2.24.bb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/meta/recipes-core/glibc/glibc_2.24.bb b/meta/recipes-core/glibc/glibc_2.24.bb index 456f206f18..4bc64434ad 100644 --- a/meta/recipes-core/glibc/glibc_2.24.bb +++ b/meta/recipes-core/glibc/glibc_2.24.bb | |||
@@ -129,6 +129,12 @@ do_compile () { | |||
129 | 129 | ||
130 | } | 130 | } |
131 | 131 | ||
132 | # Use the host locale archive when built for nativesdk so that we don't need to | ||
133 | # ship a complete (100MB) locale set. | ||
134 | do_compile_prepend_class-nativesdk() { | ||
135 | echo "complocaledir=/usr/lib/locale" >> ${S}/configparms | ||
136 | } | ||
137 | |||
132 | require glibc-package.inc | 138 | require glibc-package.inc |
133 | 139 | ||
134 | BBCLASSEXTEND = "nativesdk" | 140 | BBCLASSEXTEND = "nativesdk" |