Skip to contentSkip to conversation

host-localedef: Compile against glibc-2.29

PATCH New Samuel Mendoza-Jonas 3 participants 6 messages Jun 19, 2019 – Aug 7, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 host-localedef: Compile against glibc-2.29

In glibc 2.27 the following change occurred:
"Statically compiled applications attempting to load locales compiled for the GNU C Library version 2.27 will fail and fall back to the builtin C/POSIX locale."

This impacts us since upstream buildroot uses a localdef built against an older eglibc release [0].

This is a combination of my patch to move to glibc and Peter Seiderer's patch to avoid building all of glibc just for localedef.

[0] https://bugs.busybox.net/show_bug.cgi?id=11096

[localedef build & fixups:]

---
This is an update to a previous very similar patch, but updated for glibc 2.29 now that Buildroot has moved to it.

 .../0001-Don-t-include-xlocale.h.patch        | 50 --------------
 ...ACK-only-build-and-install-localedef.patch | 65 +++++++++++++++++++
 .../localedef.hash                            |  7 ++
 package/localedef/localedef.hash              |  4 +-
 package/localedef/localedef.mk                | 45 ++++++++++---
 5 files changed, 110 insertions(+), 61 deletions(-)
 delete mode 100644 package/localedef/0001-Don-t-include-xlocale.h.patch
 create mode 100644 package/localedef/2.29-11-ge28ad442e73b00ae2047d89c8cc7f9b2a0de5436/0001-HACK-only-build-and-install-localedef.patch
 create mode 100644 package/localedef/2.29-11-ge28ad442e73b00ae2047d89c8cc7f9b2a0de5436/localedef.hash
package/localedef/0001-Don-t-include-xlocale.h.patch deleted +0 -50
deleted file mode 100644
index 9a6c2f8e90..0000000000
@@ -1,50 +0,0 @@
-From: Bernhard Walle <[email protected]>
-Date: Mon, 2 Oct 2017 16:55:23 +0200
-Subject: [PATCH] Don't include <xlocale.h>
-
-This header has been removed in glibc 2.26:
-
-https://abi-laboratory.pro/tracker/changelog/glibc/2.26/log.html
-
------------------------- >8 ------------------------
-* The nonstandard header <xlocale.h> has been removed.  Most programs should
-  use <locale.h> instead.  If you have a specific need for the definition of
-  locale_t with no other declarations, please contact
-  libc-alpha at sourceware.org and explain.
------------------------- 8< ------------------------
-
-Signed-off-by: Bernhard Walle <[email protected]>
-
-Upstream: https://git.pengutronix.de/cgit/ptxdist/tree/patches/localedef-eglibc-2.14.1-r17443-ptx1/0003-Don-t-include-xlocale.h.patch
-Signed-off-by: Peter Seiderer <[email protected]>
----
- eglibc/locale/langinfo.h | 2 +-
- eglibc/locale/locale.h   | 2 +-
- 2 files changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/eglibc/locale/langinfo.h b/eglibc/locale/langinfo.h
-index 0a5336507196..76707a4584c1 100644
---- a/eglibc/locale/langinfo.h
-+++ b/eglibc/locale/langinfo.h
-@@ -589,7 +589,7 @@ extern char *nl_langinfo (nl_item __item) __THROW;
-    more information.  */
- 
- /* Get locale datatype definition.  */
--# include <xlocale.h>
-+# include <locale.h>
- 
- /* Just like nl_langinfo but get the information from the locale object L.  */
- extern char *nl_langinfo_l (nl_item __item, __locale_t __l);
-diff --git a/eglibc/locale/locale.h b/eglibc/locale/locale.h
-index 2aa19e76acb2..18be711a2d40 100644
---- a/eglibc/locale/locale.h
-+++ b/eglibc/locale/locale.h
-@@ -143,7 +143,7 @@ __END_NAMESPACE_STD
-    This is a proof-of-concept implementation.  */
- 
- /* Get locale datatype definition.  */
--# include <xlocale.h>
-+# include_next <locale.h>
- 
- /* Return a reference to a data structure representing a set of locale
-    datasets.  Unlike for the CATEGORY parameter for `setlocale' the
package/localedef/2.29-11-ge28ad442e73b00ae2047d89c8cc7f9b2a0de5436/0001-HACK-only-build-and-install-localedef.patch new file +65 -0

65 lines not on this page · raw message

package/localedef/2.29-11-ge28ad442e73b00ae2047d89c8cc7f9b2a0de5436/localedef.hash new file +7 -0
new file mode 100644
index 0000000000..f9b0eede9e
@@ -0,0 +1,7 @@
+# Locally calculated (fetched from Github)
+sha256  a5d4cbe7eceaefd8bce1104994379818169961b59346d2f3897966912237b1e6  localedef-2.29-11-ge28ad442e73b00ae2047d89c8cc7f9b2a0de5436.tar.gz
+
+# Hashes for license files
+sha256  8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643  COPYING
+sha256  dc626520dcd53a22f727af3ee42c770e56c97a64fe3adb063799d8ab032fe551  COPYING.LIB
+sha256  35bdb41dc0bcb10702ddacbd51ec4c0fe6fb3129f734e8c85fc02e4d3eb0ce3f  LICENSES
package/localedef/localedef.hash +2 -2
index ee14fb16b8..5316f03b10 100644
@@ -1,2 +1,2 @@
-# Locally calculated
-sha256 9a60f7cdab6fb39adf23a12102f2d950d5f07f0cd7e51e85ec327e07440a79c6  localedef-eglibc-2.14.1-r17443-ptx1.tar.bz2
+# This hash file is not used; instead, update the
+# hash files in the per-version sub-directories.
package/localedef/localedef.mk +36 -9

55 lines not on this page · raw message

Signature · 1 line
2.21.0
#1 lore raw

PATCH 1/1 host-localedef: Compile against glibc-2.29

Hello,

Quoted 11 lines · On Wed, 19 Jun 2019 12:07:07 +1000 Samuel Mendoza-Jonas <[email protected]>…

In glibc 2.27 the following change occurred:
"Statically compiled applications attempting to load locales compiled for the GNU C Library version 2.27 will fail and fall back to the builtin C/POSIX locale."

This impacts us since upstream buildroot uses a localdef built against an older eglibc release [0].

This is a combination of my patch to move to glibc and Peter Seiderer's patch to avoid building all of glibc just for localedef.

Quoted 8 lines

[0] https://bugs.busybox.net/show_bug.cgi?id=11096

[localedef build & fixups:]

---
This is an update to a previous very similar patch, but updated for glibc 2.29 now that Buildroot has moved to it.

So, since it's been a problem pending for way too long, I applied your patch to master. I however did a change: make sure we re-use the glibc tarball if possible. To do this:

- I defined LOCALEDEF_SOURCE = glibc-$(LOCALEDEF_VERSION).tar.gz and HOST_LOCALEDEF_DL_SUBDIR = glibc

- I changed the hash file because the tarball is now named glibc-<version>.tar.gz

I also wondered about making localedef.hash a symlink to glibc.hash, but that would require updating the symlink everything the glibc version is updated, because glibc.hash is in a version-specific folder.

Overall, I am wondering if we shouldn't give up on this host-localedef package and in fact move this to a host-glibc package. Indeed that's really what we're doing here: build a host-glibc package.

The only issue with doing this is the "HACK" patch. Indeed, how to make sure this patch will apply to all glibc versions we support ?

But since the locale problem has been around for a long time, I preferred to apply your approach now, we can always improve things later if we think it's useful.

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#2 lore raw

PATCH 1/1 host-localedef: Compile against glibc-2.29

Quoted 44 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

Hello,

Quoted 11 lines · On Wed, 19 Jun 2019 12:07:07 +1000 Samuel Mendoza-Jonas <[email protected]>…

In glibc 2.27 the following change occurred:
"Statically compiled applications attempting to load locales compiled for the GNU C Library version 2.27 will fail and fall back to the builtin C/POSIX locale."

This impacts us since upstream buildroot uses a localdef built against an older eglibc release [0].

This is a combination of my patch to move to glibc and Peter Seiderer's patch to avoid building all of glibc just for localedef.

Quoted 8 lines

[0] https://bugs.busybox.net/show_bug.cgi?id=11096

[localedef build & fixups:]

---
This is an update to a previous very similar patch, but updated for glibc 2.29 now that Buildroot has moved to it.

So, since it's been a problem pending for way too long, I applied your patch to master. I however did a change: make sure we re-use the glibc tarball if possible. To do this:

- I defined LOCALEDEF_SOURCE = glibc-$(LOCALEDEF_VERSION).tar.gz and HOST_LOCALEDEF_DL_SUBDIR = glibc

- I changed the hash file because the tarball is now named glibc-<version>.tar.gz

I also wondered about making localedef.hash a symlink to glibc.hash, but that would require updating the symlink everything the glibc version is updated, because glibc.hash is in a version-specific folder.

Overall, I am wondering if we shouldn't give up on this host-localedef package and in fact move this to a host-glibc package. Indeed that's really what we're doing here: build a host-glibc package.

Quoted 6 lines

The only issue with doing this is the "HACK" patch. Indeed, how to make sure this patch will apply to all glibc versions we support ?

But since the locale problem has been around for a long time, I preferred to apply your approach now, we can always improve things later if we think it's useful.

Committed to 2019.05.x, thanks.

2019.02.x is using glibc-2.28. Is using this 2.29-based localedef the right solution for 2019.02.x, or should we be using something 2.28 based?

Signature · 1 line
Bye, Peter Korsgaard
#3 lore raw

PATCH 1/1 host-localedef: Compile against glibc-2.29

Quoted 51 lines · Peter Korsgaard
Quoted 44 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

Hello,

Quoted 11 lines · On Wed, 19 Jun 2019 12:07:07 +1000 Samuel Mendoza-Jonas <[email protected]>…

In glibc 2.27 the following change occurred:
"Statically compiled applications attempting to load locales compiled for the GNU C Library version 2.27 will fail and fall back to the builtin C/POSIX locale."

This impacts us since upstream buildroot uses a localdef built against an older eglibc release [0].

This is a combination of my patch to move to glibc and Peter Seiderer's patch to avoid building all of glibc just for localedef.

Quoted 8 lines

[0] https://bugs.busybox.net/show_bug.cgi?id=11096

[localedef build & fixups:]

---
This is an update to a previous very similar patch, but updated for glibc 2.29 now that Buildroot has moved to it.

So, since it's been a problem pending for way too long, I applied your patch to master. I however did a change: make sure we re-use the glibc tarball if possible. To do this:

- I defined LOCALEDEF_SOURCE = glibc-$(LOCALEDEF_VERSION).tar.gz and HOST_LOCALEDEF_DL_SUBDIR = glibc

- I changed the hash file because the tarball is now named glibc-<version>.tar.gz

I also wondered about making localedef.hash a symlink to glibc.hash, but that would require updating the symlink everything the glibc version is updated, because glibc.hash is in a version-specific folder.

Overall, I am wondering if we shouldn't give up on this host-localedef package and in fact move this to a host-glibc package. Indeed that's really what we're doing here: build a host-glibc package.

Quoted 6 lines

The only issue with doing this is the "HACK" patch. Indeed, how to make sure this patch will apply to all glibc versions we support ?

But since the locale problem has been around for a long time, I preferred to apply your approach now, we can always improve things later if we think it's useful.

Quoted 6 lines

Committed to 2019.05.x, thanks.

2019.02.x is using glibc-2.28. Is using this 2.29-based localedef the right solution for 2019.02.x, or should we be using something 2.28 based?

I've not tested with a localedef ahead of glibc, but if we want to fix up 2019.02 as well then basically the same patch minus the 2.28->2.29 updates should work fine, eg:
https://github.com/sammj/buildroot/commit/7fedd772a6caac0cbc69a90a8c1da8c142eae9ac

(not directly tested, but that's the same as what we've been running in our
2019.02-based op-build tree)

Cheers,
Sam

#4 lore raw

PATCH 1/1 host-localedef: Compile against glibc-2.29

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Samuel" == Samuel Mendoza-Jonas <[email protected]> writes:

Hi,

Quoted 5 lines
Quoted 4 lines

2019.02.x is using glibc-2.28. Is using this 2.29-based localedef the right solution for 2019.02.x, or should we be using something 2.28 based?

Quoted 7 lines

I've not tested with a localedef ahead of glibc, but if we want to fix up 2019.02 as well then basically the same patch minus the 2.28->2.29 updates should work fine, eg:
https://github.com/sammj/buildroot/commit/7fedd772a6caac0cbc69a90a8c1da8c142eae9ac

(not directly tested, but that's the same as what we've been running in our
2019.02-based op-build tree)

Great, could you send a patch for 2019.02.x with this?

Signature · 1 line
Bye, Peter Korsgaard
#5 lore raw

PATCH 1/1 host-localedef: Compile against glibc-2.29

Quoted 15 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

"Peter" == Peter Korsgaard <[email protected]> writes:

"Samuel" == Samuel Mendoza-Jonas <[email protected]> writes:

Hi,

Quoted 9 lines
Quoted 4 lines

2019.02.x is using glibc-2.28. Is using this 2.29-based localedef the right solution for 2019.02.x, or should we be using something 2.28 based?

I've not tested with a localedef ahead of glibc, but if we want to fix up 2019.02 as well then basically the same patch minus the 2.28->2.29 updates should work fine, eg:
https://github.com/sammj/buildroot/commit/7fedd772a6caac0cbc69a90a8c1da8c142eae9ac

Quoted 4 lines
Quoted 2 lines

(not directly tested, but that's the same as what we've been running in our 2019.02-based op-build tree)

Great, could you send a patch for 2019.02.x with this?

I don't think you ever sent such a patch. Can you please do so? Thanks

Signature · 1 line
Bye, Peter Korsgaard