summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2018-08-13 12:44:05 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-08-15 09:33:53 +0100
commit3ab1249a2ac92a0fcb008e92cc9ee272441408f4 (patch)
tree5c7fc66cd84e51fe3d9de8c6b83dfb256ef9cb50
parent8ffd93bdb09b0a4a84b27dafcd684c6abba392ed (diff)
downloadopenembedded-core-contrib-3ab1249a2ac92a0fcb008e92cc9ee272441408f4.tar.gz
openembedded-core-contrib-3ab1249a2ac92a0fcb008e92cc9ee272441408f4.tar.bz2
openembedded-core-contrib-3ab1249a2ac92a0fcb008e92cc9ee272441408f4.zip
glibc: Fix locale archive path patch
The locale code uses the archive location in two places, ensure both are corrected to use the environment variable which avoids nasty build failures when archiving locales in images. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-core/glibc/glibc/0029-localedef-add-to-archive-uses-a-hard-coded-locale-pa.patch54
1 files changed, 45 insertions, 9 deletions
diff --git a/meta/recipes-core/glibc/glibc/0029-localedef-add-to-archive-uses-a-hard-coded-locale-pa.patch b/meta/recipes-core/glibc/glibc/0029-localedef-add-to-archive-uses-a-hard-coded-locale-pa.patch
index aa3a9e2654..8bdd466806 100644
--- a/meta/recipes-core/glibc/glibc/0029-localedef-add-to-archive-uses-a-hard-coded-locale-pa.patch
+++ b/meta/recipes-core/glibc/glibc/0029-localedef-add-to-archive-uses-a-hard-coded-locale-pa.patch
@@ -18,11 +18,50 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
locale/programs/locarchive.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
-diff --git a/locale/programs/locarchive.c b/locale/programs/locarchive.c
-index ca332a345f..6b7ba9b2e3 100644
---- a/locale/programs/locarchive.c
-+++ b/locale/programs/locarchive.c
-@@ -569,10 +569,13 @@ open_archive (struct locarhandle *ah, bool readonly)
+Index: git/locale/programs/locarchive.c
+===================================================================
+--- git.orig/locale/programs/locarchive.c
++++ git/locale/programs/locarchive.c
+@@ -340,12 +340,24 @@ enlarge_archive (struct locarhandle *ah,
+ struct namehashent *oldnamehashtab;
+ struct locarhandle new_ah;
+ size_t prefix_len = output_prefix ? strlen (output_prefix) : 0;
+- char archivefname[prefix_len + sizeof (ARCHIVE_NAME)];
+- char fname[prefix_len + sizeof (ARCHIVE_NAME) + sizeof (".XXXXXX") - 1];
++ char *archivefname;
++ char *fname;
++ char *envarchive = getenv("LOCALEARCHIVE");
+
+- if (output_prefix)
+- memcpy (archivefname, output_prefix, prefix_len);
+- strcpy (archivefname + prefix_len, ARCHIVE_NAME);
++ if (envarchive != NULL)
++ {
++ archivefname = xmalloc(strlen(envarchive) + 1);
++ fname = xmalloc(strlen(envarchive) + sizeof (".XXXXXX"));
++ strcpy (archivefname, envarchive);
++ }
++ else
++ {
++ archivefname = xmalloc(prefix_len + sizeof (ARCHIVE_NAME));
++ fname = xmalloc(prefix_len + sizeof (ARCHIVE_NAME) + sizeof (".XXXXXX") - 1);
++ if (output_prefix)
++ memcpy (archivefname, output_prefix, prefix_len);
++ strcpy (archivefname + prefix_len, ARCHIVE_NAME);
++ }
+ strcpy (stpcpy (fname, archivefname), ".XXXXXX");
+
+ /* Not all of the old file has to be mapped. Change this now this
+@@ -551,6 +563,8 @@ enlarge_archive (struct locarhandle *ah,
+
+ /* Add the information for the new one. */
+ *ah = new_ah;
++ free(archivefname);
++ free(fname);
+ }
+
+
+@@ -569,10 +583,13 @@ open_archive (struct locarhandle *ah, bo
/* If ah has a non-NULL fname open that otherwise open the default. */
if (archivefname == NULL)
{
@@ -40,7 +79,7 @@ index ca332a345f..6b7ba9b2e3 100644
}
while (1)
-@@ -585,7 +588,7 @@ open_archive (struct locarhandle *ah, bool readonly)
+@@ -585,7 +602,7 @@ open_archive (struct locarhandle *ah, bo
the default locale archive we ignore the failure and
list an empty archive, otherwise we print an error
and exit. */
@@ -49,6 +88,3 @@ index ca332a345f..6b7ba9b2e3 100644
{
if (readonly)
{
---
-2.18.0
-