summaryrefslogtreecommitdiffstats
path: root/meta
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:44:33 +0100
commit71d87cce855eb755533d3b55a761c09e76e3cd83 (patch)
tree58fe787cbca38bf19c34eab15d973bedc1666172 /meta
parent65c8154f2169e6e901dd1e38d3cc893b019a8e11 (diff)
downloadpoky-71d87cce855eb755533d3b55a761c09e76e3cd83.tar.gz
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. (From OE-Core rev: 3ab1249a2ac92a0fcb008e92cc9ee272441408f4) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-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>
18 locale/programs/locarchive.c | 13 ++++++++----- 18 locale/programs/locarchive.c | 13 ++++++++-----
19 1 file changed, 8 insertions(+), 5 deletions(-) 19 1 file changed, 8 insertions(+), 5 deletions(-)
20 20
21diff --git a/locale/programs/locarchive.c b/locale/programs/locarchive.c 21Index: git/locale/programs/locarchive.c
22index ca332a345f..6b7ba9b2e3 100644 22===================================================================
23--- a/locale/programs/locarchive.c 23--- git.orig/locale/programs/locarchive.c
24+++ b/locale/programs/locarchive.c 24+++ git/locale/programs/locarchive.c
25@@ -569,10 +569,13 @@ open_archive (struct locarhandle *ah, bool readonly) 25@@ -340,12 +340,24 @@ enlarge_archive (struct locarhandle *ah,
26 struct namehashent *oldnamehashtab;
27 struct locarhandle new_ah;
28 size_t prefix_len = output_prefix ? strlen (output_prefix) : 0;
29- char archivefname[prefix_len + sizeof (ARCHIVE_NAME)];
30- char fname[prefix_len + sizeof (ARCHIVE_NAME) + sizeof (".XXXXXX") - 1];
31+ char *archivefname;
32+ char *fname;
33+ char *envarchive = getenv("LOCALEARCHIVE");
34
35- if (output_prefix)
36- memcpy (archivefname, output_prefix, prefix_len);
37- strcpy (archivefname + prefix_len, ARCHIVE_NAME);
38+ if (envarchive != NULL)
39+ {
40+ archivefname = xmalloc(strlen(envarchive) + 1);
41+ fname = xmalloc(strlen(envarchive) + sizeof (".XXXXXX"));
42+ strcpy (archivefname, envarchive);
43+ }
44+ else
45+ {
46+ archivefname = xmalloc(prefix_len + sizeof (ARCHIVE_NAME));
47+ fname = xmalloc(prefix_len + sizeof (ARCHIVE_NAME) + sizeof (".XXXXXX") - 1);
48+ if (output_prefix)
49+ memcpy (archivefname, output_prefix, prefix_len);
50+ strcpy (archivefname + prefix_len, ARCHIVE_NAME);
51+ }
52 strcpy (stpcpy (fname, archivefname), ".XXXXXX");
53
54 /* Not all of the old file has to be mapped. Change this now this
55@@ -551,6 +563,8 @@ enlarge_archive (struct locarhandle *ah,
56
57 /* Add the information for the new one. */
58 *ah = new_ah;
59+ free(archivefname);
60+ free(fname);
61 }
62
63
64@@ -569,10 +583,13 @@ open_archive (struct locarhandle *ah, bo
26 /* If ah has a non-NULL fname open that otherwise open the default. */ 65 /* If ah has a non-NULL fname open that otherwise open the default. */
27 if (archivefname == NULL) 66 if (archivefname == NULL)
28 { 67 {
@@ -40,7 +79,7 @@ index ca332a345f..6b7ba9b2e3 100644
40 } 79 }
41 80
42 while (1) 81 while (1)
43@@ -585,7 +588,7 @@ open_archive (struct locarhandle *ah, bool readonly) 82@@ -585,7 +602,7 @@ open_archive (struct locarhandle *ah, bo
44 the default locale archive we ignore the failure and 83 the default locale archive we ignore the failure and
45 list an empty archive, otherwise we print an error 84 list an empty archive, otherwise we print an error
46 and exit. */ 85 and exit. */
@@ -49,6 +88,3 @@ index ca332a345f..6b7ba9b2e3 100644
49 { 88 {
50 if (readonly) 89 if (readonly)
51 { 90 {
52--
532.18.0
54