summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/elfutils
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/elfutils')
-rw-r--r--meta/recipes-devtools/elfutils/elfutils_0.193.bb (renamed from meta/recipes-devtools/elfutils/elfutils_0.191.bb)86
-rw-r--r--meta/recipes-devtools/elfutils/files/0001-config-eu.am-do-not-force-Werror.patch34
-rw-r--r--meta/recipes-devtools/elfutils/files/0001-debuginfod-Remove-unused-variable.patch34
-rw-r--r--meta/recipes-devtools/elfutils/files/0001-dso-link-change.patch49
-rw-r--r--meta/recipes-devtools/elfutils/files/0001-libasm-may-link-with-libbz2-if-found.patch39
-rw-r--r--meta/recipes-devtools/elfutils/files/0001-libelf-Add-libeu-objects-to-libelf.a-static-archive.patch35
-rw-r--r--meta/recipes-devtools/elfutils/files/0001-libelf-elf_end.c-check-data_list.data.d.d_buf-before.patch6
-rw-r--r--meta/recipes-devtools/elfutils/files/0001-skip-the-test-when-gcc-not-deployed.patch2
-rw-r--r--meta/recipes-devtools/elfutils/files/0001-srcfiles-fix-unused-variable-BUFFER_SIZE.patch36
-rw-r--r--meta/recipes-devtools/elfutils/files/0001-tests-Makefile.am-compile-test_nlist-with-standard-C.patch6
-rw-r--r--meta/recipes-devtools/elfutils/files/0002-Fix-elf_cvt_gunhash-if-dest-and-src-are-same.patch2
-rw-r--r--meta/recipes-devtools/elfutils/files/0003-fixheadercheck.patch2
-rw-r--r--meta/recipes-devtools/elfutils/files/0003-musl-utils.patch4
-rw-r--r--meta/recipes-devtools/elfutils/files/0006-Fix-build-on-aarch64-musl.patch58
-rw-r--r--meta/recipes-devtools/elfutils/files/ptest.patch16
15 files changed, 130 insertions, 279 deletions
diff --git a/meta/recipes-devtools/elfutils/elfutils_0.191.bb b/meta/recipes-devtools/elfutils/elfutils_0.193.bb
index c4d872430b..4ccea2bea3 100644
--- a/meta/recipes-devtools/elfutils/elfutils_0.191.bb
+++ b/meta/recipes-devtools/elfutils/elfutils_0.193.bb
@@ -4,7 +4,7 @@ DESCRIPTION = "elfutils is a collection of utilities and libraries to read, crea
4SECTION = "base" 4SECTION = "base"
5LICENSE = "( GPL-2.0-or-later | LGPL-3.0-or-later ) & GPL-3.0-or-later" 5LICENSE = "( GPL-2.0-or-later | LGPL-3.0-or-later ) & GPL-3.0-or-later"
6LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \ 6LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
7 file://debuginfod/debuginfod-client.c;endline=28;md5=f0a7c3170776866ee94e8f9225a6ad79 \ 7 file://debuginfod/debuginfod-client.c;endline=28;md5=6b7b0a4b25197d7f2e12b2f4aa1c86b8 \
8 " 8 "
9DEPENDS = "zlib virtual/libintl" 9DEPENDS = "zlib virtual/libintl"
10DEPENDS:append:libc-musl = " argp-standalone fts musl-legacy-error musl-obstack" 10DEPENDS:append:libc-musl = " argp-standalone fts musl-legacy-error musl-obstack"
@@ -12,22 +12,19 @@ DEPENDS:append:libc-musl = " argp-standalone fts musl-legacy-error musl-obstack"
12# http://ftp.de.debian.org/debian/pool/main/e/elfutils/elfutils_0.176-1.debian.tar.xz 12# http://ftp.de.debian.org/debian/pool/main/e/elfutils/elfutils_0.176-1.debian.tar.xz
13SRC_URI = "https://sourceware.org/elfutils/ftp/${PV}/${BP}.tar.bz2 \ 13SRC_URI = "https://sourceware.org/elfutils/ftp/${PV}/${BP}.tar.bz2 \
14 file://run-ptest \ 14 file://run-ptest \
15 file://0001-dso-link-change.patch \
16 file://0002-Fix-elf_cvt_gunhash-if-dest-and-src-are-same.patch \ 15 file://0002-Fix-elf_cvt_gunhash-if-dest-and-src-are-same.patch \
17 file://0003-fixheadercheck.patch \ 16 file://0003-fixheadercheck.patch \
18 file://0006-Fix-build-on-aarch64-musl.patch \
19 file://0001-libasm-may-link-with-libbz2-if-found.patch \
20 file://0001-libelf-elf_end.c-check-data_list.data.d.d_buf-before.patch \ 17 file://0001-libelf-elf_end.c-check-data_list.data.d.d_buf-before.patch \
21 file://0001-skip-the-test-when-gcc-not-deployed.patch \ 18 file://0001-skip-the-test-when-gcc-not-deployed.patch \
22 file://ptest.patch \ 19 file://ptest.patch \
23 file://0001-tests-Makefile.am-compile-test_nlist-with-standard-C.patch \ 20 file://0001-tests-Makefile.am-compile-test_nlist-with-standard-C.patch \
24 file://0001-debuginfod-Remove-unused-variable.patch \ 21 file://0001-config-eu.am-do-not-force-Werror.patch \
25 file://0001-srcfiles-fix-unused-variable-BUFFER_SIZE.patch \ 22 file://0001-libelf-Add-libeu-objects-to-libelf.a-static-archive.patch \
26 " 23 "
27SRC_URI:append:libc-musl = " \ 24SRC_URI:append:libc-musl = " \
28 file://0003-musl-utils.patch \ 25 file://0003-musl-utils.patch \
29 " 26 "
30SRC_URI[sha256sum] = "df76db71366d1d708365fc7a6c60ca48398f14367eb2b8954efc8897147ad871" 27SRC_URI[sha256sum] = "7857f44b624f4d8d421df851aaae7b1402cfe6bcdd2d8049f15fc07d3dde7635"
31 28
32inherit autotools gettext ptest pkgconfig 29inherit autotools gettext ptest pkgconfig
33 30
@@ -47,7 +44,7 @@ PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'debuginfod', 'debugi
47PACKAGECONFIG[bzip2] = "--with-bzlib,--without-bzlib,${DEPENDS_BZIP2}" 44PACKAGECONFIG[bzip2] = "--with-bzlib,--without-bzlib,${DEPENDS_BZIP2}"
48PACKAGECONFIG[xz] = "--with-lzma,--without-lzma,xz" 45PACKAGECONFIG[xz] = "--with-lzma,--without-lzma,xz"
49PACKAGECONFIG[zstd] = "--with-zstd,--without-zstd,zstd" 46PACKAGECONFIG[zstd] = "--with-zstd,--without-zstd,zstd"
50PACKAGECONFIG[libdebuginfod] = "--enable-libdebuginfod,--disable-libdebuginfod,curl" 47PACKAGECONFIG[libdebuginfod] = "--enable-libdebuginfod,--disable-libdebuginfod,curl json-c"
51PACKAGECONFIG[debuginfod] = "--enable-debuginfod,--disable-debuginfod,libarchive sqlite3 libmicrohttpd" 48PACKAGECONFIG[debuginfod] = "--enable-debuginfod,--disable-debuginfod,libarchive sqlite3 libmicrohttpd"
52 49
53RDEPENDS:${PN}-ptest += "libasm libelf bash make coreutils ${PN}-binutils iproute2-ss bsdtar gcc-symlinks binutils-symlinks libgcc-dev" 50RDEPENDS:${PN}-ptest += "libasm libelf bash make coreutils ${PN}-binutils iproute2-ss bsdtar gcc-symlinks binutils-symlinks libgcc-dev"
@@ -67,42 +64,42 @@ do_compile_ptest() {
67PTEST_PARALLEL_MAKE = "" 64PTEST_PARALLEL_MAKE = ""
68 65
69do_install_ptest() { 66do_install_ptest() {
70 if [ ${PTEST_ENABLED} = "1" ]; then 67 # copy the files which needed by the cases
71 # copy the files which needed by the cases 68 TEST_FILES="strip strip.o addr2line elfcmp objdump readelf size.o nm.o nm elflint elfcompress elfclassify stack unstrip srcfiles"
72 TEST_FILES="strip strip.o addr2line elfcmp objdump readelf size.o nm.o nm elflint elfcompress elfclassify stack unstrip srcfiles" 69 install -d -m 755 ${D}${PTEST_PATH}/src
73 install -d -m 755 ${D}${PTEST_PATH}/src 70 install -d -m 755 ${D}${PTEST_PATH}/config
74 install -d -m 755 ${D}${PTEST_PATH}/lib 71 install -d -m 755 ${D}${PTEST_PATH}/lib
75 install -d -m 755 ${D}${PTEST_PATH}/libelf 72 install -d -m 755 ${D}${PTEST_PATH}/libelf
76 install -d -m 755 ${D}${PTEST_PATH}/libdw 73 install -d -m 755 ${D}${PTEST_PATH}/libdw
77 install -d -m 755 ${D}${PTEST_PATH}/libdwfl 74 install -d -m 755 ${D}${PTEST_PATH}/libdwfl
78 install -d -m 755 ${D}${PTEST_PATH}/libdwelf 75 install -d -m 755 ${D}${PTEST_PATH}/libdwelf
79 install -d -m 755 ${D}${PTEST_PATH}/libasm 76 install -d -m 755 ${D}${PTEST_PATH}/libasm
80 install -d -m 755 ${D}${PTEST_PATH}/libcpu 77 install -d -m 755 ${D}${PTEST_PATH}/libcpu
81 install -d -m 755 ${D}${PTEST_PATH}/libebl 78 install -d -m 755 ${D}${PTEST_PATH}/libebl
82 for test_file in ${TEST_FILES}; do 79 for test_file in ${TEST_FILES}; do
83 if [ -f ${B}/src/${test_file} ]; then 80 if [ -f ${B}/src/${test_file} ]; then
84 cp -r ${B}/src/${test_file} ${D}${PTEST_PATH}/src 81 cp -r ${B}/src/${test_file} ${D}${PTEST_PATH}/src
85 fi 82 fi
86 done 83 done
87 cp ${D}${libdir}/libelf-${PV}.so ${D}${PTEST_PATH}/libelf/libelf.so 84 cp ${D}${libdir}/libelf-${PV}.so ${D}${PTEST_PATH}/libelf/libelf.so
88 cp ${D}${libdir}/libdw-${PV}.so ${D}${PTEST_PATH}/libdw/libdw.so 85 cp ${D}${libdir}/libdw-${PV}.so ${D}${PTEST_PATH}/libdw/libdw.so
89 cp ${D}${libdir}/libasm-${PV}.so ${D}${PTEST_PATH}/libasm/libasm.so 86 cp ${D}${libdir}/libasm-${PV}.so ${D}${PTEST_PATH}/libasm/libasm.so
90 cp ${B}/libcpu/libcpu.a ${D}${PTEST_PATH}/libcpu/ 87 cp ${B}/libcpu/libcpu.a ${D}${PTEST_PATH}/libcpu/
91 cp ${B}/libebl/libebl.a ${D}${PTEST_PATH}/libebl/ 88 cp ${B}/libebl/libebl.a ${D}${PTEST_PATH}/libebl/
92 cp ${B}/lib/libeu.a ${D}${PTEST_PATH}/lib/ 89 cp ${B}/lib/libeu.a ${D}${PTEST_PATH}/lib/
93 cp ${S}/libelf/*.h ${D}${PTEST_PATH}/libelf/ 90 cp ${S}/libelf/*.h ${D}${PTEST_PATH}/libelf/
94 cp ${S}/libdw/*.h ${D}${PTEST_PATH}/libdw/ 91 cp ${S}/libdw/*.h ${D}${PTEST_PATH}/libdw/
95 cp ${S}/libdwfl/*.h ${D}${PTEST_PATH}/libdwfl/ 92 cp ${S}/libdwfl/*.h ${D}${PTEST_PATH}/libdwfl/
96 cp ${S}/libdwelf/*.h ${D}${PTEST_PATH}/libdwelf/ 93 cp ${S}/libdwelf/*.h ${D}${PTEST_PATH}/libdwelf/
97 cp ${S}/libasm/*.h ${D}${PTEST_PATH}/libasm/ 94 cp ${S}/libasm/*.h ${D}${PTEST_PATH}/libasm/
98 cp -r ${S}/tests/ ${D}${PTEST_PATH} 95 cp -r ${S}/tests/ ${D}${PTEST_PATH}
99 cp -r ${B}/tests/* ${D}${PTEST_PATH}/tests 96 cp -r ${B}/tests/* ${D}${PTEST_PATH}/tests
100 cp -r ${B}/config.h ${D}${PTEST_PATH} 97 cp -r ${B}/config.h ${D}${PTEST_PATH}
101 cp -r ${B}/backends ${D}${PTEST_PATH} 98 cp -r ${B}/config/profile.sh ${D}${PTEST_PATH}/config
102 cp -r ${B}/debuginfod ${D}${PTEST_PATH} 99 cp -r ${B}/backends ${D}${PTEST_PATH}
103 sed -i '/^Makefile:/c Makefile:' ${D}${PTEST_PATH}/tests/Makefile 100 cp -r ${B}/debuginfod ${D}${PTEST_PATH}
104 find ${D}${PTEST_PATH} -type f -name *.[hoc] | xargs -i rm {} 101 sed -i '/^Makefile:/c Makefile:' ${D}${PTEST_PATH}/tests/Makefile
105 fi 102 find ${D}${PTEST_PATH} -type f -name *.[hoc] | xargs -i rm {}
106} 103}
107 104
108EXTRA_OEMAKE:class-native = "" 105EXTRA_OEMAKE:class-native = ""
@@ -124,6 +121,7 @@ LICENSE:libasm = "GPL-2.0-or-later | LGPL-3.0-or-later"
124LICENSE:libdw = "GPL-2.0-or-later | LGPL-3.0-or-later" 121LICENSE:libdw = "GPL-2.0-or-later | LGPL-3.0-or-later"
125LICENSE:libdebuginfod = "GPL-2.0-or-later | LGPL-3.0-or-later" 122LICENSE:libdebuginfod = "GPL-2.0-or-later | LGPL-3.0-or-later"
126 123
124FILES:${PN} += "${datadir}/fish"
127FILES:${PN}-binutils = "\ 125FILES:${PN}-binutils = "\
128 ${bindir}/eu-addr2line \ 126 ${bindir}/eu-addr2line \
129 ${bindir}/eu-ld \ 127 ${bindir}/eu-ld \
diff --git a/meta/recipes-devtools/elfutils/files/0001-config-eu.am-do-not-force-Werror.patch b/meta/recipes-devtools/elfutils/files/0001-config-eu.am-do-not-force-Werror.patch
new file mode 100644
index 0000000000..d4e141927f
--- /dev/null
+++ b/meta/recipes-devtools/elfutils/files/0001-config-eu.am-do-not-force-Werror.patch
@@ -0,0 +1,34 @@
1From e169c3fc734be1783b3e1a4768dbec05fb64cb4f Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex@linutronix.de>
3Date: Fri, 22 Nov 2024 12:50:48 +0100
4Subject: [PATCH] config/eu.am: do not force -Werror
5
6This is undesirable when compiler versions may not be the same
7as what upstream is using for their own testing.
8
9Upstream-Status: Inappropriate [oe-core specific]
10Signed-off-by: Alexander Kanavin <alex@linutronix.de>
11---
12 config/eu.am | 2 --
13 1 file changed, 2 deletions(-)
14
15diff --git a/config/eu.am b/config/eu.am
16index 0b7dab5..5e7a03f 100644
17--- a/config/eu.am
18+++ b/config/eu.am
19@@ -99,7 +99,6 @@ AM_CFLAGS = -std=gnu99 -Wall -Wshadow -Wformat=2 \
20 $(LOGICAL_OP_WARNING) $(DUPLICATED_COND_WARNING) \
21 $(NULL_DEREFERENCE_WARNING) $(IMPLICIT_FALLTHROUGH_WARNING) \
22 $(USE_AFTER_FREE3_WARNING) \
23- $(if $($(*F)_no_Werror),,-Werror) \
24 $(if $($(*F)_no_Wunused),,-Wunused -Wextra) \
25 $(if $($(*F)_no_Wstack_usage),,$(STACK_USAGE_WARNING)) \
26 $(if $($(*F)_no_Wpacked_not_aligned),$(NO_PACKED_NOT_ALIGNED_WARNING),) \
27@@ -109,7 +108,6 @@ AM_CXXFLAGS = -std=c++11 -Wall -Wshadow \
28 $(TRAMPOLINES_WARNING) \
29 $(LOGICAL_OP_WARNING) $(DUPLICATED_COND_WARNING) \
30 $(NULL_DEREFERENCE_WARNING) $(IMPLICIT_FALLTHROUGH_WARNING) \
31- $(if $($(*F)_no_Werror),,-Werror) \
32 $(if $($(*F)_no_Wunused),,-Wunused -Wextra) \
33 $(if $($(*F)_no_Wstack_usage),,$(STACK_USAGE_WARNING)) \
34 $(if $($(*F)_no_Wpacked_not_aligned),$(NO_PACKED_NOT_ALIGNED_WARNING),) \
diff --git a/meta/recipes-devtools/elfutils/files/0001-debuginfod-Remove-unused-variable.patch b/meta/recipes-devtools/elfutils/files/0001-debuginfod-Remove-unused-variable.patch
deleted file mode 100644
index 81f49dbf21..0000000000
--- a/meta/recipes-devtools/elfutils/files/0001-debuginfod-Remove-unused-variable.patch
+++ /dev/null
@@ -1,34 +0,0 @@
1From c3502140e51886bffc6ae5cd256308e40e0cbb78 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 9 Mar 2024 15:52:32 -0800
4Subject: [PATCH] debuginfod: Remove unused variable
5
6Recent commit acd9525e9 has removed all references to max_fds
7therefore remove it, moreover clang18 is happier
8
9| ../../elfutils-0.191/debuginfod/debuginfod.cxx:1448:8: error: private field 'max_fds' is not used [-Werror,-Wunused-private-field]
10| 1448 | long max_fds;
11| | ^
12| 1 error generated.
13
14Upstream-Status: Submitted [https://sourceware.org/pipermail/elfutils-devel/2024q1/006900.html]
15Signed-off-by: Khem Raj <raj.khem@gmail.com>
16---
17 debuginfod/debuginfod.cxx | 1 -
18 1 file changed, 1 deletion(-)
19
20diff --git a/debuginfod/debuginfod.cxx b/debuginfod/debuginfod.cxx
21index 560880f2..72617848 100644
22--- a/debuginfod/debuginfod.cxx
23+++ b/debuginfod/debuginfod.cxx
24@@ -1445,7 +1445,6 @@ private:
25
26 map<key,fdcache_entry> entries; // optimized for lookup
27 time_t last_cleaning;
28- long max_fds;
29 long max_mbs;
30
31 public:
32--
332.44.0
34
diff --git a/meta/recipes-devtools/elfutils/files/0001-dso-link-change.patch b/meta/recipes-devtools/elfutils/files/0001-dso-link-change.patch
deleted file mode 100644
index 4f7539bef2..0000000000
--- a/meta/recipes-devtools/elfutils/files/0001-dso-link-change.patch
+++ /dev/null
@@ -1,49 +0,0 @@
1From 63070df4b0dc7af37a720915b5e6494204463c9a Mon Sep 17 00:00:00 2001
2From: Hongxu Jia <hongxu.jia@windriver.com>
3Date: Tue, 15 Aug 2017 17:10:57 +0800
4Subject: [PATCH] dso link change
5
6Upstream-Status: Pending
7
8This patch makes the link to the dependencies of libdw explicit, as
9recent ld no longer implicitly links them. See
10http://lists.fedoraproject.org/pipermail/devel/2010-March/133601.html
11as a similar example of the error message you can encounter without this
12patch, and https://fedoraproject.org/wiki/UnderstandingDSOLinkChange and
13https://fedoraproject.org/wiki/Features/ChangeInImplicitDSOLinking for
14more details.
15
16Rebase to 0.170
17
18Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
19---
20 src/Makefile.am | 2 +-
21 tests/Makefile.am | 2 +-
22 2 files changed, 2 insertions(+), 2 deletions(-)
23
24diff --git a/src/Makefile.am b/src/Makefile.am
25index 1d592d4..853eda4 100644
26--- a/src/Makefile.am
27+++ b/src/Makefile.am
28@@ -50,7 +50,7 @@ libdebuginfod =
29 endif
30 else
31 libasm = ../libasm/libasm.so
32-libdw = ../libdw/libdw.so
33+libdw = ../libdw/libdw.so $(zip_LIBS) $(libelf) $(libebl) -ldl
34 libelf = ../libelf/libelf.so
35 if LIBDEBUGINFOD
36 libdebuginfod = ../debuginfod/libdebuginfod.so
37diff --git a/tests/Makefile.am b/tests/Makefile.am
38index 9141074..ee49d07 100644
39--- a/tests/Makefile.am
40+++ b/tests/Makefile.am
41@@ -694,7 +694,7 @@ libdw = ../libdw/libdw.a -lz $(zip_LIBS) $(libelf) $(libebl) -ldl -lpthread
42 libelf = ../libelf/libelf.a -lz $(zstd_LIBS)
43 libasm = ../libasm/libasm.a
44 else
45-libdw = ../libdw/libdw.so
46+libdw = ../libdw/libdw.so $(zip_LIBS) $(libelf) $(libebl) -ldl
47 libelf = ../libelf/libelf.so
48 libasm = ../libasm/libasm.so
49 endif
diff --git a/meta/recipes-devtools/elfutils/files/0001-libasm-may-link-with-libbz2-if-found.patch b/meta/recipes-devtools/elfutils/files/0001-libasm-may-link-with-libbz2-if-found.patch
deleted file mode 100644
index a9f5e030fc..0000000000
--- a/meta/recipes-devtools/elfutils/files/0001-libasm-may-link-with-libbz2-if-found.patch
+++ /dev/null
@@ -1,39 +0,0 @@
1From 46d9d889a07fc9f9f089f800e5c0e895889c44ae Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 4 Oct 2017 22:30:46 -0700
4Subject: [PATCH] libasm may link with libbz2 if found
5
6This can fail to link binaries like objdump
7where indirect libraries may be not found by linker
8
9| /mnt/a/oe/build/tmp/work/riscv64-bec-linux/elfutils/0.170-r0/recipe-sysroot/usr/lib/libbz2.so.1: error adding symbols: DSO missing from command line
10| collect2: error: ld returned 1 exit status
11
12Upstream-Status: Pending
13Signed-off-by: Khem Raj <raj.khem@gmail.com>
14---
15 src/Makefile.am | 4 ++--
16 1 file changed, 2 insertions(+), 2 deletions(-)
17
18diff --git a/src/Makefile.am b/src/Makefile.am
19index 853eda4..da7f3b4 100644
20--- a/src/Makefile.am
21+++ b/src/Makefile.am
22@@ -40,7 +40,7 @@ EXTRA_DIST += make-debug-archive.in
23 CLEANFILES += make-debug-archive
24
25 if BUILD_STATIC
26-libasm = ../libasm/libasm.a
27+libasm = ../libasm/libasm.a $(zip_LIBS)
28 libdw = ../libdw/libdw.a -lz $(zip_LIBS) $(libelf) -ldl -lpthread
29 libelf = ../libelf/libelf.a -lz $(zstd_LIBS)
30 if LIBDEBUGINFOD
31@@ -49,7 +49,7 @@ else
32 libdebuginfod =
33 endif
34 else
35-libasm = ../libasm/libasm.so
36+libasm = ../libasm/libasm.so $(zip_LIBS)
37 libdw = ../libdw/libdw.so $(zip_LIBS) $(libelf) $(libebl) -ldl
38 libelf = ../libelf/libelf.so
39 if LIBDEBUGINFOD
diff --git a/meta/recipes-devtools/elfutils/files/0001-libelf-Add-libeu-objects-to-libelf.a-static-archive.patch b/meta/recipes-devtools/elfutils/files/0001-libelf-Add-libeu-objects-to-libelf.a-static-archive.patch
new file mode 100644
index 0000000000..81c5255447
--- /dev/null
+++ b/meta/recipes-devtools/elfutils/files/0001-libelf-Add-libeu-objects-to-libelf.a-static-archive.patch
@@ -0,0 +1,35 @@
1From f5d6e088f84dd05278c4698a21cbf1ff4569978d Mon Sep 17 00:00:00 2001
2From: Mark Wielaard <mark@klomp.org>
3Date: Tue, 22 Oct 2024 15:03:42 +0200
4Subject: [PATCH] libelf: Add libeu objects to libelf.a static archive
5
6libelf might use some symbols from libeu.a, specifically the eu-search
7wrappers. But we don't ship libeu.a separately. So include the libeu
8objects in the libelf.a archive to facilitate static linking.
9
10 * libelf/Makefile.am (libeu_objects): New variable.
11 (libelf_a_LIBADD): New, add libeu_objects.
12
13https://sourceware.org/bugzilla/show_bug.cgi?id=32293
14
15Signed-off-by: Mark Wielaard <mark@klomp.org>
16Signed-off-by: Martin Jansa <martin.jansa@gmail.com>
17Upstream-Status: Backport [https://sourceware.org/git/?p=elfutils.git;a=commit;h=f5d6e088f84dd05278c4698a21cbf1ff4569978d]
18---
19 libelf/Makefile.am | 3 +++
20 1 file changed, 3 insertions(+)
21
22diff --git a/libelf/Makefile.am b/libelf/Makefile.am
23index 05484c1..72f1e22 100644
24--- a/libelf/Makefile.am
25+++ b/libelf/Makefile.am
26@@ -125,6 +125,9 @@ libelf.so: $(srcdir)/libelf.map $(libelf_so_LIBS) $(libelf_so_DEPS)
27 libeu_objects = $(shell cat ../lib/libeu.manifest)
28 libelf_a_LIBADD = $(addprefix ../lib/,$(libeu_objects))
29
30+libeu_objects = $(shell $(AR) t ../lib/libeu.a)
31+libelf_a_LIBADD = $(addprefix ../lib/,$(libeu_objects))
32+
33 install: install-am libelf.so
34 $(mkinstalldirs) $(DESTDIR)$(libdir)
35 $(INSTALL_PROGRAM) libelf.so $(DESTDIR)$(libdir)/libelf-$(PACKAGE_VERSION).so
diff --git a/meta/recipes-devtools/elfutils/files/0001-libelf-elf_end.c-check-data_list.data.d.d_buf-before.patch b/meta/recipes-devtools/elfutils/files/0001-libelf-elf_end.c-check-data_list.data.d.d_buf-before.patch
index 57e4b3890a..1ee50588dc 100644
--- a/meta/recipes-devtools/elfutils/files/0001-libelf-elf_end.c-check-data_list.data.d.d_buf-before.patch
+++ b/meta/recipes-devtools/elfutils/files/0001-libelf-elf_end.c-check-data_list.data.d.d_buf-before.patch
@@ -1,4 +1,4 @@
1From 19d9e9d838e74e4a0a22f08ae03167380f8aa490 Mon Sep 17 00:00:00 2001 1From c4a26ff38182b289a1076bbef263e808b5e3aa97 Mon Sep 17 00:00:00 2001
2From: Robert Yang <liezhi.yang@windriver.com> 2From: Robert Yang <liezhi.yang@windriver.com>
3Date: Thu, 16 Aug 2018 09:58:26 +0800 3Date: Thu, 16 Aug 2018 09:58:26 +0800
4Subject: [PATCH] libelf/elf_end.c: check data_list.data.d.d_buf before free it 4Subject: [PATCH] libelf/elf_end.c: check data_list.data.d.d_buf before free it
@@ -19,10 +19,10 @@ Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
19 1 file changed, 4 insertions(+), 2 deletions(-) 19 1 file changed, 4 insertions(+), 2 deletions(-)
20 20
21diff --git a/libelf/elf_end.c b/libelf/elf_end.c 21diff --git a/libelf/elf_end.c b/libelf/elf_end.c
22index 80f4d13..b103959 100644 22index da8f3a2..8557658 100644
23--- a/libelf/elf_end.c 23--- a/libelf/elf_end.c
24+++ b/libelf/elf_end.c 24+++ b/libelf/elf_end.c
25@@ -169,14 +169,16 @@ elf_end (Elf *elf) 25@@ -170,14 +170,16 @@ elf_end (Elf *elf)
26 architecture doesn't require overly stringent 26 architecture doesn't require overly stringent
27 alignment the raw data buffer is the same as the 27 alignment the raw data buffer is the same as the
28 one used for presenting to the caller. */ 28 one used for presenting to the caller. */
diff --git a/meta/recipes-devtools/elfutils/files/0001-skip-the-test-when-gcc-not-deployed.patch b/meta/recipes-devtools/elfutils/files/0001-skip-the-test-when-gcc-not-deployed.patch
index 096361e215..2fc526372d 100644
--- a/meta/recipes-devtools/elfutils/files/0001-skip-the-test-when-gcc-not-deployed.patch
+++ b/meta/recipes-devtools/elfutils/files/0001-skip-the-test-when-gcc-not-deployed.patch
@@ -1,4 +1,4 @@
1From f9ab54454000fd210dbaa92cf516084d05060f9d Mon Sep 17 00:00:00 2001 1From d59d6fd13e4a7fe3fdca2a4ce1cd2def36356bb4 Mon Sep 17 00:00:00 2001
2From: Mingli Yu <Mingli.Yu@windriver.com> 2From: Mingli Yu <Mingli.Yu@windriver.com>
3Date: Tue, 21 May 2019 15:20:34 +0800 3Date: Tue, 21 May 2019 15:20:34 +0800
4Subject: [PATCH] skip the test when gcc not deployed 4Subject: [PATCH] skip the test when gcc not deployed
diff --git a/meta/recipes-devtools/elfutils/files/0001-srcfiles-fix-unused-variable-BUFFER_SIZE.patch b/meta/recipes-devtools/elfutils/files/0001-srcfiles-fix-unused-variable-BUFFER_SIZE.patch
deleted file mode 100644
index b3032327a2..0000000000
--- a/meta/recipes-devtools/elfutils/files/0001-srcfiles-fix-unused-variable-BUFFER_SIZE.patch
+++ /dev/null
@@ -1,36 +0,0 @@
1From db51a55a8e3811d19265bf12d2ff715c6cf558b4 Mon Sep 17 00:00:00 2001
2From: Jose Quaresma <jose.quaresma@foundries.io>
3Date: Tue, 19 Mar 2024 10:17:59 +0000
4Subject: [PATCH] srcfiles: fix unused variable BUFFER_SIZE
5
6The const variable BUFFER_SIZE is used only on the zip_files
7function witch is only available with LIBARCHIVE.
8
9| ../../elfutils-0.191/src/srcfiles.cxx:81:18: error: unused variable 'BUFFER_SIZE' [-Werror,-Wunused-const-variable]
10| 81 | constexpr size_t BUFFER_SIZE = 8192;
11| | ^~~~~~~~~~~
12
13Upstream-Status: Backport [https://sourceware.org/git/?p=elfutils.git;a=commitdiff;h=ef8a4b841aaf26326b8961a651dbe915d54d23e7]
14
15Signed-off-by: Jose Quaresma <jose.quaresma@foundries.io>
16---
17 src/srcfiles.cxx | 2 ++
18 1 file changed, 2 insertions(+)
19
20diff --git a/src/srcfiles.cxx b/src/srcfiles.cxx
21index 892737cc..09d50f8d 100644
22--- a/src/srcfiles.cxx
23+++ b/src/srcfiles.cxx
24@@ -78,7 +78,9 @@ ARGP_PROGRAM_VERSION_HOOK_DEF = print_version;
25 /* Bug report address. */
26 ARGP_PROGRAM_BUG_ADDRESS_DEF = PACKAGE_BUGREPORT;
27
28+#ifdef HAVE_LIBARCHIVE
29 constexpr size_t BUFFER_SIZE = 8192;
30+#endif
31
32 /* Definitions of arguments for argp functions. */
33 static const struct argp_option options[] =
34--
352.44.0
36
diff --git a/meta/recipes-devtools/elfutils/files/0001-tests-Makefile.am-compile-test_nlist-with-standard-C.patch b/meta/recipes-devtools/elfutils/files/0001-tests-Makefile.am-compile-test_nlist-with-standard-C.patch
index d410eb13d8..f3790a6d25 100644
--- a/meta/recipes-devtools/elfutils/files/0001-tests-Makefile.am-compile-test_nlist-with-standard-C.patch
+++ b/meta/recipes-devtools/elfutils/files/0001-tests-Makefile.am-compile-test_nlist-with-standard-C.patch
@@ -1,4 +1,4 @@
1From 2d4dfb814dda02193e49c9203147cf73e6d3f8b7 Mon Sep 17 00:00:00 2001 1From 34ae914b362c84ff0a96b8936beedb44a2e3f451 Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex.kanavin@gmail.com> 2From: Alexander Kanavin <alex.kanavin@gmail.com>
3Date: Tue, 23 Jun 2020 07:49:35 +0000 3Date: Tue, 23 Jun 2020 07:49:35 +0000
4Subject: [PATCH] tests/Makefile.am: compile test_nlist with standard CFLAGS 4Subject: [PATCH] tests/Makefile.am: compile test_nlist with standard CFLAGS
@@ -13,10 +13,10 @@ Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
13 1 file changed, 1 insertion(+), 1 deletion(-) 13 1 file changed, 1 insertion(+), 1 deletion(-)
14 14
15diff --git a/tests/Makefile.am b/tests/Makefile.am 15diff --git a/tests/Makefile.am b/tests/Makefile.am
16index 3bd8e58..370c6a8 100644 16index eed9bd4..5dd6e05 100644
17--- a/tests/Makefile.am 17--- a/tests/Makefile.am
18+++ b/tests/Makefile.am 18+++ b/tests/Makefile.am
19@@ -103,7 +103,7 @@ endif 19@@ -104,7 +104,7 @@ endif
20 test-nlist$(EXEEXT): test-nlist.c 20 test-nlist$(EXEEXT): test-nlist.c
21 $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ 21 $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
22 $(AM_CPPFLAGS) $(CPPFLAGS) \ 22 $(AM_CPPFLAGS) $(CPPFLAGS) \
diff --git a/meta/recipes-devtools/elfutils/files/0002-Fix-elf_cvt_gunhash-if-dest-and-src-are-same.patch b/meta/recipes-devtools/elfutils/files/0002-Fix-elf_cvt_gunhash-if-dest-and-src-are-same.patch
index fa2282b8dd..bf177cce4a 100644
--- a/meta/recipes-devtools/elfutils/files/0002-Fix-elf_cvt_gunhash-if-dest-and-src-are-same.patch
+++ b/meta/recipes-devtools/elfutils/files/0002-Fix-elf_cvt_gunhash-if-dest-and-src-are-same.patch
@@ -1,4 +1,4 @@
1From d8f07a23d608b744dcc0592f9f32f258b186a77c Mon Sep 17 00:00:00 2001 1From bd78783254a7126d82eab26a2069b3a457b98e2e Mon Sep 17 00:00:00 2001
2From: Hongxu Jia <hongxu.jia@windriver.com> 2From: Hongxu Jia <hongxu.jia@windriver.com>
3Date: Tue, 15 Aug 2017 17:13:59 +0800 3Date: Tue, 15 Aug 2017 17:13:59 +0800
4Subject: [PATCH] Fix elf_cvt_gunhash if dest and src are same. 4Subject: [PATCH] Fix elf_cvt_gunhash if dest and src are same.
diff --git a/meta/recipes-devtools/elfutils/files/0003-fixheadercheck.patch b/meta/recipes-devtools/elfutils/files/0003-fixheadercheck.patch
index e8b986e4ba..a539396fd8 100644
--- a/meta/recipes-devtools/elfutils/files/0003-fixheadercheck.patch
+++ b/meta/recipes-devtools/elfutils/files/0003-fixheadercheck.patch
@@ -1,4 +1,4 @@
1From 614f062b22e6da108643f8644a3e92a1108f2b9b Mon Sep 17 00:00:00 2001 1From da61b483072b7b0bfac1f034ad03972f5104a410 Mon Sep 17 00:00:00 2001
2From: Hongxu Jia <hongxu.jia@windriver.com> 2From: Hongxu Jia <hongxu.jia@windriver.com>
3Date: Tue, 15 Aug 2017 17:17:20 +0800 3Date: Tue, 15 Aug 2017 17:17:20 +0800
4Subject: [PATCH] fixheadercheck 4Subject: [PATCH] fixheadercheck
diff --git a/meta/recipes-devtools/elfutils/files/0003-musl-utils.patch b/meta/recipes-devtools/elfutils/files/0003-musl-utils.patch
index 230ea88f41..d8961f6293 100644
--- a/meta/recipes-devtools/elfutils/files/0003-musl-utils.patch
+++ b/meta/recipes-devtools/elfutils/files/0003-musl-utils.patch
@@ -1,4 +1,4 @@
1From aab5985a29bd7ab6e0b06eaab190b42a04e10f70 Mon Sep 17 00:00:00 2001 1From b1c956cd739f364c4a80381578ddaba43e36903b Mon Sep 17 00:00:00 2001
2From: Hongxu Jia <hongxu.jia@windriver.com> 2From: Hongxu Jia <hongxu.jia@windriver.com>
3Date: Fri, 23 Aug 2019 10:19:48 +0800 3Date: Fri, 23 Aug 2019 10:19:48 +0800
4Subject: [PATCH] musl-utils 4Subject: [PATCH] musl-utils
@@ -56,7 +56,7 @@ index f771b92..263de62 100644
56 ARGP_PROGRAM_VERSION_HOOK_DEF = print_version; 56 ARGP_PROGRAM_VERSION_HOOK_DEF = print_version;
57 57
58diff --git a/src/strip.c b/src/strip.c 58diff --git a/src/strip.c b/src/strip.c
59index 6436443..1608496 100644 59index 403e0f6..738e948 100644
60--- a/src/strip.c 60--- a/src/strip.c
61+++ b/src/strip.c 61+++ b/src/strip.c
62@@ -45,6 +45,13 @@ 62@@ -45,6 +45,13 @@
diff --git a/meta/recipes-devtools/elfutils/files/0006-Fix-build-on-aarch64-musl.patch b/meta/recipes-devtools/elfutils/files/0006-Fix-build-on-aarch64-musl.patch
deleted file mode 100644
index 149e0e6a7b..0000000000
--- a/meta/recipes-devtools/elfutils/files/0006-Fix-build-on-aarch64-musl.patch
+++ /dev/null
@@ -1,58 +0,0 @@
1From 4409f128c81a9d76b9360b002a1d76043c77b53e Mon Sep 17 00:00:00 2001
2From: Hongxu Jia <hongxu.jia@windriver.com>
3Date: Tue, 15 Aug 2017 17:27:30 +0800
4Subject: [PATCH] Fix build on aarch64/musl
5
6Errors
7
8invalid operands to binary & (have 'long double' and 'unsigned int')
9
10error: redefinition
11 of 'struct iovec'
12 struct iovec { void *iov_base; size_t iov_len; };
13 ^
14Upstream-Status: Pending
15Signed-off-by: Khem Raj <raj.khem@gmail.com>
16
17Rebase to 0.170
18Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
19---
20 backends/aarch64_initreg.c | 4 ++--
21 backends/arm_initreg.c | 2 +-
22 2 files changed, 3 insertions(+), 3 deletions(-)
23
24diff --git a/backends/aarch64_initreg.c b/backends/aarch64_initreg.c
25index daf6f37..6445276 100644
26--- a/backends/aarch64_initreg.c
27+++ b/backends/aarch64_initreg.c
28@@ -33,7 +33,7 @@
29 #include "system.h"
30 #include <assert.h>
31 #if defined(__aarch64__) && defined(__linux__)
32-# include <linux/uio.h>
33+# include <sys/uio.h>
34 # include <sys/user.h>
35 # include <sys/ptrace.h>
36 /* Deal with old glibc defining user_pt_regs instead of user_regs_struct. */
37@@ -82,7 +82,7 @@ aarch64_set_initial_registers_tid (pid_t tid __attribute__ ((unused)),
38
39 Dwarf_Word dwarf_fregs[32];
40 for (int r = 0; r < 32; r++)
41- dwarf_fregs[r] = fregs.vregs[r] & 0xFFFFFFFF;
42+ dwarf_fregs[r] = (unsigned int)fregs.vregs[r] & 0xFFFFFFFF;
43
44 if (! setfunc (64, 32, dwarf_fregs, arg))
45 return false;
46diff --git a/backends/arm_initreg.c b/backends/arm_initreg.c
47index efcabaf..062bb9e 100644
48--- a/backends/arm_initreg.c
49+++ b/backends/arm_initreg.c
50@@ -38,7 +38,7 @@
51 #endif
52
53 #ifdef __aarch64__
54-# include <linux/uio.h>
55+# include <sys/uio.h>
56 # include <sys/user.h>
57 # include <sys/ptrace.h>
58 /* Deal with old glibc defining user_pt_regs instead of user_regs_struct. */
diff --git a/meta/recipes-devtools/elfutils/files/ptest.patch b/meta/recipes-devtools/elfutils/files/ptest.patch
index 2152875d63..6b83fa4662 100644
--- a/meta/recipes-devtools/elfutils/files/ptest.patch
+++ b/meta/recipes-devtools/elfutils/files/ptest.patch
@@ -1,4 +1,4 @@
1From d49f6a135762ec1f1831d0e80b8df2a4269b0a66 Mon Sep 17 00:00:00 2001 1From 74dad3295f2b8dc06b7e6bb876bc4541e927ef47 Mon Sep 17 00:00:00 2001
2From: Richard Purdie <richard.purdie@linuxfoundation.org> 2From: Richard Purdie <richard.purdie@linuxfoundation.org>
3Date: Wed, 1 May 2019 16:37:48 +0100 3Date: Wed, 1 May 2019 16:37:48 +0100
4Subject: [PATCH] Changes to allow ptest to run standalone on target: 4Subject: [PATCH] Changes to allow ptest to run standalone on target:
@@ -21,11 +21,11 @@ Upstream-Status: Inappropriate [oe specific]
21 3 files changed, 3 insertions(+), 7 deletions(-) 21 3 files changed, 3 insertions(+), 7 deletions(-)
22 22
23diff --git a/configure.ac b/configure.ac 23diff --git a/configure.ac b/configure.ac
24index bbe8673..488712b 100644 24index 0670e01..14f3e36 100644
25--- a/configure.ac 25--- a/configure.ac
26+++ b/configure.ac 26+++ b/configure.ac
27@@ -49,7 +49,7 @@ AC_COPYRIGHT([Copyright (C) 1996-2024 The elfutils developers.]) 27@@ -43,7 +43,7 @@ AC_COPYRIGHT([Copyright (C) 1996-2025 The elfutils developers.])
28 AC_PREREQ(2.63) dnl Minimum Autoconf version required. 28 AC_PREREQ(2.69) dnl Minimum Autoconf version required.
29 29
30 dnl We use GNU make extensions; automake 1.10 defaults to -Wportability. 30 dnl We use GNU make extensions; automake 1.10 defaults to -Wportability.
31-AM_INIT_AUTOMAKE([gnits 1.11 -Wno-portability dist-bzip2 no-dist-gzip parallel-tests]) 31-AM_INIT_AUTOMAKE([gnits 1.11 -Wno-portability dist-bzip2 no-dist-gzip parallel-tests])
@@ -34,20 +34,20 @@ index bbe8673..488712b 100644
34 34
35 AM_SILENT_RULES([yes]) 35 AM_SILENT_RULES([yes])
36diff --git a/tests/Makefile.am b/tests/Makefile.am 36diff --git a/tests/Makefile.am b/tests/Makefile.am
37index ee49d07..3bd8e58 100644 37index 00ba754..6be7dd6 100644
38--- a/tests/Makefile.am 38--- a/tests/Makefile.am
39+++ b/tests/Makefile.am 39+++ b/tests/Makefile.am
40@@ -852,3 +852,5 @@ check: check-am coverage 40@@ -937,3 +937,5 @@ check: check-am coverage
41 coverage: 41 coverage:
42 -$(srcdir)/coverage.sh 42 -$(srcdir)/coverage.sh
43 endif 43 endif
44+oecheck: 44+oecheck:
45+ $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) 45+ $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS)
46diff --git a/tests/test-subr.sh b/tests/test-subr.sh 46diff --git a/tests/test-subr.sh b/tests/test-subr.sh
47index 411e5f2..a638ff9 100644 47index ea80cbe..7632d20 100644
48--- a/tests/test-subr.sh 48--- a/tests/test-subr.sh
49+++ b/tests/test-subr.sh 49+++ b/tests/test-subr.sh
50@@ -91,12 +91,6 @@ installed_testrun() 50@@ -92,12 +92,6 @@ installed_testrun()
51 program="$1" 51 program="$1"
52 shift 52 shift
53 case "$program" in 53 case "$program" in