[oe-commits] [openembedded-core] 02/02: glibc: use the host locale archive in nativesdk builds

git at git.openembedded.org git at git.openembedded.org
Tue Aug 23 16:30:21 UTC 2016


rpurdie pushed a commit to branch krogoth
in repository openembedded-core.

commit d36a2314a8b25a37a8e4ea0b33ce5197e44fedeb
Author: Ross Burton <ross.burton at intel.com>
AuthorDate: Wed Jul 6 10:54:29 2016 +0100

    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 ]
    
    Signed-off-by: Ross Burton <ross.burton at intel.com>
---
 meta/recipes-core/glibc/glibc_2.23.bb | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/meta/recipes-core/glibc/glibc_2.23.bb b/meta/recipes-core/glibc/glibc_2.23.bb
index b71018b..63dc911 100644
--- a/meta/recipes-core/glibc/glibc_2.23.bb
+++ b/meta/recipes-core/glibc/glibc_2.23.bb
@@ -130,6 +130,12 @@ do_compile () {
 
 }
 
+# Use the host locale archive when built for nativesdk so that we don't need to
+# ship a complete (100MB) locale set.
+do_compile_prepend_class-nativesdk() {
+    echo "complocaledir=/usr/lib/locale" >> ${S}/configparms
+}
+
 require glibc-package.inc
 
 BBCLASSEXTEND = "nativesdk"

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list