summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@windriver.com>2016-03-09 13:58:41 -0600
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-03-10 23:13:54 +0000
commit775f22e36f5dd36c8f9e0143c2697782ebd49a33 (patch)
tree66c8c8155b758a927659cd19382b36a49a0f6e6c /meta
parent001bdefca023f41d89824cdb2b85832bf7824b26 (diff)
downloadpoky-775f22e36f5dd36c8f9e0143c2697782ebd49a33.tar.gz
rpm: Fix musl integration with RPM5
(From OE-Core rev: e4d6f4f48f83a5881351007aae66427e0b11fc8a) Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-devtools/rpm/rpm/0001-rpm-Fix-build-on-musl.patch242
-rw-r--r--meta/recipes-devtools/rpm/rpm/rpm-autogen-force.patch78
-rw-r--r--meta/recipes-devtools/rpm/rpm_5.4+cvs.bb1
-rw-r--r--meta/recipes-devtools/rpm/rpm_5.4.16.bb1
4 files changed, 267 insertions, 55 deletions
diff --git a/meta/recipes-devtools/rpm/rpm/0001-rpm-Fix-build-on-musl.patch b/meta/recipes-devtools/rpm/rpm/0001-rpm-Fix-build-on-musl.patch
index 763dc57652..70dd4ff532 100644
--- a/meta/recipes-devtools/rpm/rpm/0001-rpm-Fix-build-on-musl.patch
+++ b/meta/recipes-devtools/rpm/rpm/0001-rpm-Fix-build-on-musl.patch
@@ -7,21 +7,37 @@ Provide alternatives to assumptions about glibc
7on linux 7on linux
8 8
9Signed-off-by: Khem Raj <raj.khem@gmail.com> 9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10
11Updated to 5.4.16 (CVS)
12
13The patch will likely need additional rework before it can be accepted upsteam
14due to the way MUSL changes are patched in.
15
16Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
17
10--- 18---
11Upstream-Status: Pending 19Upstream-Status: Pending
12 20
13 rpmio/fts.c | 4 ++++ 21 lib/poptALL.c | 2 ++
14 rpmqv.c | 6 +++++- 22 rpmio/fts.c | 4 ++++
15 system.h | 2 +- 23 rpmio/poptIO.c | 2 ++
16 tools/debugedit.c | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 24 rpmqv.c | 2 ++
17 tools/rpmfind.c | 6 +++--- 25 system.h | 13 ++++++-------
18 5 files changed, 60 insertions(+), 5 deletions(-) 26 tools/debugedit.c | 47 +++++++++++++++++++++++++++++++++++++++++++++++
27 tools/rpm2cpio.c | 2 ++
28 tools/rpmcache.c | 2 ++
29 tools/rpmcmp.c | 2 ++
30 tools/rpmdeps-oecore.c | 2 ++
31 tools/rpmdeps.c | 2 ++
32 tools/rpmdigest.c | 2 ++
33 tools/rpmfind.c | 6 +++---
34 13 files changed, 78 insertions(+), 10 deletions(-)
19 35
20diff --git a/rpmio/fts.c b/rpmio/fts.c 36Index: rpm-5.4.15/rpmio/fts.c
21index 2d7594c..b7aa9b8 100644 37===================================================================
22--- a/rpmio/fts.c 38--- rpm-5.4.15.orig/rpmio/fts.c
23+++ b/rpmio/fts.c 39+++ rpm-5.4.15/rpmio/fts.c
24@@ -124,6 +124,10 @@ static char sccsid[] = "@(#)fts.c 8.6 (Berkeley) 8/14/94"; 40@@ -124,6 +124,10 @@ static char sccsid[] = "@(#)fts.c 8.6 (B
25 # define __fxstat64(_stat_ver, _fd, _sbp) fstat((_fd), (_sbp)) 41 # define __fxstat64(_stat_ver, _fd, _sbp) fstat((_fd), (_sbp))
26 #endif 42 #endif
27 43
@@ -32,39 +48,11 @@ index 2d7594c..b7aa9b8 100644
32 #if !defined(_D_EXACT_NAMLEN) 48 #if !defined(_D_EXACT_NAMLEN)
33 # define _D_EXACT_NAMLEN(d) (strlen((d)->d_name)) 49 # define _D_EXACT_NAMLEN(d) (strlen((d)->d_name))
34 #endif 50 #endif
35diff --git a/rpmqv.c b/rpmqv.c 51Index: rpm-5.4.15/tools/debugedit.c
36index 14c73e2..b2d3e24 100644 52===================================================================
37--- a/rpmqv.c 53--- rpm-5.4.15.orig/tools/debugedit.c
38+++ b/rpmqv.c 54+++ rpm-5.4.15/tools/debugedit.c
39@@ -523,7 +523,11 @@ int main(int argc, const char ** argv) 55@@ -22,7 +22,12 @@
40 (void) initproctitle(argc, (char **)argv, environ);
41 #endif
42 #endif
43-
44+ /* XXX glibc churn sanity */
45+ if (__progname == NULL) {
46+ if ((__progname = strrchr(argv[0], '/')) != NULL) __progname++;
47+ else __progname = argv[0];
48+ }
49 /* Set the major mode based on argv[0] */
50 /*@-nullpass@*/
51 #ifdef IAM_RPMBT
52diff --git a/system.h b/system.h
53index 72851c0..05f7553 100644
54--- a/system.h
55+++ b/system.h
56@@ -791,5 +791,5 @@ static inline const char *rcsid(const char *p) { \
57 * Permit ar(1) payloads. Disabled while rpmio/iosm.c is under development.
58 */
59 #undef SUPPORT_AR_PAYLOADS
60-
61 #endif /* H_SYSTEM */
62+const char *program_name;
63diff --git a/tools/debugedit.c b/tools/debugedit.c
64index 29e8ee9..b2a8918 100644
65--- a/tools/debugedit.c
66+++ b/tools/debugedit.c
67@@ -23,7 +23,12 @@
68 #include <byteswap.h> 56 #include <byteswap.h>
69 #include <endian.h> 57 #include <endian.h>
70 #include <errno.h> 58 #include <errno.h>
@@ -77,7 +65,7 @@ index 29e8ee9..b2a8918 100644
77 #include <limits.h> 65 #include <limits.h>
78 #include <string.h> 66 #include <string.h>
79 #include <stdlib.h> 67 #include <stdlib.h>
80@@ -1531,6 +1536,48 @@ handle_build_id (DSO *dso, Elf_Data *build_id, 68@@ -1535,6 +1540,48 @@ handle_build_id (DSO *dso, Elf_Data *bui
81 puts (hex); 69 puts (hex);
82 } 70 }
83 } 71 }
@@ -126,11 +114,11 @@ index 29e8ee9..b2a8918 100644
126 114
127 /* It avoided the segment fault while file's bss offset have a large number. 115 /* It avoided the segment fault while file's bss offset have a large number.
128 See https://bugzilla.redhat.com/show_bug.cgi?id=1019707 116 See https://bugzilla.redhat.com/show_bug.cgi?id=1019707
129diff --git a/tools/rpmfind.c b/tools/rpmfind.c 117Index: rpm-5.4.15/tools/rpmfind.c
130index 816aeef..327fab0 100644 118===================================================================
131--- a/tools/rpmfind.c 119--- rpm-5.4.15.orig/tools/rpmfind.c
132+++ b/tools/rpmfind.c 120+++ rpm-5.4.15/tools/rpmfind.c
133@@ -1174,7 +1174,7 @@ find_parsenum(PLAN *plan, const char *option, char *vp, char *endch) 121@@ -1175,7 +1175,7 @@ find_parsenum(PLAN *plan, const char *op
134 * and endchar points to the beginning of the string we know we have 122 * and endchar points to the beginning of the string we know we have
135 * a syntax error. 123 * a syntax error.
136 */ 124 */
@@ -139,7 +127,7 @@ index 816aeef..327fab0 100644
139 value = strtoll(str, &endchar, 10); 127 value = strtoll(str, &endchar, 10);
140 #else 128 #else
141 value = strtoq(str, &endchar, 10); 129 value = strtoq(str, &endchar, 10);
142@@ -1214,7 +1214,7 @@ find_parsetime(PLAN *plan, const char *option, char *vp) 130@@ -1215,7 +1215,7 @@ find_parsetime(PLAN *plan, const char *o
143 break; 131 break;
144 } 132 }
145 133
@@ -148,7 +136,7 @@ index 816aeef..327fab0 100644
148 value = strtoll(str, &unit, 10); 136 value = strtoll(str, &unit, 10);
149 #else 137 #else
150 value = strtoq(str, &unit, 10); 138 value = strtoq(str, &unit, 10);
151@@ -1252,7 +1252,7 @@ find_parsetime(PLAN *plan, const char *option, char *vp) 139@@ -1253,7 +1253,7 @@ find_parsetime(PLAN *plan, const char *o
152 str = unit + 1; 140 str = unit + 1;
153 if (*str == '\0') /* EOS */ 141 if (*str == '\0') /* EOS */
154 break; 142 break;
@@ -157,6 +145,150 @@ index 816aeef..327fab0 100644
157 value = strtoll(str, &unit, 10); 145 value = strtoll(str, &unit, 10);
158 #else 146 #else
159 value = strtoq(str, &unit, 10); 147 value = strtoq(str, &unit, 10);
160-- 148Index: rpm-5.4.15/system.h
1612.7.1 149===================================================================
162 150--- rpm-5.4.15.orig/system.h
151+++ rpm-5.4.15/system.h
152@@ -372,16 +372,15 @@ extern int _tolower(int) __THROW /*@*/;
153 #define __progname __assert_program_name
154 #endif
155 #define setprogname(pn)
156+/*@unchecked@*/
157+extern const char *__progname;
158 #else
159-#define __progname program_name
160-#define setprogname(pn) \
161- { if ((__progname = strrchr(pn, '/')) != NULL) __progname++; \
162- else __progname = pn; \
163- }
164-#endif
165+#define setprogname(pn)
166+#define progname __progname
167
168 /*@unchecked@*/
169-extern const char *__progname;
170+extern char *__progname;
171+#endif
172
173 /* -- Retrofit missing prototypes (if needed). */
174 #ifdef __cplusplus
175Index: rpm-5.4.15/rpmio/poptIO.c
176===================================================================
177--- rpm-5.4.15.orig/rpmio/poptIO.c
178+++ rpm-5.4.15/rpmio/poptIO.c
179@@ -65,7 +65,9 @@ extern int _rpmsvn_debug;
180 GENfree(rpmioP)
181 #endif /* __cplusplus */
182
183+#ifdef __GLIBC__
184 const char *__progname;
185+#endif
186
187 #if !defined(POPT_ARGFLAG_TOGGLE) /* XXX compat with popt < 1.15 */
188 #define POPT_ARGFLAG_TOGGLE 0
189Index: rpm-5.4.15/lib/poptALL.c
190===================================================================
191--- rpm-5.4.15.orig/lib/poptALL.c
192+++ rpm-5.4.15/lib/poptALL.c
193@@ -4,7 +4,9 @@
194 */
195
196 #include "system.h"
197+#ifdef __GLIBC__
198 extern const char *__progname;
199+#endif
200
201 #if defined(RPM_VENDOR_WINDRIVER)
202 const char *__usrlibrpm = USRLIBRPM;
203Index: rpm-5.4.15/tools/rpm2cpio.c
204===================================================================
205--- rpm-5.4.15.orig/tools/rpm2cpio.c
206+++ rpm-5.4.15/tools/rpm2cpio.c
207@@ -1,7 +1,9 @@
208 /* rpmarchive: spit out the main archive portion of a package */
209
210 #include "system.h"
211+#ifdef __GLIBC__
212 const char *__progname;
213+#endif
214
215 #include <rpmio.h>
216 #include <rpmiotypes.h> /* XXX fnpyKey */
217Index: rpm-5.4.15/tools/rpmcache.c
218===================================================================
219--- rpm-5.4.15.orig/tools/rpmcache.c
220+++ rpm-5.4.15/tools/rpmcache.c
221@@ -3,7 +3,9 @@
222 */
223
224 #include "system.h"
225+#ifdef __GLIBC__
226 const char *__progname;
227+#endif
228
229 #include <fnmatch.h>
230 #include <fts.h>
231Index: rpm-5.4.15/tools/rpmdeps-oecore.c
232===================================================================
233--- rpm-5.4.15.orig/tools/rpmdeps-oecore.c
234+++ rpm-5.4.15/tools/rpmdeps-oecore.c
235@@ -1,5 +1,7 @@
236 #include "system.h"
237+#ifdef __GLIBC__
238 const char *__progname;
239+#endif
240
241 #include <rpmio.h>
242 #include <rpmiotypes.h>
243Index: rpm-5.4.15/tools/rpmdeps.c
244===================================================================
245--- rpm-5.4.15.orig/tools/rpmdeps.c
246+++ rpm-5.4.15/tools/rpmdeps.c
247@@ -1,5 +1,7 @@
248 #include "system.h"
249+#ifdef __GLIBC__
250 const char *__progname;
251+#endif
252
253 #include <rpmio.h>
254 #include <rpmiotypes.h>
255Index: rpm-5.4.15/tools/rpmdigest.c
256===================================================================
257--- rpm-5.4.15.orig/tools/rpmdigest.c
258+++ rpm-5.4.15/tools/rpmdigest.c
259@@ -1,6 +1,8 @@
260 #include "system.h"
261+#ifdef __GLIBC__
262 /*@unchecked@*/
263 extern const char * __progname;
264+#endif
265
266 #define _RPMIOB_INTERNAL
267 #include <rpmiotypes.h>
268Index: rpm-5.4.15/tools/rpmcmp.c
269===================================================================
270--- rpm-5.4.15.orig/tools/rpmcmp.c
271+++ rpm-5.4.15/tools/rpmcmp.c
272@@ -13,8 +13,10 @@
273
274 #include "debug.h"
275
276+#ifdef __GLIBC__
277 const char *__progname;
278 #define progname __progname
279+#endif
280
281 static int pointRpmEVR(ARGV_t av)
282 {
283Index: rpm-5.4.15/rpmqv.c
284===================================================================
285--- rpm-5.4.15.orig/rpmqv.c
286+++ rpm-5.4.15/rpmqv.c
287@@ -1,5 +1,7 @@
288 #include "system.h"
289+#ifdef __GLIBC__
290 extern const char *__progname;
291+#endif
292
293 /* Copyright (C) 1998-2002 - Red Hat, Inc. */
294
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-autogen-force.patch b/meta/recipes-devtools/rpm/rpm/rpm-autogen-force.patch
new file mode 100644
index 0000000000..258a7f6e72
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-autogen-force.patch
@@ -0,0 +1,78 @@
1In order to enable musl or other libc support, force update the config.guess
2
3In order to reliably replace config.guess and config.sub, we need to remove
4them prior to the call to automake. Adding the --force-missing is likely
5not necessary, but matching normal OE autoreconf usage.
6
7Upstream-Status: Inappropriate [configuration]
8
9Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
10
11Index: rpm-5.4.15/autogen.sh
12===================================================================
13--- rpm-5.4.15.orig/autogen.sh
14+++ rpm-5.4.15/autogen.sh
15@@ -73,7 +73,8 @@ rm -f aclocal.m4
16 aclocal -I m4
17 autoheader -I m4
18 echo "---> generate files via GNU automake (automake)"
19-automake -Wall -Wno-override -a -c
20+rm -f config.guess config.sub
21+automake -Wall -Wno-override -a -c --force-missing
22 echo "---> generate files via GNU autoconf (autoconf)"
23 autoconf -I m4
24 echo "<=== rpm"
25Index: rpm-5.4.15/beecrypt/autogen.sh
26===================================================================
27--- rpm-5.4.15.orig/beecrypt/autogen.sh
28+++ rpm-5.4.15/beecrypt/autogen.sh
29@@ -25,6 +25,7 @@ libtoolize () {
30
31 libtoolize --force --copy
32 aclocal
33-automake -a -c
34+rm -f config.guess config.sub
35+automake -a -c --force-missing
36 autoconf
37 autoheader
38Index: rpm-5.4.15/libtpm/autogen.sh
39===================================================================
40--- rpm-5.4.15.orig/libtpm/autogen.sh
41+++ rpm-5.4.15/libtpm/autogen.sh
42@@ -46,7 +46,8 @@ echo "---> generate files via GNU autoco
43 aclocal
44 autoheader
45 echo "---> generate files via GNU automake (automake)"
46-automake -Wall -Wno-override -a -c
47+rm -f config.guess config.sub
48+automake -Wall -Wno-override -a -c --force-missing
49 echo "---> generate files via GNU autoconf (autoconf)"
50 autoconf
51
52Index: rpm-5.4.15/neon/autogen.sh
53===================================================================
54--- rpm-5.4.15.orig/neon/autogen.sh
55+++ rpm-5.4.15/neon/autogen.sh
56@@ -63,7 +63,8 @@ echo "---> generate files via GNU autoco
57 ${ACLOCAL:-aclocal} -I macros
58 ${AUTOHEADER:-autoheader}
59 echo "---> generate files via GNU automake (automake)"
60-${AUTOMAKE:-automake} -Wall -Wno-override -a -c
61+rm -f config.guess config.sub
62+${AUTOMAKE:-automake} -Wall -Wno-override -a -c --force-missing
63 echo "---> generate files via GNU autoconf (autoconf)"
64 ${AUTOCONF:-autoconf} -Wall
65
66Index: rpm-5.4.15/syck/autogen.sh
67===================================================================
68--- rpm-5.4.15.orig/syck/autogen.sh
69+++ rpm-5.4.15/syck/autogen.sh
70@@ -40,6 +40,7 @@ echo "---> generate files via GNU autoco
71 aclocal
72 autoheader
73 echo "---> generate files via GNU automake (automake)"
74-automake -Wall -Wno-override -a -c
75+rm -f config.guess config.sub
76+automake -Wall -Wno-override -a -c --force-missing
77 echo "---> generate files via GNU autoconf (autoconf)"
78 autoconf
diff --git a/meta/recipes-devtools/rpm/rpm_5.4+cvs.bb b/meta/recipes-devtools/rpm/rpm_5.4+cvs.bb
index e35ddbe910..982c035ac7 100644
--- a/meta/recipes-devtools/rpm/rpm_5.4+cvs.bb
+++ b/meta/recipes-devtools/rpm/rpm_5.4+cvs.bb
@@ -144,6 +144,7 @@ SRC_URI += " \
144 file://rpm-syck-fix-gram.patch \ 144 file://rpm-syck-fix-gram.patch \
145 file://rpm-rpmdb-grammar.patch \ 145 file://rpm-rpmdb-grammar.patch \
146 file://rpm-disable-blaketest.patch \ 146 file://rpm-disable-blaketest.patch \
147 file://rpm-autogen-force.patch \
147" 148"
148 149
149SRC_URI_append_libc-musl = "\ 150SRC_URI_append_libc-musl = "\
diff --git a/meta/recipes-devtools/rpm/rpm_5.4.16.bb b/meta/recipes-devtools/rpm/rpm_5.4.16.bb
index c961bac5dc..5fea53f543 100644
--- a/meta/recipes-devtools/rpm/rpm_5.4.16.bb
+++ b/meta/recipes-devtools/rpm/rpm_5.4.16.bb
@@ -147,6 +147,7 @@ SRC_URI += " \
147 file://rpm-syck-fix-gram.patch \ 147 file://rpm-syck-fix-gram.patch \
148 file://rpm-rpmdb-grammar.patch \ 148 file://rpm-rpmdb-grammar.patch \
149 file://rpm-disable-blaketest.patch \ 149 file://rpm-disable-blaketest.patch \
150 file://rpm-autogen-force.patch \
150" 151"
151 152
152SRC_URI_append_libc-musl = "\ 153SRC_URI_append_libc-musl = "\