Skip to contentSkip to conversation

glibc-package: fix kernel version passed to qemu

PATCH In review Roman I Khimov 5 participants 20 messages May 15, 2009 – May 19, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 glibc-package: fix kernel version passed to qemu

Binary locale generation fails with

FATAL: kernel too old

if glibc is configured for kernels newer then 2.6.16.

Fix qemu "-r" parameter to match OLDEST_KERNEL.

---
 recipes/glibc/glibc-package.bbclass |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
recipes/glibc/glibc-package.bbclass +5 -1
index 89fbd1c..8db8c5c 100644
@@ -252,7 +252,11 @@ python package_do_split_gconvs () {
 		if target_arch in ("i486", "i586", "i686"):
 		   target_arch = "i386"
 
-		qemu = "qemu-%s  -s 1048576 -r 2.6.16" % target_arch
+		kernel_ver = bb.data.getVar("OLDEST_KERNEL", d, 1)
+		if kernel_ver is None:
+			qemu = "qemu-%s  -s 1048576" % target_arch
+		else:
+			qemu = "qemu-%s  -s 1048576 -r %s" % (target_arch, kernel_ver)
 		pkgname = 'locale-base-' + legitimize_package_name(name)
 		m = re.match("(.*)\.(.*)", name)
 		if m:
Signature · 7 lines
1.6.3


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
#1 lore raw

PATCH 2/2 glibc-package: set LD_LIBRARY_PATH on binary locale generation

Locale generation might fail with SIGSEGV if host libs get messed with target libs, that might easily happen via /etc/ld.so.cache. So explicitly specify LD_LIBRARY_PATH to prevent that.

---
 recipes/glibc/glibc-package.bbclass |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
recipes/glibc/glibc-package.bbclass +2 -1
index 8db8c5c..46f809e 100644
@@ -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)
Signature · 7 lines
1.6.3


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
#2 lore raw

Re: [PATCH 2/2] glibc-package: set LD_LIBRARY_PATH on binary locale generation

BTW, while at glibc-package, is there any reason for BINARY_LOCALE_ARCHES? We're using binary locale generation even for x86_64 and it is useful for us there. There is ENABLE_BINARY_LOCALE_GENERATION switch already to control whether one wants binary locales generated and if one does, why not on all architectures?

#3 lore raw

Re: [PATCH 2/2] glibc-package: set LD_LIBRARY_PATH on binary locale generation

Quoted 5 lines · Roman I Khimov

BTW, while at glibc-package, is there any reason for BINARY_LOCALE_ARCHES? We're using binary locale generation even for x86_64 and it is useful for us there. There is ENABLE_BINARY_LOCALE_GENERATION switch already to control whether one wants binary locales generated and if one does, why not on all architectures?

BINARY_LOCALE_ARCHES is intended to stop glibc-package from trying to generate the locales for targets where this is known in advance to be a losing proposition (generally because qemu doesn't support the target processor family). If we didn't do that, since ENABLE_BINARY_LOCALE_GENERATION defaults to on, people trying to build for non-qemu-enabled targets would just get some cryptic error during the packaging process.

p.

#4 lore raw

Re: [PATCH 2/2] glibc-package: set LD_LIBRARY_PATH on binary locale generation

Quoted 8 lines · On Friday 15 May 2009 19:32:14 Phil Blundell wrote:
Quoted 6 lines · Roman I Khimov

BTW, while at glibc-package, is there any reason for BINARY_LOCALE_ARCHES? We're using binary locale generation even for x86_64 and it is useful for us there. There is ENABLE_BINARY_LOCALE_GENERATION switch already to control whether one wants binary locales generated and if one does, why not on all architectures?

Quoted 7 lines

BINARY_LOCALE_ARCHES is intended to stop glibc-package from trying to generate the locales for targets where this is known in advance to be a losing proposition (generally because qemu doesn't support the target processor family). If we didn't do that, since ENABLE_BINARY_LOCALE_GENERATION defaults to on, people trying to build for non-qemu-enabled targets would just get some cryptic error during the packaging process.

OK, then I guess we should extend it at least with "i?86" and "x86_64", because that work perfect with QEMU.

#5 lore raw

Re: [PATCH 2/2] glibc-package: set LD_LIBRARY_PATH on binary locale generation

Quoted 17 lines · Roman I Khimov
Quoted 8 lines · On Friday 15 May 2009 19:32:14 Phil Blundell wrote:
Quoted 6 lines · Roman I Khimov

BTW, while at glibc-package, is there any reason for BINARY_LOCALE_ARCHES? We're using binary locale generation even for x86_64 and it is useful for us there. There is ENABLE_BINARY_LOCALE_GENERATION switch already to control whether one wants binary locales generated and if one does, why not on all architectures?

Quoted 7 lines

BINARY_LOCALE_ARCHES is intended to stop glibc-package from trying to generate the locales for targets where this is known in advance to be a losing proposition (generally because qemu doesn't support the target processor family). If we didn't do that, since ENABLE_BINARY_LOCALE_GENERATION defaults to on, people trying to build for non-qemu-enabled targets would just get some cryptic error during the packaging process.

Quoted 2 lines

OK, then I guess we should extend it at least with "i?86" and "x86_64", because that work perfect with QEMU.

Yes, that'd be a fine plan.

In an ideal world, you'd arrange for each version of qemu-native to PROVIDE "virtual/qemu-native-TARGET-SYS" for each architecture that the version in question supported, then make glibc RECOMMEND virtual/qemu-native-${TARGET_SYS} and enable binary locales by default if that recommendation was satisfied at runtime. But, obviously, bitbake doesn't currently do RECOMMENDS so some infrastructure would be needed to make this work.

p.

#6 lore raw
In reply to Roman I Khimov
Quoted 7 lines · Roman I Khimov

Binary locale generation fails with

FATAL: kernel too old

if glibc is configured for kernels newer then 2.6.16.

Fix qemu "-r" parameter to match OLDEST_KERNEL.

Just to be sure, this is happy with 2.4.0 too, right?

Signature · 1 line
Tom Rini
#7 lore raw
Quoted 10 lines · On Friday 15 May 2009 19:26:26 Tom Rini wrote:
Quoted 7 lines · Roman I Khimov

Binary locale generation fails with

FATAL: kernel too old

if glibc is configured for kernels newer then 2.6.16.

Fix qemu "-r" parameter to match OLDEST_KERNEL.

Just to be sure, this is happy with 2.4.0 too, right?

Hmmm. It's untested on 2.4, obviously. But OLDEST_KERNEL is the kernel glibc built against, so whatever it is, it should be a perfect match.

#8 lore raw

Re: [PATCH 1/2] glibc-package: fix kernel version passed to?qemu

Quoted 6 lines · Roman I Khimov
Quoted 5 lines · On Friday 15 May 2009 19:26:26 Tom Rini wrote:
Quoted 4 lines · Roman I Khimov

Binary locale generation fails with

FATAL: kernel too old

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

if glibc is configured for kernels newer then 2.6.16.

Fix qemu "-r" parameter to match OLDEST_KERNEL.

Just to be sure, this is happy with 2.4.0 too, right?

Hmmm. It's untested on 2.4, obviously. But OLDEST_KERNEL is the kernel glibc built against, so whatever it is, it should be a perfect match.

Right. OLDEST_KERNEL=2.4.0 is the default value and I'm just making sure it's been tested in a few places.

Signature · 1 line
Tom Rini
#9 lore raw
In reply to Roman I Khimov
Quoted 6 lines · Roman I Khimov
Quoted 5 lines · On Friday 15 May 2009 19:26:26 Tom Rini wrote:
Quoted 4 lines · Roman I Khimov

Binary locale generation fails with

FATAL: kernel too old

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

if glibc is configured for kernels newer then 2.6.16.

Fix qemu "-r" parameter to match OLDEST_KERNEL.

Just to be sure, this is happy with 2.4.0 too, right?

Hmmm. It's untested on 2.4, obviously. But OLDEST_KERNEL is the kernel glibc built against, so whatever it is, it should be a perfect match.

Do you know what the reason is for passing this -r parameter in the first place? It seems like we should just be letting qemu use the most recent kernel emulation that it knows about, since a glibc compiled against any given kernel version should always run with newer versions.

p.

#10 lore raw
Quoted 13 lines · On Friday 15 May 2009 21:58:09 Phil Blundell wrote:
Quoted 12 lines · Roman I Khimov
Quoted 10 lines · On Friday 15 May 2009 19:26:26 Tom Rini wrote:
Quoted 7 lines · Roman I Khimov

Binary locale generation fails with

FATAL: kernel too old

if glibc is configured for kernels newer then 2.6.16.

Fix qemu "-r" parameter to match OLDEST_KERNEL.

Just to be sure, this is happy with 2.4.0 too, right?

Quoted 7 lines
Quoted 2 lines

Hmmm. It's untested on 2.4, obviously. But OLDEST_KERNEL is the kernel glibc built against, so whatever it is, it should be a perfect match.

Do you know what the reason is for passing this -r parameter in the first place? It seems like we should just be letting qemu use the most recent kernel emulation that it knows about, since a glibc compiled against any given kernel version should always run with newer versions.

It was brought by commit f4f7920d6131d1245436783139e3a77581d6264f, with the message of

=============================================================================
glibc-package.bbclass: Add supersecret -r switch to qemu userspace emulator, which allows to override kernel version report to guest apps (otherwise, host kernel version is used, which causes "Kernel too old" errors in glibc startup code in guess, if host kernel is older than 2.6.14-something). Tested with qemu 0.8.2 (and yes, I couldn't find -r switch in qemu doc, taken from a mail by Paul Brook, qemu co-maintainer).
=============================================================================

If I understand this correctly the problem is that glibc checks kernel version and if that's older than the version glibc compiled against (--enable- kernel=...), it fails with "kernel too old" (see sysdeps/unix/sysv/linux/dl- osinfo.h).

But there is no magic 2.6.14 or 2.6.16 or whatever, and the goal is really not to set the latest version (which you'll need to bump every time new release goes out), but anything that glibc would agree to work with. Sure enough it will agree to work with the version it's been built against.

#11 lore raw
In reply to Roman I Khimov
Quoted 7 lines · Roman I Khimov

Binary locale generation fails with

FATAL: kernel too old

if glibc is configured for kernels newer then 2.6.16.

Fix qemu "-r" parameter to match OLDEST_KERNEL.

While I'm thinking of it, eglibc needs similar changes.

Signature · 1 line
Tom Rini
#12 lore raw

PATCH 1/3 (e)glibc-package: fix kernel version passed to qemu

Binary locale generation fails with

FATAL: kernel too old

if (e)glibc is configured for kernels newer than 2.6.16. This comes from kernel version check in sysdeps/unix/sysv/linux/dl-osinfo.h. We configure (e)glibc with "--enable-kernel=${OLDEST_KERNEL}", so to pass this check we need kernel version reported from QEMU to (e)glibc be $OLDEST_KERNEL or higher.

Fix qemu "-r" parameter to match OLDEST_KERNEL.

---
 recipes/eglibc/eglibc-package.bbclass |    6 +++++-
 recipes/glibc/glibc-package.bbclass   |    6 +++++-
 2 files changed, 10 insertions(+), 2 deletions(-)
recipes/eglibc/eglibc-package.bbclass +5 -1
index 7fcb558..01f698a 100644
@@ -287,7 +287,11 @@ python package_do_split_gconvs () {
 
 	def output_locale_binary(name, locale, encoding):
 		target_arch = bb.data.getVar("TARGET_ARCH", d, 1)
-		qemu = "qemu-%s -r 2.6.16" % target_arch
+		kernel_ver = bb.data.getVar("OLDEST_KERNEL", d, 1)
+		if kernel_ver is None:
+			qemu = "qemu-%s  -s 1048576" % target_arch
+		else:
+			qemu = "qemu-%s  -s 1048576 -r %s" % (target_arch, kernel_ver)
 		pkgname = 'locale-base-' + legitimize_package_name(name)
 		m = re.match("(.*)\.(.*)", name)
 		if m:
recipes/glibc/glibc-package.bbclass +5 -1
index 89fbd1c..8db8c5c 100644
@@ -252,7 +252,11 @@ python package_do_split_gconvs () {
 		if target_arch in ("i486", "i586", "i686"):
 		   target_arch = "i386"
 
-		qemu = "qemu-%s  -s 1048576 -r 2.6.16" % target_arch
+		kernel_ver = bb.data.getVar("OLDEST_KERNEL", d, 1)
+		if kernel_ver is None:
+			qemu = "qemu-%s  -s 1048576" % target_arch
+		else:
+			qemu = "qemu-%s  -s 1048576 -r %s" % (target_arch, kernel_ver)
 		pkgname = 'locale-base-' + legitimize_package_name(name)
 		m = re.match("(.*)\.(.*)", name)
 		if m:
Signature · 1 line
1.6.3.1
#13 lore raw

PATCH 2/3 (e)glibc-package: set LD_LIBRARY_PATH on binary locale generation

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.

---
 recipes/eglibc/eglibc-package.bbclass |    3 ++-
 recipes/glibc/glibc-package.bbclass   |    3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)
recipes/eglibc/eglibc-package.bbclass +2 -1
index 01f698a..241499f 100644
@@ -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)
recipes/glibc/glibc-package.bbclass +2 -1
index 8db8c5c..46f809e 100644
@@ -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)
Signature · 1 line
1.6.3.1
#14 lore raw

PATCH 3/3 (e)glibc-package: enable binary locale generation on x86 and x86_64

---
 recipes/eglibc/eglibc-package.bbclass |    4 +++-
 recipes/glibc/glibc-package.bbclass   |    2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)
recipes/eglibc/eglibc-package.bbclass +3 -1
index 241499f..22ff52b 100644
@@ -24,7 +24,7 @@ python __anonymous () {
 ENABLE_BINARY_LOCALE_GENERATION ?= "0"
 
 # BINARY_LOCALE_ARCHES is a space separated list of regular expressions
-BINARY_LOCALE_ARCHES ?= "arm.*"
+BINARY_LOCALE_ARCHES ?= "arm.* i[3-6]86 x86_64"
 
 PACKAGES = "eglibc-dbg eglibc catchsegv sln nscd ldd localedef eglibc-utils eglibc-dev eglibc-doc eglibc-locale libsegfault eglibc-extra-nss eglibc-thread-db eglibc-pcprofile"
 PACKAGES_DYNAMIC = "glibc-gconv-* glibc-charmap-* glibc-localedata-* glibc-binary-localedata-* eglibc-gconv-* eglibc-charmap-* eglibc-localedata-* eglibc-binary-localedata-* locale-base-*"
@@ -287,6 +287,8 @@ python package_do_split_gconvs () {
 
 	def output_locale_binary(name, locale, encoding):
 		target_arch = bb.data.getVar("TARGET_ARCH", d, 1)
+		if target_arch in ("i486", "i586", "i686"):
+			target_arch = "i386"
 		kernel_ver = bb.data.getVar("OLDEST_KERNEL", d, 1)
 		if kernel_ver is None:
 			qemu = "qemu-%s  -s 1048576" % target_arch
recipes/glibc/glibc-package.bbclass +1 -1
index 46f809e..ac7e0f3 100644
@@ -24,7 +24,7 @@ python __anonymous () {
 ENABLE_BINARY_LOCALE_GENERATION ?= "0"
 
 # BINARY_LOCALE_ARCHES is a space separated list of regular expressions
-BINARY_LOCALE_ARCHES ?= "arm.*"
+BINARY_LOCALE_ARCHES ?= "arm.* i[3-6]86 x86_64"
 
 # Set this to zero if you don't want ldconfig in the output package
 USE_LDCONFIG ?= "1"
Signature · 1 line
1.6.3.1
Acked-by on v1 3/3
#15 lore raw

Re: [PATCH 3/3] (e)glibc-package: enable binary locale generation on x86 and x86_64

On Sat, May 16, 2009 at 10:04:40PM +0400, Roman I Khimov wrote:

I assume the explanation got cut out,

Quoted 49 lines
---
 recipes/eglibc/eglibc-package.bbclass |    4 +++-
 recipes/glibc/glibc-package.bbclass   |    2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)
recipes/eglibc/eglibc-package.bbclass +3 -1
index 241499f..22ff52b 100644
@@ -24,7 +24,7 @@ python __anonymous () {
 ENABLE_BINARY_LOCALE_GENERATION ?= "0"
 
 # BINARY_LOCALE_ARCHES is a space separated list of regular expressions
-BINARY_LOCALE_ARCHES ?= "arm.*"
+BINARY_LOCALE_ARCHES ?= "arm.* i[3-6]86 x86_64"
 
 PACKAGES = "eglibc-dbg eglibc catchsegv sln nscd ldd localedef eglibc-utils eglibc-dev eglibc-doc eglibc-locale libsegfault eglibc-extra-nss eglibc-thread-db eglibc-pcprofile"
 PACKAGES_DYNAMIC = "glibc-gconv-* glibc-charmap-* glibc-localedata-* glibc-binary-localedata-* eglibc-gconv-* eglibc-charmap-* eglibc-localedata-* eglibc-binary-localedata-* locale-base-*"
@@ -287,6 +287,8 @@ python package_do_split_gconvs () {
 
 	def output_locale_binary(name, locale, encoding):
 		target_arch = bb.data.getVar("TARGET_ARCH", d, 1)
+		if target_arch in ("i486", "i586", "i686"):
+			target_arch = "i386"
 		kernel_ver = bb.data.getVar("OLDEST_KERNEL", d, 1)
 		if kernel_ver is None:
 			qemu = "qemu-%s  -s 1048576" % target_arch
recipes/glibc/glibc-package.bbclass +1 -1
index 46f809e..ac7e0f3 100644
@@ -24,7 +24,7 @@ python __anonymous () {
 ENABLE_BINARY_LOCALE_GENERATION ?= "0"
 
 # BINARY_LOCALE_ARCHES is a space separated list of regular expressions
-BINARY_LOCALE_ARCHES ?= "arm.*"
+BINARY_LOCALE_ARCHES ?= "arm.* i[3-6]86 x86_64"
 
 # Set this to zero if you don't want ldconfig in the output package
 USE_LDCONFIG ?= "1"
Signature · 7 lines
1.6.3.1


_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
Signature · 1 line
Tom Rini
Acked-by on v1 2/3
#16 lore raw

Re: [PATCH 2/3] (e)glibc-package: set LD_LIBRARY_PATH on binary locale generation

In reply to Roman I Khimov
Quoted 3 lines · Roman I Khimov

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.

Quoted 53 lines
---
 recipes/eglibc/eglibc-package.bbclass |    3 ++-
 recipes/glibc/glibc-package.bbclass   |    3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)
recipes/eglibc/eglibc-package.bbclass +2 -1
index 01f698a..241499f 100644
@@ -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)
recipes/glibc/glibc-package.bbclass +2 -1
index 8db8c5c..46f809e 100644
@@ -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)
Signature · 7 lines
1.6.3.1


_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
Signature · 1 line
Tom Rini
#17 lore raw

Re: [PATCH 2/3] (e)glibc-package: set LD_LIBRARY_PATH on binary locale generation

In reply to Roman I Khimov

recipes/eglibc/eglibc-package.bbclass python package_do_split_gconvs () { · line 317

Quoted 4 lines · Roman I Khimov
recipes/eglibc/eglibc-package.bbclass +1 -1
 		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)

It breaks in angstrom build for spitz. My qemu-arm from qemu-native-0.9.1+svnr4242-r15 (default for angstrom) apparently does not understand "-E". After reverting this patch (or removing -E argument from the command line manually) it works again.

Signature · 2 lines
Stanislav Brabec
http://www.penguin.cz/~utx/zaurus
#18 lore raw

Re: [PATCH 2/3] (e)glibc-package: set LD_LIBRARY_PATH on binary locale generation

Quoted 9 lines · On Tuesday 19 May 2009 19:08:37 Stanislav Brabec wrote:
Quoted 7 lines · Roman I Khimov

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)

Quoted 4 lines

It breaks in angstrom build for spitz. My qemu-arm from qemu-native-0.9.1+svnr4242-r15 (default for angstrom) apparently does not understand "-E". After reverting this patch (or removing -E argument from the command line manually) it works again.

Sorry for breaking the build, working on fix. Can you try qemu-native 0.10.3, maybe it'll work right out of the box for you?

Acked-by on v1 1/3
#19 lore raw

Re: [PATCH 1/3] (e)glibc-package: fix kernel version passed to qemu

In reply to Roman I Khimov
Quoted 10 lines · Roman I Khimov

Binary locale generation fails with

FATAL: kernel too old

if (e)glibc is configured for kernels newer than 2.6.16. This comes from kernel version check in sysdeps/unix/sysv/linux/dl-osinfo.h. We configure (e)glibc with "--enable-kernel=${OLDEST_KERNEL}", so to pass this check we need kernel version reported from QEMU to (e)glibc be $OLDEST_KERNEL or higher.

Fix qemu "-r" parameter to match OLDEST_KERNEL.

Quoted 48 lines
---
 recipes/eglibc/eglibc-package.bbclass |    6 +++++-
 recipes/glibc/glibc-package.bbclass   |    6 +++++-
 2 files changed, 10 insertions(+), 2 deletions(-)
recipes/eglibc/eglibc-package.bbclass +5 -1
index 7fcb558..01f698a 100644
@@ -287,7 +287,11 @@ python package_do_split_gconvs () {
 
 	def output_locale_binary(name, locale, encoding):
 		target_arch = bb.data.getVar("TARGET_ARCH", d, 1)
-		qemu = "qemu-%s -r 2.6.16" % target_arch
+		kernel_ver = bb.data.getVar("OLDEST_KERNEL", d, 1)
+		if kernel_ver is None:
+			qemu = "qemu-%s  -s 1048576" % target_arch
+		else:
+			qemu = "qemu-%s  -s 1048576 -r %s" % (target_arch, kernel_ver)
 		pkgname = 'locale-base-' + legitimize_package_name(name)
 		m = re.match("(.*)\.(.*)", name)
 		if m:
recipes/glibc/glibc-package.bbclass +5 -1
index 89fbd1c..8db8c5c 100644
@@ -252,7 +252,11 @@ python package_do_split_gconvs () {
 		if target_arch in ("i486", "i586", "i686"):
 		   target_arch = "i386"
 
-		qemu = "qemu-%s  -s 1048576 -r 2.6.16" % target_arch
+		kernel_ver = bb.data.getVar("OLDEST_KERNEL", d, 1)
+		if kernel_ver is None:
+			qemu = "qemu-%s  -s 1048576" % target_arch
+		else:
+			qemu = "qemu-%s  -s 1048576 -r %s" % (target_arch, kernel_ver)
 		pkgname = 'locale-base-' + legitimize_package_name(name)
 		m = re.match("(.*)\.(.*)", name)
 		if m:
Signature · 7 lines
1.6.3.1


_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
Signature · 1 line
Tom Rini