(e)glibc-package: set LD_LIBRARY_PATH on binary locale generation
authorRoman I Khimov <khimov@altell.ru>
Fri, 15 May 2009 12:25:49 +0000 (16:25 +0400)
committerRoman I Khimov <khimov@altell.ru>
Sun, 17 May 2009 05:23:59 +0000 (09:23 +0400)
Locale generation might fail with SIGSEGV if host libs get messed with target
libs, that might easily happen via /etc/ld.so.cache when building x86(_64)
target on x86(_64) host. So explicitly specify LD_LIBRARY_PATH to prevent that.

Acked-by: Tom Rini <trini@embeddedalley.com>
recipes/eglibc/eglibc-package.bbclass
recipes/glibc/glibc-package.bbclass

index 01f698a..241499f 100644 (file)
@@ -309,11 +309,12 @@ python package_do_split_gconvs () {
                bb.data.setVar('PACKAGES', '%s %s' % (pkgname, bb.data.getVar('PACKAGES', d, 1)), d)
 
                treedir = base_path_join(bb.data.getVar("WORKDIR", d, 1), "locale-tree")
+               ldlibdir = "%s/lib" % treedir
                path = bb.data.getVar("PATH", d, 1)
                i18npath = base_path_join(treedir, datadir, "i18n")
 
                localedef_opts = "--force --old-style --no-archive --prefix=%s --inputfile=%s/i18n/locales/%s --charmap=%s %s" % (treedir, datadir, locale, encoding, name)
-               cmd = "PATH=\"%s\" I18NPATH=\"%s\" %s -L %s %s/bin/localedef %s" % (path, i18npath, qemu, treedir, treedir, localedef_opts)
+               cmd = "PATH=\"%s\" I18NPATH=\"%s\" %s -L %s -E LD_LIBRARY_PATH=%s %s/bin/localedef %s" % (path, i18npath, qemu, treedir, ldlibdir, treedir, localedef_opts)
                bb.note("generating locale %s (%s)" % (locale, encoding))
                if os.system(cmd):
                        raise bb.build.FuncFailed("localedef returned an error (command was %s)." % cmd)
index 8db8c5c..46f809e 100644 (file)
@@ -273,6 +273,7 @@ python package_do_split_gconvs () {
                bb.data.setVar('PACKAGES', '%s %s' % (pkgname, bb.data.getVar('PACKAGES', d, 1)), d)
 
                treedir = base_path_join(bb.data.getVar("WORKDIR", d, 1), "locale-tree")
+               ldlibdir = "%s/lib" % treedir
                path = bb.data.getVar("PATH", d, 1)
                i18npath = base_path_join(treedir, datadir, "i18n")
 
@@ -282,7 +283,7 @@ python package_do_split_gconvs () {
                if not qemu_options:
                        qemu_options = bb.data.getVar('QEMU_OPTIONS', d, 1)
                
-               cmd = "PATH=\"%s\" I18NPATH=\"%s\" %s -L %s %s %s/bin/localedef %s" % (path, i18npath, qemu, treedir, qemu_options, treedir, localedef_opts)
+               cmd = "PATH=\"%s\" I18NPATH=\"%s\" %s -L %s -E LD_LIBRARY_PATH=%s %s %s/bin/localedef %s" % (path, i18npath, qemu, treedir, ldlibdir, qemu_options, treedir, localedef_opts)
                bb.note("generating locale %s (%s)" % (locale, encoding))
                if os.system(cmd):
                        raise bb.build.FuncFailed("localedef returned an error (command was %s)." % cmd)