summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/elfutils
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2015-12-26 20:01:44 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-01-30 11:36:58 +0000
commitdf95988e1ea3d582e687c39a361728f88c419bca (patch)
treeee6c6a75f45b4803945fc9b244c3e25bf58ac8a0 /meta/recipes-devtools/elfutils
parent047ad2c81a7ec0d59d5fb1ddf52668c29a1119c9 (diff)
downloadpoky-df95988e1ea3d582e687c39a361728f88c419bca.tar.gz
elfutils: Fix build with uclibc/musl
Remove mempcpy patch its already in uclibc now refresh libargp patch to match latest elfutils Add ALLOW_EMPTY for musl core-image-cmdline-full asks for elfutils package to be added to package it has all eu-* tools but we dont build them on musl. nevertheless lets satisfy the dependency so image can build for musl Build libdw,libasm,libebl along with libelf enhance the musl portability patch to compile every other library except the eu-* tools Fix build on aarch64/musl issues Header inclusion ends up with duplicate definitions of iovec struct since uclibc defines the same in usersapce, we have been depending upong including the kernel header on aarch64, using sys/uio.h is the right approach Fix x86 build warning seen on musl (From OE-Core rev: a28c70455931e0b7e3449a76c3b9132bd572478b) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/elfutils')
-rw-r--r--meta/recipes-devtools/elfutils/elfutils-0.164/0001-build-Provide-alternatives-for-glibc-assumptions-hel.patch1163
-rw-r--r--meta/recipes-devtools/elfutils/elfutils-0.164/aarch64_uio.patch47
-rw-r--r--meta/recipes-devtools/elfutils/elfutils-0.164/shadow.patch23
-rw-r--r--meta/recipes-devtools/elfutils/elfutils-0.164/uclibc-support.patch129
-rw-r--r--meta/recipes-devtools/elfutils/elfutils/mempcpy.patch24
-rw-r--r--meta/recipes-devtools/elfutils/elfutils_0.148.bb1
-rw-r--r--meta/recipes-devtools/elfutils/elfutils_0.164.bb13
7 files changed, 1370 insertions, 30 deletions
diff --git a/meta/recipes-devtools/elfutils/elfutils-0.164/0001-build-Provide-alternatives-for-glibc-assumptions-hel.patch b/meta/recipes-devtools/elfutils/elfutils-0.164/0001-build-Provide-alternatives-for-glibc-assumptions-hel.patch
new file mode 100644
index 0000000000..c8d1c89901
--- /dev/null
+++ b/meta/recipes-devtools/elfutils/elfutils-0.164/0001-build-Provide-alternatives-for-glibc-assumptions-hel.patch
@@ -0,0 +1,1163 @@
1From 4b0fe80b3951f044c1c1b14d1d7f5f0b8ab67507 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 31 Dec 2015 06:35:34 +0000
4Subject: [PATCH] build: Provide alternatives for glibc assumptions helps
5 compiling it on musl
6
7Signed-off-by: Khem Raj <raj.khem@gmail.com>
8---
9Upstream-Status: Pending
10
11 Makefile.am | 2 +-
12 lib/color.c | 2 +-
13 lib/crc32_file.c | 4 +++-
14 lib/fixedsizehash.h | 4 ++--
15 lib/system.h | 11 +++++++++++
16 lib/xmalloc.c | 2 +-
17 libasm/asm_end.c | 2 +-
18 libasm/asm_newscn.c | 2 +-
19 libcpu/i386_gendis.c | 2 +-
20 libcpu/i386_lex.c | 2 +-
21 libcpu/i386_parse.c | 2 +-
22 libdw/Makefile.am | 2 +-
23 libdw/libdw_alloc.c | 3 ++-
24 libdwfl/Makefile.am | 2 ++
25 libdwfl/dwfl_build_id_find_elf.c | 3 ++-
26 libdwfl/dwfl_error.c | 4 +++-
27 libdwfl/dwfl_module_getdwarf.c | 1 +
28 libdwfl/find-debuginfo.c | 2 +-
29 libdwfl/libdwfl_crc32_file.c | 10 ++++++++++
30 libdwfl/linux-kernel-modules.c | 1 +
31 libebl/eblopenbackend.c | 2 +-
32 libebl/eblwstrtab.c | 2 +-
33 libelf/elf.h | 9 ++++++---
34 libelf/libelf.h | 1 +
35 libelf/libelfP.h | 1 +
36 src/addr2line.c | 2 +-
37 src/ar.c | 2 +-
38 src/arlib.c | 2 +-
39 src/arlib2.c | 2 +-
40 src/elfcmp.c | 2 +-
41 src/elflint.c | 2 +-
42 src/findtextrel.c | 2 +-
43 src/i386_ld.c | 2 +-
44 src/ld.c | 2 +-
45 src/ldgeneric.c | 2 +-
46 src/ldlex.c | 2 +-
47 src/ldscript.c | 2 +-
48 src/nm.c | 2 +-
49 src/objdump.c | 2 +-
50 src/ranlib.c | 2 +-
51 src/readelf.c | 2 +-
52 src/size.c | 2 +-
53 src/stack.c | 2 +-
54 src/strings.c | 2 +-
55 src/strip.c | 2 +-
56 src/unstrip.c | 2 +-
57 tests/addrscopes.c | 2 +-
58 tests/allregs.c | 2 +-
59 tests/backtrace-data.c | 2 +-
60 tests/backtrace-dwarf.c | 2 +-
61 tests/backtrace.c | 2 +-
62 tests/buildid.c | 2 +-
63 tests/debugaltlink.c | 2 +-
64 tests/debuglink.c | 2 +-
65 tests/deleted.c | 2 +-
66 tests/dwfl-addr-sect.c | 2 +-
67 tests/dwfl-bug-addr-overflow.c | 2 +-
68 tests/dwfl-bug-fd-leak.c | 2 +-
69 tests/dwfl-bug-getmodules.c | 2 +-
70 tests/dwfl-report-elf-align.c | 2 +-
71 tests/dwfllines.c | 2 +-
72 tests/dwflmodtest.c | 2 +-
73 tests/dwflsyms.c | 2 +-
74 tests/early-offscn.c | 2 +-
75 tests/ecp.c | 2 +-
76 tests/find-prologues.c | 2 +-
77 tests/funcretval.c | 2 +-
78 tests/funcscopes.c | 2 +-
79 tests/getsrc_die.c | 2 +-
80 tests/line2addr.c | 2 +-
81 tests/low_high_pc.c | 2 +-
82 tests/md5-sha1-test.c | 2 +-
83 tests/rdwrmmap.c | 2 +-
84 tests/saridx.c | 2 +-
85 tests/sectiondump.c | 2 +-
86 tests/varlocs.c | 2 +-
87 tests/vdsosyms.c | 2 +-
88 77 files changed, 109 insertions(+), 73 deletions(-)
89
90Index: elfutils-0.164/Makefile.am
91===================================================================
92--- elfutils-0.164.orig/Makefile.am
93+++ elfutils-0.164/Makefile.am
94@@ -24,7 +24,7 @@ pkginclude_HEADERS = version.h
95
96 # Add doc back when we have some real content.
97 SUBDIRS = config m4 lib libelf libebl libdwelf libdwfl libdw libcpu libasm \
98- backends src po tests
99+ backends po tests
100
101 EXTRA_DIST = elfutils.spec GPG-KEY NOTES CONTRIBUTING \
102 COPYING COPYING-GPLV2 COPYING-LGPLV3
103Index: elfutils-0.164/lib/color.c
104===================================================================
105--- elfutils-0.164.orig/lib/color.c
106+++ elfutils-0.164/lib/color.c
107@@ -32,7 +32,7 @@
108 #endif
109
110 #include <argp.h>
111-#include <error.h>
112+#include <err.h>
113 #include <libintl.h>
114 #include <stdlib.h>
115 #include <string.h>
116Index: elfutils-0.164/lib/crc32_file.c
117===================================================================
118--- elfutils-0.164.orig/lib/crc32_file.c
119+++ elfutils-0.164/lib/crc32_file.c
120@@ -30,12 +30,14 @@
121 # include <config.h>
122 #endif
123
124-#include "system.h"
125 #include <errno.h>
126 #include <unistd.h>
127+#include <stdint.h>
128 #include <sys/stat.h>
129 #include <sys/mman.h>
130
131+#include "system.h"
132+
133 int
134 crc32_file (int fd, uint32_t *resp)
135 {
136Index: elfutils-0.164/lib/fixedsizehash.h
137===================================================================
138--- elfutils-0.164.orig/lib/fixedsizehash.h
139+++ elfutils-0.164/lib/fixedsizehash.h
140@@ -30,12 +30,12 @@
141 #include <errno.h>
142 #include <stdlib.h>
143 #include <string.h>
144-#include <sys/cdefs.h>
145 #include <sys/param.h>
146
147 #include <system.h>
148
149-#define CONCAT(t1,t2) __CONCAT (t1,t2)
150+#define CONCAT1(x,y) x##y
151+#define CONCAT(x,y) CONCAT1(x,y)
152
153 /* Before including this file the following macros must be defined:
154
155Index: elfutils-0.164/lib/system.h
156===================================================================
157--- elfutils-0.164.orig/lib/system.h
158+++ elfutils-0.164/lib/system.h
159@@ -49,6 +49,16 @@
160 #else
161 # error "Unknown byte order"
162 #endif
163+#ifndef TEMP_FAILURE_RETRY
164+#define TEMP_FAILURE_RETRY(expression) \
165+ (__extension__ \
166+ ({ long int __result; \
167+ do __result = (long int) (expression); \
168+ while (__result == -1L && errno == EINTR); \
169+ __result; }))
170+#endif
171+
172+#define error(status, errno, ...) err(status, __VA_ARGS__)
173
174 extern void *xmalloc (size_t) __attribute__ ((__malloc__));
175 extern void *xcalloc (size_t, size_t) __attribute__ ((__malloc__));
176Index: elfutils-0.164/lib/xmalloc.c
177===================================================================
178--- elfutils-0.164.orig/lib/xmalloc.c
179+++ elfutils-0.164/lib/xmalloc.c
180@@ -30,7 +30,7 @@
181 # include <config.h>
182 #endif
183
184-#include <error.h>
185+#include <err.h>
186 #include <libintl.h>
187 #include <stddef.h>
188 #include <stdlib.h>
189Index: elfutils-0.164/libasm/asm_end.c
190===================================================================
191--- elfutils-0.164.orig/libasm/asm_end.c
192+++ elfutils-0.164/libasm/asm_end.c
193@@ -32,7 +32,7 @@
194 #endif
195
196 #include <assert.h>
197-#include <error.h>
198+#include <err.h>
199 #include <libintl.h>
200 #include <stdio.h>
201 #include <stdlib.h>
202Index: elfutils-0.164/libasm/asm_newscn.c
203===================================================================
204--- elfutils-0.164.orig/libasm/asm_newscn.c
205+++ elfutils-0.164/libasm/asm_newscn.c
206@@ -32,7 +32,7 @@
207 #endif
208
209 #include <assert.h>
210-#include <error.h>
211+#include <err.h>
212 #include <libintl.h>
213 #include <stdlib.h>
214 #include <string.h>
215Index: elfutils-0.164/libcpu/i386_gendis.c
216===================================================================
217--- elfutils-0.164.orig/libcpu/i386_gendis.c
218+++ elfutils-0.164/libcpu/i386_gendis.c
219@@ -31,7 +31,7 @@
220 # include <config.h>
221 #endif
222
223-#include <error.h>
224+#include <err.h>
225 #include <errno.h>
226 #include <stdio.h>
227 #include <stdlib.h>
228Index: elfutils-0.164/libcpu/i386_lex.c
229===================================================================
230--- elfutils-0.164.orig/libcpu/i386_lex.c
231+++ elfutils-0.164/libcpu/i386_lex.c
232@@ -571,7 +571,7 @@ char *i386_text;
233 #endif
234
235 #include <ctype.h>
236-#include <error.h>
237+#include <err.h>
238 #include <libintl.h>
239
240 #include <system.h>
241Index: elfutils-0.164/libcpu/i386_parse.c
242===================================================================
243--- elfutils-0.164.orig/libcpu/i386_parse.c
244+++ elfutils-0.164/libcpu/i386_parse.c
245@@ -107,7 +107,7 @@
246 #include <assert.h>
247 #include <ctype.h>
248 #include <errno.h>
249-#include <error.h>
250+#include <err.h>
251 #include <inttypes.h>
252 #include <libintl.h>
253 #include <math.h>
254Index: elfutils-0.164/libdw/Makefile.am
255===================================================================
256--- elfutils-0.164.orig/libdw/Makefile.am
257+++ elfutils-0.164/libdw/Makefile.am
258@@ -117,7 +117,7 @@ libdw.so$(EXEEXT): $(srcdir)/libdw.map l
259 -Wl,--enable-new-dtags,-rpath,$(pkglibdir) \
260 -Wl,--version-script,$<,--no-undefined \
261 -Wl,--whole-archive $(filter-out $<,$^) -Wl,--no-whole-archive\
262- -ldl $(argp_LDADD) $(zip_LIBS) $(libdw_so_LDLIBS)
263+ -ldl $(argp_LDADD) $(zip_LIBS) $(libdw_so_LDLIBS) -lfts -largp
264 @$(textrel_check)
265 $(AM_V_at)ln -fs $@ $@.$(VERSION)
266
267Index: elfutils-0.164/libdw/libdw_alloc.c
268===================================================================
269--- elfutils-0.164.orig/libdw/libdw_alloc.c
270+++ elfutils-0.164/libdw/libdw_alloc.c
271@@ -31,11 +31,12 @@
272 # include <config.h>
273 #endif
274
275-#include <error.h>
276+#include <err.h>
277 #include <errno.h>
278 #include <stdlib.h>
279 #include <sys/param.h>
280 #include "libdwP.h"
281+#include "system.h"
282
283
284 void *
285Index: elfutils-0.164/libdwfl/Makefile.am
286===================================================================
287--- elfutils-0.164.orig/libdwfl/Makefile.am
288+++ elfutils-0.164/libdwfl/Makefile.am
289@@ -86,6 +86,8 @@ libelf = ../libelf/libelf.so
290 libebl = ../libebl/libebl.a
291 libeu = ../lib/libeu.a
292
293+LDADD = -lfts
294+
295 libdwfl_pic_a_SOURCES =
296 am_libdwfl_pic_a_OBJECTS = $(libdwfl_a_SOURCES:.c=.os)
297
298Index: elfutils-0.164/libdwfl/dwfl_build_id_find_elf.c
299===================================================================
300--- elfutils-0.164.orig/libdwfl/dwfl_build_id_find_elf.c
301+++ elfutils-0.164/libdwfl/dwfl_build_id_find_elf.c
302@@ -27,6 +27,7 @@
303 not, see <http://www.gnu.org/licenses/>. */
304
305 #include "libdwflP.h"
306+#include "system.h"
307 #include <inttypes.h>
308 #include <fcntl.h>
309 #include <unistd.h>
310@@ -94,7 +95,7 @@ __libdwfl_open_by_build_id (Dwfl_Module
311 {
312 if (*file_name != NULL)
313 free (*file_name);
314- *file_name = canonicalize_file_name (name);
315+ *file_name = realpath (name, NULL);
316 if (*file_name == NULL)
317 {
318 *file_name = name;
319Index: elfutils-0.164/libdwfl/dwfl_error.c
320===================================================================
321--- elfutils-0.164.orig/libdwfl/dwfl_error.c
322+++ elfutils-0.164/libdwfl/dwfl_error.c
323@@ -140,6 +140,7 @@ __libdwfl_seterrno (Dwfl_Error error)
324 const char *
325 dwfl_errmsg (int error)
326 {
327+ static __thread char s[64] = "";
328 if (error == 0 || error == -1)
329 {
330 int last_error = global_error;
331@@ -154,7 +155,8 @@ dwfl_errmsg (int error)
332 switch (error &~ 0xffff)
333 {
334 case OTHER_ERROR (ERRNO):
335- return strerror_r (error & 0xffff, "bad", 0);
336+ strerror_r (error & 0xffff, s, sizeof(s));
337+ return s;
338 case OTHER_ERROR (LIBELF):
339 return elf_errmsg (error & 0xffff);
340 case OTHER_ERROR (LIBDW):
341Index: elfutils-0.164/libdwfl/dwfl_module_getdwarf.c
342===================================================================
343--- elfutils-0.164.orig/libdwfl/dwfl_module_getdwarf.c
344+++ elfutils-0.164/libdwfl/dwfl_module_getdwarf.c
345@@ -31,6 +31,7 @@
346 #include <fcntl.h>
347 #include <string.h>
348 #include <unistd.h>
349+#include "system.h"
350 #include "../libdw/libdwP.h" /* DWARF_E_* values are here. */
351 #include "../libelf/libelfP.h"
352
353Index: elfutils-0.164/libdwfl/find-debuginfo.c
354===================================================================
355--- elfutils-0.164.orig/libdwfl/find-debuginfo.c
356+++ elfutils-0.164/libdwfl/find-debuginfo.c
357@@ -372,7 +372,7 @@ dwfl_standard_find_debuginfo (Dwfl_Modul
358 /* If FILE_NAME is a symlink, the debug file might be associated
359 with the symlink target name instead. */
360
361- char *canon = canonicalize_file_name (file_name);
362+ char *canon = realpath (file_name, NULL);
363 if (canon != NULL && strcmp (file_name, canon))
364 fd = find_debuginfo_in_path (mod, canon,
365 debuglink_file, debuglink_crc,
366Index: elfutils-0.164/libdwfl/libdwfl_crc32_file.c
367===================================================================
368--- elfutils-0.164.orig/libdwfl/libdwfl_crc32_file.c
369+++ elfutils-0.164/libdwfl/libdwfl_crc32_file.c
370@@ -31,6 +31,16 @@
371
372 #define crc32_file attribute_hidden __libdwfl_crc32_file
373 #define crc32 __libdwfl_crc32
374+
375+#ifndef TEMP_FAILURE_RETRY
376+#define TEMP_FAILURE_RETRY(expression) \
377+ (__extension__ \
378+ ({ long int __result; \
379+ do __result = (long int) (expression); \
380+ while (__result == -1L && errno == EINTR); \
381+ __result; }))
382+#endif
383+
384 #define LIB_SYSTEM_H 1
385 #include <libdwflP.h>
386 #include "../lib/crc32_file.c"
387Index: elfutils-0.164/libdwfl/linux-kernel-modules.c
388===================================================================
389--- elfutils-0.164.orig/libdwfl/linux-kernel-modules.c
390+++ elfutils-0.164/libdwfl/linux-kernel-modules.c
391@@ -34,6 +34,7 @@
392 #include <config.h>
393
394 #include "libdwflP.h"
395+#include "system.h"
396 #include <inttypes.h>
397 #include <errno.h>
398 #include <stdio.h>
399Index: elfutils-0.164/libebl/eblopenbackend.c
400===================================================================
401--- elfutils-0.164.orig/libebl/eblopenbackend.c
402+++ elfutils-0.164/libebl/eblopenbackend.c
403@@ -32,7 +32,7 @@
404
405 #include <assert.h>
406 #include <dlfcn.h>
407-#include <error.h>
408+#include <err.h>
409 #include <libelfP.h>
410 #include <dwarf.h>
411 #include <stdlib.h>
412Index: elfutils-0.164/libebl/eblwstrtab.c
413===================================================================
414--- elfutils-0.164.orig/libebl/eblwstrtab.c
415+++ elfutils-0.164/libebl/eblwstrtab.c
416@@ -305,7 +305,7 @@ copystrings (struct Ebl_WStrent *nodep,
417
418 /* Process the current node. */
419 nodep->offset = *offsetp;
420- *freep = wmempcpy (*freep, nodep->string, nodep->len);
421+ *freep = wmemcpy (*freep, nodep->string, nodep->len) + nodep->len;
422 *offsetp += nodep->len * sizeof (wchar_t);
423
424 for (subs = nodep->next; subs != NULL; subs = subs->next)
425Index: elfutils-0.164/libelf/elf.h
426===================================================================
427--- elfutils-0.164.orig/libelf/elf.h
428+++ elfutils-0.164/libelf/elf.h
429@@ -21,7 +21,9 @@
430
431 #include <features.h>
432
433-__BEGIN_DECLS
434+#ifdef __cplusplus
435+extern "C" {
436+#endif
437
438 /* Standard ELF types. */
439
440@@ -3552,7 +3554,8 @@ enum
441
442 #define R_TILEGX_NUM 130
443
444-
445-__END_DECLS
446+#ifdef __cplusplus
447+}
448+#endif
449
450 #endif /* elf.h */
451Index: elfutils-0.164/libelf/libelf.h
452===================================================================
453--- elfutils-0.164.orig/libelf/libelf.h
454+++ elfutils-0.164/libelf/libelf.h
455@@ -29,6 +29,7 @@
456 #ifndef _LIBELF_H
457 #define _LIBELF_H 1
458
459+#include <fcntl.h>
460 #include <stdint.h>
461 #include <sys/types.h>
462
463Index: elfutils-0.164/libelf/libelfP.h
464===================================================================
465--- elfutils-0.164.orig/libelf/libelfP.h
466+++ elfutils-0.164/libelf/libelfP.h
467@@ -36,6 +36,7 @@
468
469 #include <ar.h>
470 #include <gelf.h>
471+#include <libelf.h>
472
473 #include <errno.h>
474 #include <stdint.h>
475Index: elfutils-0.164/src/addr2line.c
476===================================================================
477--- elfutils-0.164.orig/src/addr2line.c
478+++ elfutils-0.164/src/addr2line.c
479@@ -23,7 +23,7 @@
480 #include <argp.h>
481 #include <assert.h>
482 #include <errno.h>
483-#include <error.h>
484+#include <err.h>
485 #include <fcntl.h>
486 #include <inttypes.h>
487 #include <libdwfl.h>
488Index: elfutils-0.164/src/ar.c
489===================================================================
490--- elfutils-0.164.orig/src/ar.c
491+++ elfutils-0.164/src/ar.c
492@@ -22,7 +22,7 @@
493
494 #include <argp.h>
495 #include <assert.h>
496-#include <error.h>
497+#include <err.h>
498 #include <fcntl.h>
499 #include <gelf.h>
500 #include <libintl.h>
501Index: elfutils-0.164/src/arlib.c
502===================================================================
503--- elfutils-0.164.orig/src/arlib.c
504+++ elfutils-0.164/src/arlib.c
505@@ -21,7 +21,7 @@
506 #endif
507
508 #include <assert.h>
509-#include <error.h>
510+#include <err.h>
511 #include <gelf.h>
512 #include <libintl.h>
513 #include <stdio.h>
514Index: elfutils-0.164/src/arlib2.c
515===================================================================
516--- elfutils-0.164.orig/src/arlib2.c
517+++ elfutils-0.164/src/arlib2.c
518@@ -20,7 +20,7 @@
519 # include <config.h>
520 #endif
521
522-#include <error.h>
523+#include <err.h>
524 #include <libintl.h>
525 #include <limits.h>
526 #include <string.h>
527Index: elfutils-0.164/src/elfcmp.c
528===================================================================
529--- elfutils-0.164.orig/src/elfcmp.c
530+++ elfutils-0.164/src/elfcmp.c
531@@ -23,7 +23,7 @@
532 #include <argp.h>
533 #include <assert.h>
534 #include <errno.h>
535-#include <error.h>
536+#include <err.h>
537 #include <fcntl.h>
538 #include <locale.h>
539 #include <libintl.h>
540Index: elfutils-0.164/src/elflint.c
541===================================================================
542--- elfutils-0.164.orig/src/elflint.c
543+++ elfutils-0.164/src/elflint.c
544@@ -24,7 +24,7 @@
545 #include <assert.h>
546 #include <byteswap.h>
547 #include <endian.h>
548-#include <error.h>
549+#include <err.h>
550 #include <fcntl.h>
551 #include <gelf.h>
552 #include <inttypes.h>
553Index: elfutils-0.164/src/findtextrel.c
554===================================================================
555--- elfutils-0.164.orig/src/findtextrel.c
556+++ elfutils-0.164/src/findtextrel.c
557@@ -23,7 +23,7 @@
558 #include <argp.h>
559 #include <assert.h>
560 #include <errno.h>
561-#include <error.h>
562+#include <err.h>
563 #include <fcntl.h>
564 #include <gelf.h>
565 #include <libdw.h>
566Index: elfutils-0.164/src/i386_ld.c
567===================================================================
568--- elfutils-0.164.orig/src/i386_ld.c
569+++ elfutils-0.164/src/i386_ld.c
570@@ -20,7 +20,7 @@
571 #endif
572
573 #include <assert.h>
574-#include <error.h>
575+#include <err.h>
576 #include <libintl.h>
577 #include <stdlib.h>
578 #include <string.h>
579Index: elfutils-0.164/src/ld.c
580===================================================================
581--- elfutils-0.164.orig/src/ld.c
582+++ elfutils-0.164/src/ld.c
583@@ -21,7 +21,7 @@
584
585 #include <argp.h>
586 #include <assert.h>
587-#include <error.h>
588+#include <err.h>
589 #include <fcntl.h>
590 #include <libelf.h>
591 #include <libintl.h>
592Index: elfutils-0.164/src/ldgeneric.c
593===================================================================
594--- elfutils-0.164.orig/src/ldgeneric.c
595+++ elfutils-0.164/src/ldgeneric.c
596@@ -23,7 +23,7 @@
597 #include <ctype.h>
598 #include <dlfcn.h>
599 #include <errno.h>
600-#include <error.h>
601+#include <err.h>
602 #include <fcntl.h>
603 #include <fnmatch.h>
604 #include <gelf.h>
605Index: elfutils-0.164/src/ldlex.c
606===================================================================
607--- elfutils-0.164.orig/src/ldlex.c
608+++ elfutils-0.164/src/ldlex.c
609@@ -1099,7 +1099,7 @@ char *ldtext;
610 #include <assert.h>
611 #include <ctype.h>
612 #include <elf.h>
613-#include <error.h>
614+#include <err.h>
615 #include <inttypes.h>
616 #include <libintl.h>
617 #include <stdbool.h>
618Index: elfutils-0.164/src/ldscript.c
619===================================================================
620--- elfutils-0.164.orig/src/ldscript.c
621+++ elfutils-0.164/src/ldscript.c
622@@ -95,7 +95,7 @@
623 #endif
624
625 #include <assert.h>
626-#include <error.h>
627+#include <err.h>
628 #include <libintl.h>
629 #include <stdbool.h>
630 #include <stdint.h>
631Index: elfutils-0.164/src/nm.c
632===================================================================
633--- elfutils-0.164.orig/src/nm.c
634+++ elfutils-0.164/src/nm.c
635@@ -26,7 +26,7 @@
636 #include <ctype.h>
637 #include <dwarf.h>
638 #include <errno.h>
639-#include <error.h>
640+#include <err.h>
641 #include <fcntl.h>
642 #include <gelf.h>
643 #include <inttypes.h>
644Index: elfutils-0.164/src/objdump.c
645===================================================================
646--- elfutils-0.164.orig/src/objdump.c
647+++ elfutils-0.164/src/objdump.c
648@@ -21,7 +21,7 @@
649 #endif
650
651 #include <argp.h>
652-#include <error.h>
653+#include <err.h>
654 #include <fcntl.h>
655 #include <inttypes.h>
656 #include <libintl.h>
657Index: elfutils-0.164/src/ranlib.c
658===================================================================
659--- elfutils-0.164.orig/src/ranlib.c
660+++ elfutils-0.164/src/ranlib.c
661@@ -24,7 +24,7 @@
662 #include <argp.h>
663 #include <assert.h>
664 #include <errno.h>
665-#include <error.h>
666+#include <err.h>
667 #include <fcntl.h>
668 #include <gelf.h>
669 #include <libintl.h>
670Index: elfutils-0.164/src/readelf.c
671===================================================================
672--- elfutils-0.164.orig/src/readelf.c
673+++ elfutils-0.164/src/readelf.c
674@@ -25,7 +25,7 @@
675 #include <ctype.h>
676 #include <dwarf.h>
677 #include <errno.h>
678-#include <error.h>
679+#include <err.h>
680 #include <fcntl.h>
681 #include <gelf.h>
682 #include <inttypes.h>
683Index: elfutils-0.164/src/size.c
684===================================================================
685--- elfutils-0.164.orig/src/size.c
686+++ elfutils-0.164/src/size.c
687@@ -21,7 +21,7 @@
688 #endif
689
690 #include <argp.h>
691-#include <error.h>
692+#include <err.h>
693 #include <fcntl.h>
694 #include <gelf.h>
695 #include <inttypes.h>
696Index: elfutils-0.164/src/stack.c
697===================================================================
698--- elfutils-0.164.orig/src/stack.c
699+++ elfutils-0.164/src/stack.c
700@@ -18,7 +18,7 @@
701 #include <config.h>
702 #include <assert.h>
703 #include <argp.h>
704-#include <error.h>
705+#include <err.h>
706 #include <stdlib.h>
707 #include <inttypes.h>
708 #include <stdio.h>
709Index: elfutils-0.164/src/strings.c
710===================================================================
711--- elfutils-0.164.orig/src/strings.c
712+++ elfutils-0.164/src/strings.c
713@@ -25,7 +25,7 @@
714 #include <ctype.h>
715 #include <endian.h>
716 #include <errno.h>
717-#include <error.h>
718+#include <err.h>
719 #include <fcntl.h>
720 #include <gelf.h>
721 #include <inttypes.h>
722Index: elfutils-0.164/src/strip.c
723===================================================================
724--- elfutils-0.164.orig/src/strip.c
725+++ elfutils-0.164/src/strip.c
726@@ -24,7 +24,7 @@
727 #include <assert.h>
728 #include <byteswap.h>
729 #include <endian.h>
730-#include <error.h>
731+#include <err.h>
732 #include <fcntl.h>
733 #include <gelf.h>
734 #include <libelf.h>
735Index: elfutils-0.164/src/unstrip.c
736===================================================================
737--- elfutils-0.164.orig/src/unstrip.c
738+++ elfutils-0.164/src/unstrip.c
739@@ -31,7 +31,7 @@
740 #include <argp.h>
741 #include <assert.h>
742 #include <errno.h>
743-#include <error.h>
744+#include <err.h>
745 #include <fcntl.h>
746 #include <fnmatch.h>
747 #include <libintl.h>
748Index: elfutils-0.164/tests/addrscopes.c
749===================================================================
750--- elfutils-0.164.orig/tests/addrscopes.c
751+++ elfutils-0.164/tests/addrscopes.c
752@@ -25,7 +25,7 @@
753 #include <stdio_ext.h>
754 #include <locale.h>
755 #include <stdlib.h>
756-#include <error.h>
757+#include <err.h>
758 #include <string.h>
759
760
761Index: elfutils-0.164/tests/allregs.c
762===================================================================
763--- elfutils-0.164.orig/tests/allregs.c
764+++ elfutils-0.164/tests/allregs.c
765@@ -21,7 +21,7 @@
766 #include <stdio.h>
767 #include <stdlib.h>
768 #include <string.h>
769-#include <error.h>
770+#include <err.h>
771 #include <locale.h>
772 #include <argp.h>
773 #include <assert.h>
774Index: elfutils-0.164/tests/backtrace-data.c
775===================================================================
776--- elfutils-0.164.orig/tests/backtrace-data.c
777+++ elfutils-0.164/tests/backtrace-data.c
778@@ -27,7 +27,7 @@
779 #include <dirent.h>
780 #include <stdlib.h>
781 #include <errno.h>
782-#include <error.h>
783+#include <err.h>
784 #include <unistd.h>
785 #include <dwarf.h>
786 #if defined(__x86_64__) && defined(__linux__)
787Index: elfutils-0.164/tests/backtrace-dwarf.c
788===================================================================
789--- elfutils-0.164.orig/tests/backtrace-dwarf.c
790+++ elfutils-0.164/tests/backtrace-dwarf.c
791@@ -22,7 +22,7 @@
792 #include <stdio_ext.h>
793 #include <locale.h>
794 #include <errno.h>
795-#include <error.h>
796+#include <err.h>
797 #include <unistd.h>
798 #include <sys/ptrace.h>
799 #include <sys/types.h>
800Index: elfutils-0.164/tests/backtrace.c
801===================================================================
802--- elfutils-0.164.orig/tests/backtrace.c
803+++ elfutils-0.164/tests/backtrace.c
804@@ -24,7 +24,7 @@
805 #include <dirent.h>
806 #include <stdlib.h>
807 #include <errno.h>
808-#include <error.h>
809+#include <err.h>
810 #include <unistd.h>
811 #include <dwarf.h>
812 #ifdef __linux__
813Index: elfutils-0.164/tests/buildid.c
814===================================================================
815--- elfutils-0.164.orig/tests/buildid.c
816+++ elfutils-0.164/tests/buildid.c
817@@ -23,7 +23,7 @@
818 #include ELFUTILS_HEADER(elf)
819 #include ELFUTILS_HEADER(dwelf)
820 #include <stdio.h>
821-#include <error.h>
822+#include <err.h>
823 #include <string.h>
824 #include <stdlib.h>
825 #include <sys/types.h>
826Index: elfutils-0.164/tests/debugaltlink.c
827===================================================================
828--- elfutils-0.164.orig/tests/debugaltlink.c
829+++ elfutils-0.164/tests/debugaltlink.c
830@@ -23,7 +23,7 @@
831 #include ELFUTILS_HEADER(dw)
832 #include ELFUTILS_HEADER(dwelf)
833 #include <stdio.h>
834-#include <error.h>
835+#include <err.h>
836 #include <string.h>
837 #include <stdlib.h>
838 #include <sys/types.h>
839Index: elfutils-0.164/tests/debuglink.c
840===================================================================
841--- elfutils-0.164.orig/tests/debuglink.c
842+++ elfutils-0.164/tests/debuglink.c
843@@ -21,7 +21,7 @@
844 #include <errno.h>
845 #include ELFUTILS_HEADER(dwelf)
846 #include <stdio.h>
847-#include <error.h>
848+#include <err.h>
849 #include <string.h>
850 #include <stdlib.h>
851 #include <sys/types.h>
852Index: elfutils-0.164/tests/deleted.c
853===================================================================
854--- elfutils-0.164.orig/tests/deleted.c
855+++ elfutils-0.164/tests/deleted.c
856@@ -21,7 +21,7 @@
857 #include <unistd.h>
858 #include <assert.h>
859 #include <stdio.h>
860-#include <error.h>
861+#include <err.h>
862 #include <errno.h>
863 #ifdef __linux__
864 #include <sys/prctl.h>
865Index: elfutils-0.164/tests/dwfl-addr-sect.c
866===================================================================
867--- elfutils-0.164.orig/tests/dwfl-addr-sect.c
868+++ elfutils-0.164/tests/dwfl-addr-sect.c
869@@ -23,7 +23,7 @@
870 #include <stdio_ext.h>
871 #include <stdlib.h>
872 #include <string.h>
873-#include <error.h>
874+#include <err.h>
875 #include <locale.h>
876 #include <argp.h>
877 #include ELFUTILS_HEADER(dwfl)
878Index: elfutils-0.164/tests/dwfl-bug-addr-overflow.c
879===================================================================
880--- elfutils-0.164.orig/tests/dwfl-bug-addr-overflow.c
881+++ elfutils-0.164/tests/dwfl-bug-addr-overflow.c
882@@ -20,7 +20,7 @@
883 #include <inttypes.h>
884 #include <stdio.h>
885 #include <stdio_ext.h>
886-#include <error.h>
887+#include <err.h>
888 #include <locale.h>
889 #include ELFUTILS_HEADER(dwfl)
890
891Index: elfutils-0.164/tests/dwfl-bug-fd-leak.c
892===================================================================
893--- elfutils-0.164.orig/tests/dwfl-bug-fd-leak.c
894+++ elfutils-0.164/tests/dwfl-bug-fd-leak.c
895@@ -24,7 +24,7 @@
896 #include <dirent.h>
897 #include <stdlib.h>
898 #include <errno.h>
899-#include <error.h>
900+#include <err.h>
901 #include <unistd.h>
902 #include <dwarf.h>
903 #include <sys/resource.h>
904Index: elfutils-0.164/tests/dwfl-bug-getmodules.c
905===================================================================
906--- elfutils-0.164.orig/tests/dwfl-bug-getmodules.c
907+++ elfutils-0.164/tests/dwfl-bug-getmodules.c
908@@ -18,7 +18,7 @@
909 #include <config.h>
910 #include ELFUTILS_HEADER(dwfl)
911
912-#include <error.h>
913+#include <err.h>
914
915 static const Dwfl_Callbacks callbacks =
916 {
917Index: elfutils-0.164/tests/dwfl-report-elf-align.c
918===================================================================
919--- elfutils-0.164.orig/tests/dwfl-report-elf-align.c
920+++ elfutils-0.164/tests/dwfl-report-elf-align.c
921@@ -20,7 +20,7 @@
922 #include <inttypes.h>
923 #include <stdio.h>
924 #include <stdio_ext.h>
925-#include <error.h>
926+#include <err.h>
927 #include <locale.h>
928 #include <string.h>
929 #include <stdlib.h>
930Index: elfutils-0.164/tests/dwfllines.c
931===================================================================
932--- elfutils-0.164.orig/tests/dwfllines.c
933+++ elfutils-0.164/tests/dwfllines.c
934@@ -27,7 +27,7 @@
935 #include <stdio.h>
936 #include <stdlib.h>
937 #include <string.h>
938-#include <error.h>
939+#include <err.h>
940
941 int
942 main (int argc, char *argv[])
943Index: elfutils-0.164/tests/dwflmodtest.c
944===================================================================
945--- elfutils-0.164.orig/tests/dwflmodtest.c
946+++ elfutils-0.164/tests/dwflmodtest.c
947@@ -23,7 +23,7 @@
948 #include <stdio_ext.h>
949 #include <stdlib.h>
950 #include <string.h>
951-#include <error.h>
952+#include <err.h>
953 #include <locale.h>
954 #include <argp.h>
955 #include ELFUTILS_HEADER(dwfl)
956Index: elfutils-0.164/tests/dwflsyms.c
957===================================================================
958--- elfutils-0.164.orig/tests/dwflsyms.c
959+++ elfutils-0.164/tests/dwflsyms.c
960@@ -25,7 +25,7 @@
961 #include <stdio.h>
962 #include <stdio_ext.h>
963 #include <stdlib.h>
964-#include <error.h>
965+#include <err.h>
966 #include <string.h>
967
968 static const char *
969Index: elfutils-0.164/tests/early-offscn.c
970===================================================================
971--- elfutils-0.164.orig/tests/early-offscn.c
972+++ elfutils-0.164/tests/early-offscn.c
973@@ -19,7 +19,7 @@
974 #endif
975
976 #include <errno.h>
977-#include <error.h>
978+#include <err.h>
979 #include <fcntl.h>
980 #include <gelf.h>
981 #include <stdio.h>
982Index: elfutils-0.164/tests/ecp.c
983===================================================================
984--- elfutils-0.164.orig/tests/ecp.c
985+++ elfutils-0.164/tests/ecp.c
986@@ -20,7 +20,7 @@
987 #endif
988
989 #include <errno.h>
990-#include <error.h>
991+#include <err.h>
992 #include <fcntl.h>
993 #include <gelf.h>
994 #include <stdlib.h>
995Index: elfutils-0.164/tests/find-prologues.c
996===================================================================
997--- elfutils-0.164.orig/tests/find-prologues.c
998+++ elfutils-0.164/tests/find-prologues.c
999@@ -25,7 +25,7 @@
1000 #include <stdio_ext.h>
1001 #include <locale.h>
1002 #include <stdlib.h>
1003-#include <error.h>
1004+#include <err.h>
1005 #include <string.h>
1006 #include <fnmatch.h>
1007
1008Index: elfutils-0.164/tests/funcretval.c
1009===================================================================
1010--- elfutils-0.164.orig/tests/funcretval.c
1011+++ elfutils-0.164/tests/funcretval.c
1012@@ -25,7 +25,7 @@
1013 #include <stdio_ext.h>
1014 #include <locale.h>
1015 #include <stdlib.h>
1016-#include <error.h>
1017+#include <err.h>
1018 #include <string.h>
1019 #include <fnmatch.h>
1020
1021Index: elfutils-0.164/tests/funcscopes.c
1022===================================================================
1023--- elfutils-0.164.orig/tests/funcscopes.c
1024+++ elfutils-0.164/tests/funcscopes.c
1025@@ -25,7 +25,7 @@
1026 #include <stdio_ext.h>
1027 #include <locale.h>
1028 #include <stdlib.h>
1029-#include <error.h>
1030+#include <err.h>
1031 #include <string.h>
1032 #include <fnmatch.h>
1033
1034Index: elfutils-0.164/tests/getsrc_die.c
1035===================================================================
1036--- elfutils-0.164.orig/tests/getsrc_die.c
1037+++ elfutils-0.164/tests/getsrc_die.c
1038@@ -19,7 +19,7 @@
1039 #endif
1040
1041 #include <errno.h>
1042-#include <error.h>
1043+#include <err.h>
1044 #include <fcntl.h>
1045 #include <inttypes.h>
1046 #include <libelf.h>
1047Index: elfutils-0.164/tests/line2addr.c
1048===================================================================
1049--- elfutils-0.164.orig/tests/line2addr.c
1050+++ elfutils-0.164/tests/line2addr.c
1051@@ -26,7 +26,7 @@
1052 #include <locale.h>
1053 #include <stdlib.h>
1054 #include <string.h>
1055-#include <error.h>
1056+#include <err.h>
1057
1058
1059 static void
1060Index: elfutils-0.164/tests/low_high_pc.c
1061===================================================================
1062--- elfutils-0.164.orig/tests/low_high_pc.c
1063+++ elfutils-0.164/tests/low_high_pc.c
1064@@ -25,7 +25,7 @@
1065 #include <stdio_ext.h>
1066 #include <locale.h>
1067 #include <stdlib.h>
1068-#include <error.h>
1069+#include <err.h>
1070 #include <string.h>
1071 #include <fnmatch.h>
1072
1073Index: elfutils-0.164/tests/md5-sha1-test.c
1074===================================================================
1075--- elfutils-0.164.orig/tests/md5-sha1-test.c
1076+++ elfutils-0.164/tests/md5-sha1-test.c
1077@@ -19,7 +19,7 @@
1078 #endif
1079
1080 #include <string.h>
1081-#include <error.h>
1082+#include <err.h>
1083
1084 #include "md5.h"
1085 #include "sha1.h"
1086Index: elfutils-0.164/tests/rdwrmmap.c
1087===================================================================
1088--- elfutils-0.164.orig/tests/rdwrmmap.c
1089+++ elfutils-0.164/tests/rdwrmmap.c
1090@@ -19,7 +19,7 @@
1091 #endif
1092
1093 #include <errno.h>
1094-#include <error.h>
1095+#include <err.h>
1096 #include <stdio.h>
1097 #include <fcntl.h>
1098 #include <unistd.h>
1099Index: elfutils-0.164/tests/saridx.c
1100===================================================================
1101--- elfutils-0.164.orig/tests/saridx.c
1102+++ elfutils-0.164/tests/saridx.c
1103@@ -17,7 +17,7 @@
1104
1105 #include <config.h>
1106
1107-#include <error.h>
1108+#include <err.h>
1109 #include <fcntl.h>
1110 #include <gelf.h>
1111 #include <stdio.h>
1112Index: elfutils-0.164/tests/sectiondump.c
1113===================================================================
1114--- elfutils-0.164.orig/tests/sectiondump.c
1115+++ elfutils-0.164/tests/sectiondump.c
1116@@ -18,7 +18,7 @@
1117 #include <config.h>
1118
1119 #include <errno.h>
1120-#include <error.h>
1121+#include <err.h>
1122 #include <fcntl.h>
1123 #include <gelf.h>
1124 #include <inttypes.h>
1125Index: elfutils-0.164/tests/varlocs.c
1126===================================================================
1127--- elfutils-0.164.orig/tests/varlocs.c
1128+++ elfutils-0.164/tests/varlocs.c
1129@@ -25,7 +25,7 @@
1130 #include <dwarf.h>
1131 #include <stdio.h>
1132 #include <stdlib.h>
1133-#include <error.h>
1134+#include <err.h>
1135 #include <string.h>
1136 #include <sys/types.h>
1137 #include <sys/stat.h>
1138Index: elfutils-0.164/tests/vdsosyms.c
1139===================================================================
1140--- elfutils-0.164.orig/tests/vdsosyms.c
1141+++ elfutils-0.164/tests/vdsosyms.c
1142@@ -18,7 +18,7 @@
1143 #include <config.h>
1144 #include <assert.h>
1145 #include <errno.h>
1146-#include <error.h>
1147+#include <err.h>
1148 #include <inttypes.h>
1149 #include <stdio.h>
1150 #include <string.h>
1151Index: elfutils-0.164/libelf/elf_getarsym.c
1152===================================================================
1153--- elfutils-0.164.orig/libelf/elf_getarsym.c
1154+++ elfutils-0.164/libelf/elf_getarsym.c
1155@@ -302,7 +302,7 @@ elf_getarsym (Elf *elf, size_t *ptr)
1156 arsym[cnt].as_off = (*u32)[cnt];
1157
1158 arsym[cnt].as_hash = _dl_elf_hash (str_data);
1159- str_data = rawmemchr (str_data, '\0') + 1;
1160+ str_data = memchr (str_data, '\0', SIZE_MAX) + 1;
1161 }
1162
1163 /* At the end a special entry. */
diff --git a/meta/recipes-devtools/elfutils/elfutils-0.164/aarch64_uio.patch b/meta/recipes-devtools/elfutils/elfutils-0.164/aarch64_uio.patch
new file mode 100644
index 0000000000..38dc57befc
--- /dev/null
+++ b/meta/recipes-devtools/elfutils/elfutils-0.164/aarch64_uio.patch
@@ -0,0 +1,47 @@
1Fix build on aarch64/musl
2
3Errors
4
5invalid operands to binary & (have 'long double' and 'unsigned int')
6
7error: redefinition
8 of 'struct iovec'
9 struct iovec { void *iov_base; size_t iov_len; };
10 ^
11Upstream-Status: Pending
12Signed-off-by: Khem Raj <raj.khem@gmail.com>
13Index: elfutils-0.163/backends/aarch64_initreg.c
14===================================================================
15--- elfutils-0.163.orig/backends/aarch64_initreg.c
16+++ elfutils-0.163/backends/aarch64_initreg.c
17@@ -33,7 +33,7 @@
18 #include "system.h"
19 #include <assert.h>
20 #ifdef __aarch64__
21-# include <linux/uio.h>
22+# include <sys/uio.h>
23 # include <sys/user.h>
24 # include <sys/ptrace.h>
25 /* Deal with old glibc defining user_pt_regs instead of user_regs_struct. */
26@@ -82,7 +82,7 @@ aarch64_set_initial_registers_tid (pid_t
27
28 Dwarf_Word dwarf_fregs[32];
29 for (int r = 0; r < 32; r++)
30- dwarf_fregs[r] = fregs.vregs[r] & 0xFFFFFFFF;
31+ dwarf_fregs[r] = (unsigned int)fregs.vregs[r] & 0xFFFFFFFF;
32
33 if (! setfunc (64, 32, dwarf_fregs, arg))
34 return false;
35Index: elfutils-0.163/backends/arm_initreg.c
36===================================================================
37--- elfutils-0.163.orig/backends/arm_initreg.c
38+++ elfutils-0.163/backends/arm_initreg.c
39@@ -37,7 +37,7 @@
40 #endif
41
42 #ifdef __aarch64__
43-# include <linux/uio.h>
44+# include <sys/uio.h>
45 # include <sys/user.h>
46 # include <sys/ptrace.h>
47 /* Deal with old glibc defining user_pt_regs instead of user_regs_struct. */
diff --git a/meta/recipes-devtools/elfutils/elfutils-0.164/shadow.patch b/meta/recipes-devtools/elfutils/elfutils-0.164/shadow.patch
new file mode 100644
index 0000000000..d31961f94f
--- /dev/null
+++ b/meta/recipes-devtools/elfutils/elfutils-0.164/shadow.patch
@@ -0,0 +1,23 @@
1Fix control path where we have str as uninitialized string
2
3| /home/ubuntu/work/oe/openembedded-core/build/tmp-musl/work/i586-oe-linux-musl/elfutils/0.164-r0/elfutils-0.164/libcpu/i386_disasm.c: In function 'i386_disasm':
4| /home/ubuntu/work/oe/openembedded-core/build/tmp-musl/work/i586-oe-linux-musl/elfutils/0.164-r0/elfutils-0.164/libcpu/i386_disasm.c:310:5: error: 'str' may be used uninitialized in this function [-Werror=maybe-uninitialized]
5| memcpy (buf + bufcnt, _str, _len); \
6| ^
7| /home/ubuntu/work/oe/openembedded-core/build/tmp-musl/work/i586-oe-linux-musl/elfutils/0.164-r0/elfutils-0.164/libcpu/i386_disasm.c:709:17: note: 'str' was declared here
8| const char *str;
9
10Signed-off-by: Khem Raj <raj.khem@gmail.com>
11Upstream-Status: Pending
12Index: elfutils-0.164/libcpu/i386_disasm.c
13===================================================================
14--- elfutils-0.164.orig/libcpu/i386_disasm.c
15+++ elfutils-0.164/libcpu/i386_disasm.c
16@@ -821,6 +821,7 @@ i386_disasm (const uint8_t **startp, con
17 }
18
19 default:
20+ str = "";
21 assert (! "INVALID not handled");
22 }
23 }
diff --git a/meta/recipes-devtools/elfutils/elfutils-0.164/uclibc-support.patch b/meta/recipes-devtools/elfutils/elfutils-0.164/uclibc-support.patch
new file mode 100644
index 0000000000..966b70fcc4
--- /dev/null
+++ b/meta/recipes-devtools/elfutils/elfutils-0.164/uclibc-support.patch
@@ -0,0 +1,129 @@
1From 3daec2dd11a04955f95e8f65a48820103d84dbec Mon Sep 17 00:00:00 2001
2From: Junling Zheng <zhengjunling@huawei.com>
3Date: Thu, 9 Apr 2015 12:12:49 +0000
4Subject: [PATCH] uclibc support for elfutils 0.161
5
6on uclibc systems libintl and libuargp are separate from libc.
7so they need to be specified on commandline when we use proxy-libintl
8then libintl is a static archive so it should be listed last since
9elfutils does not respect disable-nls we need to link in libintl
10
11We add a new option --enable-uclibc which will be used to control
12the uclibc specific configurations during build.
13
14Upstream-Status: Inappropriate [uclibc specific]
15
16Signed-off-by: Khem Raj <raj.khem>
17Signed-off-by: Junling Zheng <zhengjunling@huawei.com>
18[Junling Zheng:
19 - adjust context
20]
21---
22 configure.ac | 8 ++++++++
23 libcpu/Makefile.am | 4 ++++
24 libdw/Makefile.am | 7 ++++++-
25 libelf/Makefile.am | 5 +++++
26 4 files changed, 23 insertions(+), 1 deletion(-)
27
28Index: elfutils-0.164/configure.ac
29===================================================================
30--- elfutils-0.164.orig/configure.ac
31+++ elfutils-0.164/configure.ac
32@@ -66,6 +66,14 @@ AS_IF([test "$use_locks" = yes],
33
34 AH_TEMPLATE([USE_LOCKS], [Defined if libraries should be thread-safe.])
35
36+AC_ARG_ENABLE([uclibc],
37+AS_HELP_STRING([--enable-uclibc], [Use uclibc for system libraries]),
38+use_uclibc=yes, use_uclibc=no)
39+AM_CONDITIONAL(USE_UCLIBC, test "$use_uclibc" = yes)
40+AS_IF([test "$use_uclibc" = yes], [AC_DEFINE(USE_UCLIBC)])
41+
42+AH_TEMPLATE([USE_UCLIBC], [Defined if uclibc libraries are used.])
43+
44 AC_PROG_CC
45 AC_PROG_RANLIB
46 AC_PROG_YACC
47@@ -291,18 +299,13 @@ AC_LINK_IFELSE(
48 )
49
50 dnl If our libc doesn't provide argp, then test for libargp
51-if test "$libc_has_argp" = "false" ; then
52- AC_MSG_WARN("libc does not have argp")
53- AC_CHECK_LIB([argp], [argp_parse], [have_argp="true"], [have_argp="false"])
54-
55- if test "$have_argp" = "false"; then
56- AC_MSG_ERROR("no libargp found")
57- else
58- argp_LDADD="-largp"
59- fi
60-else
61- argp_LDADD=""
62-fi
63+AS_IF([test "x$libc_has_argp" = "xfalse"],
64+ [AC_MSG_WARN("libc does not have argp")
65+ AC_CHECK_LIB([argp], [argp_parse], [have_argp="true" argp_LDADD="-largp"], [have_argp="false"])], [argp_LDADD=""])
66+
67+AS_IF([test "x$libc_has_argp" = "xfalse" -a "x$have_argp" = "xfalse"],
68+ AC_CHECK_LIB([uargp], [argp_parse], [have_uargp="true" argp_LDADD="-luargp"], [have_uargp="false"])], [argp_LDADD=""])
69+
70 AC_SUBST([argp_LDADD])
71
72 dnl The directories with content.
73Index: elfutils-0.164/libcpu/Makefile.am
74===================================================================
75--- elfutils-0.164.orig/libcpu/Makefile.am
76+++ elfutils-0.164/libcpu/Makefile.am
77@@ -80,6 +80,10 @@ i386_parse_CFLAGS = -DNMNES="`wc -l < i3
78 i386_lex.o: i386_parse.h
79 i386_gendis_LDADD = $(libeu) -lm
80
81+if USE_UCLIBC
82+i386_gendis_LDADD += -lintl
83+endif
84+
85 i386_parse.h: i386_parse.c ;
86
87 EXTRA_DIST = defs/i386
88Index: elfutils-0.164/libdw/Makefile.am
89===================================================================
90--- elfutils-0.164.orig/libdw/Makefile.am
91+++ elfutils-0.164/libdw/Makefile.am
92@@ -102,6 +102,11 @@ endif
93 libdw_pic_a_SOURCES =
94 am_libdw_pic_a_OBJECTS = $(libdw_a_SOURCES:.c=.os)
95
96+libdw_so_LDLIBS =
97+if USE_UCLIBC
98+libdw_so_LDLIBS += -lintl
99+endif
100+
101 libdw_so_SOURCES =
102 libdw.so$(EXEEXT): $(srcdir)/libdw.map libdw_pic.a ../libdwelf/libdwelf_pic.a \
103 ../libdwfl/libdwfl_pic.a ../libebl/libebl.a \
104@@ -112,7 +117,7 @@ libdw.so$(EXEEXT): $(srcdir)/libdw.map l
105 -Wl,--enable-new-dtags,-rpath,$(pkglibdir) \
106 -Wl,--version-script,$<,--no-undefined \
107 -Wl,--whole-archive $(filter-out $<,$^) -Wl,--no-whole-archive\
108- -ldl $(argp_LDADD) $(zip_LIBS)
109+ -ldl $(argp_LDADD) $(zip_LIBS) $(libdw_so_LDLIBS)
110 @$(textrel_check)
111 $(AM_V_at)ln -fs $@ $@.$(VERSION)
112
113Index: elfutils-0.164/libelf/Makefile.am
114===================================================================
115--- elfutils-0.164.orig/libelf/Makefile.am
116+++ elfutils-0.164/libelf/Makefile.am
117@@ -93,7 +93,12 @@ libelf_a_SOURCES = elf_version.c elf_has
118 libelf_pic_a_SOURCES =
119 am_libelf_pic_a_OBJECTS = $(libelf_a_SOURCES:.c=.os)
120
121+
122 libelf_so_LDLIBS =
123+if USE_UCLIBC
124+libelf_so_LDLIBS += -lintl
125+endif
126+
127 if USE_LOCKS
128 libelf_so_LDLIBS += -lpthread
129 endif
diff --git a/meta/recipes-devtools/elfutils/elfutils/mempcpy.patch b/meta/recipes-devtools/elfutils/elfutils/mempcpy.patch
deleted file mode 100644
index 24e31fa5b3..0000000000
--- a/meta/recipes-devtools/elfutils/elfutils/mempcpy.patch
+++ /dev/null
@@ -1,24 +0,0 @@
1
2uclibc does not export __mempcpy like glibc so we alias it here.
3This patch may make sense for upstream but elfutils uses more
4glibc specific features like obstack_printf which are missing in
5uclibc they need to be fixed along to make it work all the way
6
7Upstream-Status: Inappropriate[Elfutils uses more glibc specific features]
8
9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10
11Index: elfutils-0.148/libelf/elf_begin.c
12===================================================================
13--- elfutils-0.148.orig/libelf/elf_begin.c
14+++ elfutils-0.148/libelf/elf_begin.c
15@@ -68,6 +68,9 @@
16 #include "libelfP.h"
17 #include "common.h"
18
19+#ifdef __UCLIBC__
20+#define __mempcpy mempcpy
21+#endif
22
23 /* Create descriptor for archive in memory. */
24 static inline Elf *
diff --git a/meta/recipes-devtools/elfutils/elfutils_0.148.bb b/meta/recipes-devtools/elfutils/elfutils_0.148.bb
index 0d8490dee2..ff5325734b 100644
--- a/meta/recipes-devtools/elfutils/elfutils_0.148.bb
+++ b/meta/recipes-devtools/elfutils/elfutils_0.148.bb
@@ -27,7 +27,6 @@ SRC_URI += "\
27 file://elf_additions.diff \ 27 file://elf_additions.diff \
28 file://elfutils-fsize.patch \ 28 file://elfutils-fsize.patch \
29 file://remove-unused.patch \ 29 file://remove-unused.patch \
30 file://mempcpy.patch \
31 file://fix_for_gcc-4.7.patch \ 30 file://fix_for_gcc-4.7.patch \
32 file://dso-link-change.patch \ 31 file://dso-link-change.patch \
33 file://nm-Fix-size-passed-to-snprintf-for-invalid-sh_name-case.patch \ 32 file://nm-Fix-size-passed-to-snprintf-for-invalid-sh_name-case.patch \
diff --git a/meta/recipes-devtools/elfutils/elfutils_0.164.bb b/meta/recipes-devtools/elfutils/elfutils_0.164.bb
index c27635dda3..4964c05078 100644
--- a/meta/recipes-devtools/elfutils/elfutils_0.164.bb
+++ b/meta/recipes-devtools/elfutils/elfutils_0.164.bb
@@ -4,6 +4,7 @@ SECTION = "base"
4LICENSE = "(GPLv3 & Elfutils-Exception)" 4LICENSE = "(GPLv3 & Elfutils-Exception)"
5LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504" 5LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
6DEPENDS = "libtool bzip2 zlib virtual/libintl" 6DEPENDS = "libtool bzip2 zlib virtual/libintl"
7DEPENDS_append_libc-musl = " argp-standalone fts "
7 8
8SRC_URI = "https://fedorahosted.org/releases/e/l/elfutils/${PV}/${BP}.tar.bz2" 9SRC_URI = "https://fedorahosted.org/releases/e/l/elfutils/${PV}/${BP}.tar.bz2"
9 10
@@ -11,13 +12,14 @@ SRC_URI[md5sum] = "2e4536c1c48034f188a80789a59114d8"
11SRC_URI[sha256sum] = "9683c025928a12d06b7fe812928aa6235249e22d197d086f7084606a48165900" 12SRC_URI[sha256sum] = "9683c025928a12d06b7fe812928aa6235249e22d197d086f7084606a48165900"
12 13
13SRC_URI += "\ 14SRC_URI += "\
14 file://mempcpy.patch \
15 file://dso-link-change.patch \ 15 file://dso-link-change.patch \
16 file://Fix_elf_cvt_gunhash.patch \ 16 file://Fix_elf_cvt_gunhash.patch \
17 file://fixheadercheck.patch \ 17 file://fixheadercheck.patch \
18 file://0001-elf_getarsym-Silence-Werror-maybe-uninitialized-fals.patch \ 18 file://0001-elf_getarsym-Silence-Werror-maybe-uninitialized-fals.patch \
19 file://0001-remove-the-unneed-checking.patch \ 19 file://0001-remove-the-unneed-checking.patch \
20 file://0001-fix-a-stack-usage-warning.patch \ 20 file://0001-fix-a-stack-usage-warning.patch \
21 file://aarch64_uio.patch \
22 file://shadow.patch \
21" 23"
22 24
23# pick the patch from debian 25# pick the patch from debian
@@ -33,10 +35,9 @@ SRC_URI += "\
33 file://0001-Ignore-differences-between-mips-machine-identifiers.patch \ 35 file://0001-Ignore-differences-between-mips-machine-identifiers.patch \
34 file://0002-Add-support-for-mips64-abis-in-mips_retval.c.patch \ 36 file://0002-Add-support-for-mips64-abis-in-mips_retval.c.patch \
35 file://0003-Add-mips-n64-relocation-format-hack.patch \ 37 file://0003-Add-mips-n64-relocation-format-hack.patch \
38 file://uclibc-support.patch \
36" 39"
37 40SRC_URI_append_libc-musl = " file://0001-build-Provide-alternatives-for-glibc-assumptions-hel.patch "
38# Only apply when building uclibc based target recipe
39SRC_URI_append_libc-uclibc = " file://uclibc-support-for-elfutils-0.161.patch"
40 41
41# The buildsystem wants to generate 2 .h files from source using a binary it just built, 42# The buildsystem wants to generate 2 .h files from source using a binary it just built,
42# which can not pass the cross compiling, so let's work around it by adding 2 .h files 43# which can not pass the cross compiling, so let's work around it by adding 2 .h files
@@ -50,7 +51,7 @@ EXTRA_OECONF_append_libc-uclibc = " --enable-uclibc"
50 51
51do_install_append() { 52do_install_append() {
52 if [ "${TARGET_ARCH}" != "x86_64" ] && [ -z `echo "${TARGET_ARCH}"|grep 'i.86'` ];then 53 if [ "${TARGET_ARCH}" != "x86_64" ] && [ -z `echo "${TARGET_ARCH}"|grep 'i.86'` ];then
53 rm ${D}${bindir}/eu-objdump 54 rm -f ${D}${bindir}/eu-objdump
54 fi 55 fi
55} 56}
56 57
@@ -62,6 +63,8 @@ EXTRA_OEMAKE_libc-uclibc = "-C libelf"
62EXTRA_OEMAKE_class-native = "" 63EXTRA_OEMAKE_class-native = ""
63EXTRA_OEMAKE_class-nativesdk = "" 64EXTRA_OEMAKE_class-nativesdk = ""
64 65
66ALLOW_EMPTY_${PN}_libc-musl = "1"
67
65BBCLASSEXTEND = "native nativesdk" 68BBCLASSEXTEND = "native nativesdk"
66 69
67# Package utilities separately 70# Package utilities separately