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.191.bb (renamed from meta/recipes-devtools/elfutils/elfutils_0.183.bb)96
-rw-r--r--meta/recipes-devtools/elfutils/files/0001-add-support-for-ipkg-to-debuginfod.cxx.patch33
-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.patch19
-rw-r--r--meta/recipes-devtools/elfutils/files/0001-libasm-may-link-with-libbz2-if-found.patch15
-rw-r--r--meta/recipes-devtools/elfutils/files/0001-libelf-elf_end.c-check-data_list.data.d.d_buf-before.patch7
-rw-r--r--meta/recipes-devtools/elfutils/files/0001-skip-the-test-when-gcc-not-deployed.patch5
-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.patch9
-rw-r--r--meta/recipes-devtools/elfutils/files/0002-Fix-elf_cvt_gunhash-if-dest-and-src-are-same.patch9
-rw-r--r--meta/recipes-devtools/elfutils/files/0002-musl-libs.patch118
-rw-r--r--meta/recipes-devtools/elfutils/files/0003-fixheadercheck.patch7
-rw-r--r--meta/recipes-devtools/elfutils/files/0003-musl-utils.patch15
-rw-r--r--meta/recipes-devtools/elfutils/files/0004-Disable-the-test-to-convert-euc-jp.patch42
-rw-r--r--meta/recipes-devtools/elfutils/files/0004-Fix-error-on-musl.patch36
-rw-r--r--meta/recipes-devtools/elfutils/files/0006-Fix-build-on-aarch64-musl.patch3
-rw-r--r--meta/recipes-devtools/elfutils/files/0015-config-eu.am-do-not-use-Werror.patch37
-rw-r--r--meta/recipes-devtools/elfutils/files/ptest.patch11
18 files changed, 172 insertions, 360 deletions
diff --git a/meta/recipes-devtools/elfutils/elfutils_0.183.bb b/meta/recipes-devtools/elfutils/elfutils_0.191.bb
index 16ed7c9ddb..c4d872430b 100644
--- a/meta/recipes-devtools/elfutils/elfutils_0.183.bb
+++ b/meta/recipes-devtools/elfutils/elfutils_0.191.bb
@@ -2,65 +2,76 @@ SUMMARY = "Utilities and libraries for handling compiled object files"
2HOMEPAGE = "https://sourceware.org/elfutils" 2HOMEPAGE = "https://sourceware.org/elfutils"
3DESCRIPTION = "elfutils is a collection of utilities and libraries to read, create and modify ELF binary files, find and handle DWARF debug data, symbols, thread state and stacktraces for processes and core files on GNU/Linux." 3DESCRIPTION = "elfutils is a collection of utilities and libraries to read, create and modify ELF binary files, find and handle DWARF debug data, symbols, thread state and stacktraces for processes and core files on GNU/Linux."
4SECTION = "base" 4SECTION = "base"
5LICENSE = "GPLv2 & GPLv2+ & LGPLv3+ & GPLv3+" 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=27;md5=f8e9d171c401c493ec45a0b2992ea2ed \ 7 file://debuginfod/debuginfod-client.c;endline=28;md5=f0a7c3170776866ee94e8f9225a6ad79 \
8 " 8 "
9DEPENDS = "zlib virtual/libintl" 9DEPENDS = "zlib virtual/libintl"
10DEPENDS_append_libc-musl = " argp-standalone fts musl-obstack " 10DEPENDS:append:libc-musl = " argp-standalone fts musl-legacy-error musl-obstack"
11# The Debian patches below are from: 11# The Debian patches below are from:
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://0001-dso-link-change.patch \ 15 file://0001-dso-link-change.patch \
15 file://0002-Fix-elf_cvt_gunhash-if-dest-and-src-are-same.patch \ 16 file://0002-Fix-elf_cvt_gunhash-if-dest-and-src-are-same.patch \
16 file://0003-fixheadercheck.patch \ 17 file://0003-fixheadercheck.patch \
17 file://0004-Disable-the-test-to-convert-euc-jp.patch \
18 file://0006-Fix-build-on-aarch64-musl.patch \ 18 file://0006-Fix-build-on-aarch64-musl.patch \
19 file://0001-libasm-may-link-with-libbz2-if-found.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 \ 20 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 \ 21 file://0001-skip-the-test-when-gcc-not-deployed.patch \
22 file://run-ptest \
23 file://ptest.patch \ 22 file://ptest.patch \
24 file://0001-tests-Makefile.am-compile-test_nlist-with-standard-C.patch \ 23 file://0001-tests-Makefile.am-compile-test_nlist-with-standard-C.patch \
25 file://0001-add-support-for-ipkg-to-debuginfod.cxx.patch \ 24 file://0001-debuginfod-Remove-unused-variable.patch \
25 file://0001-srcfiles-fix-unused-variable-BUFFER_SIZE.patch \
26 " 26 "
27SRC_URI_append_libc-musl = " \ 27SRC_URI:append:libc-musl = " \
28 file://0002-musl-libs.patch \
29 file://0003-musl-utils.patch \ 28 file://0003-musl-utils.patch \
30 file://0004-Fix-error-on-musl.patch \
31 file://0015-config-eu.am-do-not-use-Werror.patch \
32 " 29 "
33SRC_URI[sha256sum] = "c3637c208d309d58714a51e61e63f1958808fead882e9b607506a29e5474f2c5" 30SRC_URI[sha256sum] = "df76db71366d1d708365fc7a6c60ca48398f14367eb2b8954efc8897147ad871"
34 31
35inherit autotools gettext ptest pkgconfig 32inherit autotools gettext ptest pkgconfig
36 33
37EXTRA_OECONF = "--program-prefix=eu-" 34EXTRA_OECONF = "--program-prefix=eu-"
38 35
36# Only used at runtime for make check but we want deterministic makefiles for ptest so hardcode
37CACHED_CONFIGUREVARS += "ac_cv_prog_HAVE_BUNZIP2=yes"
38
39BUILD_CFLAGS += "-Wno-error=stringop-overflow"
40
39DEPENDS_BZIP2 = "bzip2-replacement-native" 41DEPENDS_BZIP2 = "bzip2-replacement-native"
40DEPENDS_BZIP2_class-target = "bzip2" 42DEPENDS_BZIP2:class-target = "bzip2"
41 43
42PACKAGECONFIG ??= "" 44PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'debuginfod', 'debuginfod libdebuginfod', '', d)} \
45 ${@bb.utils.contains('DISTRO_FEATURES', 'minidebuginfo', 'xz', '', d)} \
46 "
43PACKAGECONFIG[bzip2] = "--with-bzlib,--without-bzlib,${DEPENDS_BZIP2}" 47PACKAGECONFIG[bzip2] = "--with-bzlib,--without-bzlib,${DEPENDS_BZIP2}"
44PACKAGECONFIG[xz] = "--with-lzma,--without-lzma,xz" 48PACKAGECONFIG[xz] = "--with-lzma,--without-lzma,xz"
49PACKAGECONFIG[zstd] = "--with-zstd,--without-zstd,zstd"
45PACKAGECONFIG[libdebuginfod] = "--enable-libdebuginfod,--disable-libdebuginfod,curl" 50PACKAGECONFIG[libdebuginfod] = "--enable-libdebuginfod,--disable-libdebuginfod,curl"
46PACKAGECONFIG[debuginfod] = "--enable-debuginfod,--disable-debuginfod,libarchive sqlite3 libmicrohttpd" 51PACKAGECONFIG[debuginfod] = "--enable-debuginfod,--disable-debuginfod,libarchive sqlite3 libmicrohttpd"
47 52
48RDEPENDS_${PN}-ptest += "libasm libelf bash make coreutils ${PN}-binutils" 53RDEPENDS:${PN}-ptest += "libasm libelf bash make coreutils ${PN}-binutils iproute2-ss bsdtar gcc-symlinks binutils-symlinks libgcc-dev"
54
55EXTRA_OECONF:append:class-target = " --disable-tests-rpath"
49 56
50EXTRA_OECONF_append_class-target = " --disable-tests-rpath" 57# symver functions not currently supported on microblaze
58EXTRA_OECONF:append:class-target:microblaze = " --disable-symbol-versioning"
51 59
52RDEPENDS_${PN}-ptest_append_libc-glibc = " glibc-utils" 60RDEPENDS:${PN}-ptest:append:libc-glibc = " glibc-utils glibc-dbg glibc-dev"
61INSANE_SKIP:${PN}-ptest = "debug-deps dev-deps"
53 62
54do_compile_ptest() { 63do_compile_ptest() {
55 cd ${B}/tests 64 cd ${B}/tests
56 oe_runmake buildtest-TESTS oecheck 65 oe_runmake buildtest-TESTS oecheck
57} 66}
67PTEST_PARALLEL_MAKE = ""
58 68
59do_install_ptest() { 69do_install_ptest() {
60 if [ ${PTEST_ENABLED} = "1" ]; then 70 if [ ${PTEST_ENABLED} = "1" ]; then
61 # copy the files which needed by the cases 71 # copy the files which needed by the cases
62 TEST_FILES="strip strip.o addr2line elfcmp objdump readelf size.o nm.o nm elflint elfcompress elfclassify stack unstrip" 72 TEST_FILES="strip strip.o addr2line elfcmp objdump readelf size.o nm.o nm elflint elfcompress elfclassify stack unstrip srcfiles"
63 install -d -m 755 ${D}${PTEST_PATH}/src 73 install -d -m 755 ${D}${PTEST_PATH}/src
74 install -d -m 755 ${D}${PTEST_PATH}/lib
64 install -d -m 755 ${D}${PTEST_PATH}/libelf 75 install -d -m 755 ${D}${PTEST_PATH}/libelf
65 install -d -m 755 ${D}${PTEST_PATH}/libdw 76 install -d -m 755 ${D}${PTEST_PATH}/libdw
66 install -d -m 755 ${D}${PTEST_PATH}/libdwfl 77 install -d -m 755 ${D}${PTEST_PATH}/libdwfl
@@ -78,6 +89,7 @@ do_install_ptest() {
78 cp ${D}${libdir}/libasm-${PV}.so ${D}${PTEST_PATH}/libasm/libasm.so 89 cp ${D}${libdir}/libasm-${PV}.so ${D}${PTEST_PATH}/libasm/libasm.so
79 cp ${B}/libcpu/libcpu.a ${D}${PTEST_PATH}/libcpu/ 90 cp ${B}/libcpu/libcpu.a ${D}${PTEST_PATH}/libcpu/
80 cp ${B}/libebl/libebl.a ${D}${PTEST_PATH}/libebl/ 91 cp ${B}/libebl/libebl.a ${D}${PTEST_PATH}/libebl/
92 cp ${B}/lib/libeu.a ${D}${PTEST_PATH}/lib/
81 cp ${S}/libelf/*.h ${D}${PTEST_PATH}/libelf/ 93 cp ${S}/libelf/*.h ${D}${PTEST_PATH}/libelf/
82 cp ${S}/libdw/*.h ${D}${PTEST_PATH}/libdw/ 94 cp ${S}/libdw/*.h ${D}${PTEST_PATH}/libdw/
83 cp ${S}/libdwfl/*.h ${D}${PTEST_PATH}/libdwfl/ 95 cp ${S}/libdwfl/*.h ${D}${PTEST_PATH}/libdwfl/
@@ -87,32 +99,32 @@ do_install_ptest() {
87 cp -r ${B}/tests/* ${D}${PTEST_PATH}/tests 99 cp -r ${B}/tests/* ${D}${PTEST_PATH}/tests
88 cp -r ${B}/config.h ${D}${PTEST_PATH} 100 cp -r ${B}/config.h ${D}${PTEST_PATH}
89 cp -r ${B}/backends ${D}${PTEST_PATH} 101 cp -r ${B}/backends ${D}${PTEST_PATH}
102 cp -r ${B}/debuginfod ${D}${PTEST_PATH}
90 sed -i '/^Makefile:/c Makefile:' ${D}${PTEST_PATH}/tests/Makefile 103 sed -i '/^Makefile:/c Makefile:' ${D}${PTEST_PATH}/tests/Makefile
91 find ${D}${PTEST_PATH} -type f -name *.[hoc] | xargs -i rm {} 104 find ${D}${PTEST_PATH} -type f -name *.[hoc] | xargs -i rm {}
92 fi 105 fi
93} 106}
94 107
95EXTRA_OEMAKE_class-native = "" 108EXTRA_OEMAKE:class-native = ""
96EXTRA_OEMAKE_class-nativesdk = "" 109EXTRA_OEMAKE:class-nativesdk = ""
97 110
98BBCLASSEXTEND = "native nativesdk" 111BBCLASSEXTEND = "native nativesdk"
99 112
100# Package utilities separately 113# Package utilities and libraries are listed separately
101PACKAGES =+ "${PN}-binutils libelf libasm libdw libdebuginfod" 114PACKAGES =+ "${PN}-binutils libelf libasm libdw libdebuginfod"
102 115
103# shared libraries are licensed GPLv2 or GPLv3+, binaries GPLv3+ 116# According to the upstream website https://sourceware.org/elfutils, the latest
104# according to NEWS file: 117# license policy is as follows:
105# "The license is now GPLv2/LGPLv3+ for the libraries and GPLv3+ for stand-alone 118# "License. The libraries and backends are dual GPLv2+/LGPLv3+. The utilities
106# programs. There is now also a formal CONTRIBUTING document describing how to 119# are GPLv3+."
107# submit patches." 120LICENSE:${PN}-binutils = "GPL-3.0-or-later"
108LICENSE_${PN}-binutils = "GPLv3+" 121LICENSE:${PN} = "GPL-3.0-or-later"
109LICENSE_${PN} = "GPLv3+" 122LICENSE:libelf = "GPL-2.0-or-later | LGPL-3.0-or-later"
110LICENSE_libelf = "GPLv2 | LGPLv3+" 123LICENSE:libasm = "GPL-2.0-or-later | LGPL-3.0-or-later"
111LICENSE_libasm = "GPLv2 | LGPLv3+" 124LICENSE:libdw = "GPL-2.0-or-later | LGPL-3.0-or-later"
112LICENSE_libdw = "GPLv2 | LGPLv3+" 125LICENSE:libdebuginfod = "GPL-2.0-or-later | LGPL-3.0-or-later"
113LICENSE_libdebuginfod = "GPLv2+ | LGPLv3+" 126
114 127FILES:${PN}-binutils = "\
115FILES_${PN}-binutils = "\
116 ${bindir}/eu-addr2line \ 128 ${bindir}/eu-addr2line \
117 ${bindir}/eu-ld \ 129 ${bindir}/eu-ld \
118 ${bindir}/eu-nm \ 130 ${bindir}/eu-nm \
@@ -120,19 +132,19 @@ FILES_${PN}-binutils = "\
120 ${bindir}/eu-size \ 132 ${bindir}/eu-size \
121 ${bindir}/eu-strip" 133 ${bindir}/eu-strip"
122 134
123FILES_libelf = "${libdir}/libelf-${PV}.so ${libdir}/libelf.so.*" 135FILES:libelf = "${libdir}/libelf-${PV}.so ${libdir}/libelf.so.*"
124FILES_libasm = "${libdir}/libasm-${PV}.so ${libdir}/libasm.so.*" 136FILES:libasm = "${libdir}/libasm-${PV}.so ${libdir}/libasm.so.*"
125FILES_libdw = "${libdir}/libdw-${PV}.so ${libdir}/libdw.so.* ${libdir}/elfutils/lib*" 137FILES:libdw = "${libdir}/libdw-${PV}.so ${libdir}/libdw.so.* ${libdir}/elfutils/lib*"
126FILES_libdebuginfod = "${libdir}/libdebuginfod-${PV}.so ${libdir}/libdebuginfod.so.*" 138FILES:libdebuginfod = "${libdir}/libdebuginfod-${PV}.so ${libdir}/libdebuginfod.so.*"
127# Some packages have the version preceeding the .so instead properly 139# Some packages have the version preceeding the .so instead properly
128# versioned .so.<version>, so we need to reorder and repackage. 140# versioned .so.<version>, so we need to reorder and repackage.
129#FILES_${PN} += "${libdir}/*-${PV}.so ${base_libdir}/*-${PV}.so" 141#FILES:${PN} += "${libdir}/*-${PV}.so ${base_libdir}/*-${PV}.so"
130#FILES_SOLIBSDEV = "${libdir}/libasm.so ${libdir}/libdw.so ${libdir}/libelf.so" 142#FILES_SOLIBSDEV = "${libdir}/libasm.so ${libdir}/libdw.so ${libdir}/libelf.so"
131 143
132# The package contains symlinks that trip up insane 144# The package contains symlinks that trip up insane
133INSANE_SKIP_${MLPREFIX}libdw = "dev-so" 145INSANE_SKIP:${MLPREFIX}libdw = "dev-so"
134# The nlist binary in the tests uses explicitly minimal compiler flags 146# The nlist binary in the tests uses explicitly minimal compiler flags
135INSANE_SKIP_${PN}-ptest += "ldflags" 147INSANE_SKIP:${PN}-ptest += "ldflags"
136 148
137# avoid stripping some generated binaries otherwise some of the tests such as test-nlist, 149# avoid stripping some generated binaries otherwise some of the tests such as test-nlist,
138# run-strip-reloc.sh, run-strip-strmerge.sh and so on will fail 150# run-strip-reloc.sh, run-strip-strmerge.sh and so on will fail
@@ -143,6 +155,7 @@ INHIBIT_PACKAGE_STRIP_FILES = "\
143 ${PKGD}${PTEST_PATH}/tests/backtrace-data \ 155 ${PKGD}${PTEST_PATH}/tests/backtrace-data \
144 ${PKGD}${PTEST_PATH}/tests/backtrace-dwarf \ 156 ${PKGD}${PTEST_PATH}/tests/backtrace-dwarf \
145 ${PKGD}${PTEST_PATH}/tests/deleted \ 157 ${PKGD}${PTEST_PATH}/tests/deleted \
158 ${PKGD}${PTEST_PATH}/tests/dwfllines \
146 ${PKGD}${PTEST_PATH}/src/strip \ 159 ${PKGD}${PTEST_PATH}/src/strip \
147 ${PKGD}${PTEST_PATH}/src/addr2line \ 160 ${PKGD}${PTEST_PATH}/src/addr2line \
148 ${PKGD}${PTEST_PATH}/src/elfcmp \ 161 ${PKGD}${PTEST_PATH}/src/elfcmp \
@@ -153,6 +166,7 @@ INHIBIT_PACKAGE_STRIP_FILES = "\
153 ${PKGD}${PTEST_PATH}/src/elfclassify \ 166 ${PKGD}${PTEST_PATH}/src/elfclassify \
154 ${PKGD}${PTEST_PATH}/src/stack \ 167 ${PKGD}${PTEST_PATH}/src/stack \
155 ${PKGD}${PTEST_PATH}/src/unstrip \ 168 ${PKGD}${PTEST_PATH}/src/unstrip \
169 ${PKGD}${PTEST_PATH}/src/srcfiles \
156 ${PKGD}${PTEST_PATH}/libelf/libelf.so \ 170 ${PKGD}${PTEST_PATH}/libelf/libelf.so \
157 ${PKGD}${PTEST_PATH}/libdw/libdw.so \ 171 ${PKGD}${PTEST_PATH}/libdw/libdw.so \
158 ${PKGD}${PTEST_PATH}/libasm/libasm.so \ 172 ${PKGD}${PTEST_PATH}/libasm/libasm.so \
@@ -160,4 +174,4 @@ INHIBIT_PACKAGE_STRIP_FILES = "\
160 ${PKGD}${PTEST_PATH}/backends/libebl_x86_64.so \ 174 ${PKGD}${PTEST_PATH}/backends/libebl_x86_64.so \
161" 175"
162 176
163PRIVATE_LIBS_${PN}-ptest = "libdw.so.1 libelf.so.1 libasm.so.1" 177PRIVATE_LIBS:${PN}-ptest = "libdw.so.1 libelf.so.1 libasm.so.1 libdebuginfod.so.1"
diff --git a/meta/recipes-devtools/elfutils/files/0001-add-support-for-ipkg-to-debuginfod.cxx.patch b/meta/recipes-devtools/elfutils/files/0001-add-support-for-ipkg-to-debuginfod.cxx.patch
deleted file mode 100644
index 5f82afef0c..0000000000
--- a/meta/recipes-devtools/elfutils/files/0001-add-support-for-ipkg-to-debuginfod.cxx.patch
+++ /dev/null
@@ -1,33 +0,0 @@
1From 571416bf5b5ef319df6d9c79e46680920487e4a7 Mon Sep 17 00:00:00 2001
2From: dorindabassey <dorindabassey@gmail.com>
3Date: Sat, 19 Dec 2020 01:11:46 +0100
4Subject: [PATCH] add support for ipkg to debuginfod.cxx
5
6added support for ipkg to the debuginfod scanner. 0.182 only supports RPM and scan .debs, with this patch, debuginfod scanner would be able to scan .ipk
7
8Upstream-status: Submitted [https://sourceware.org/pipermail/elfutils-devel/2020q4/003357.html]
9
10Signed-off-by: dorindabassey <dorindabassey@gmail.com>
11
12---
13 debuginfod/debuginfod.cxx | 2 ++
14 1 file changed, 2 insertions(+)
15
16diff --git a/debuginfod/debuginfod.cxx b/debuginfod/debuginfod.cxx
17index b34eacc..a8915f2 100644
18--- a/debuginfod/debuginfod.cxx
19+++ b/debuginfod/debuginfod.cxx
20@@ -484,11 +484,13 @@ parse_opt (int key, char *arg,
21 {
22 scan_archives[".deb"]="dpkg-deb --fsys-tarfile";
23 scan_archives[".ddeb"]="dpkg-deb --fsys-tarfile";
24+ scan_archives[".ipk"]="dpkg-deb --fsys-tarfile";
25 }
26 else
27 {
28 scan_archives[".deb"]="(bsdtar -O -x -f - data.tar.xz)<";
29 scan_archives[".ddeb"]="(bsdtar -O -x -f - data.tar.xz)<";
30+ scan_archives[".ipk"]="(bsdtar -O -x -f - data.tar.xz)<";
31 }
32 // .udeb too?
33 break;
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
new file mode 100644
index 0000000000..81f49dbf21
--- /dev/null
+++ b/meta/recipes-devtools/elfutils/files/0001-debuginfod-Remove-unused-variable.patch
@@ -0,0 +1,34 @@
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
index 6acc036406..4f7539bef2 100644
--- a/meta/recipes-devtools/elfutils/files/0001-dso-link-change.patch
+++ b/meta/recipes-devtools/elfutils/files/0001-dso-link-change.patch
@@ -1,4 +1,4 @@
1From c5fb59ac0819b5b6d8244c613cbcf92cb09840c1 Mon Sep 17 00:00:00 2001 1From 63070df4b0dc7af37a720915b5e6494204463c9a 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:10:57 +0800 3Date: Tue, 15 Aug 2017 17:10:57 +0800
4Subject: [PATCH] dso link change 4Subject: [PATCH] dso link change
@@ -16,31 +16,30 @@ more details.
16Rebase to 0.170 16Rebase to 0.170
17 17
18Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> 18Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
19
20--- 19---
21 src/Makefile.am | 2 +- 20 src/Makefile.am | 2 +-
22 tests/Makefile.am | 2 +- 21 tests/Makefile.am | 2 +-
23 2 files changed, 2 insertions(+), 2 deletions(-) 22 2 files changed, 2 insertions(+), 2 deletions(-)
24 23
25diff --git a/src/Makefile.am b/src/Makefile.am 24diff --git a/src/Makefile.am b/src/Makefile.am
26index 88d0ac8..c28d81f 100644 25index 1d592d4..853eda4 100644
27--- a/src/Makefile.am 26--- a/src/Makefile.am
28+++ b/src/Makefile.am 27+++ b/src/Makefile.am
29@@ -45,7 +45,7 @@ libdw = ../libdw/libdw.a -lz $(zip_LIBS) $(libelf) -ldl -lpthread 28@@ -50,7 +50,7 @@ libdebuginfod =
30 libelf = ../libelf/libelf.a -lz 29 endif
31 else 30 else
32 libasm = ../libasm/libasm.so 31 libasm = ../libasm/libasm.so
33-libdw = ../libdw/libdw.so 32-libdw = ../libdw/libdw.so
34+libdw = ../libdw/libdw.so $(zip_LIBS) $(libelf) $(libebl) -ldl 33+libdw = ../libdw/libdw.so $(zip_LIBS) $(libelf) $(libebl) -ldl
35 libelf = ../libelf/libelf.so 34 libelf = ../libelf/libelf.so
36 endif 35 if LIBDEBUGINFOD
37 libebl = ../libebl/libebl.a ../backends/libebl_backends.a ../libcpu/libcpu.a 36 libdebuginfod = ../debuginfod/libdebuginfod.so
38diff --git a/tests/Makefile.am b/tests/Makefile.am 37diff --git a/tests/Makefile.am b/tests/Makefile.am
39index c145720..72afd0e 100644 38index 9141074..ee49d07 100644
40--- a/tests/Makefile.am 39--- a/tests/Makefile.am
41+++ b/tests/Makefile.am 40+++ b/tests/Makefile.am
42@@ -554,7 +554,7 @@ libdw = ../libdw/libdw.a -lz $(zip_LIBS) $(libelf) $(libebl) -ldl -lpthread 41@@ -694,7 +694,7 @@ libdw = ../libdw/libdw.a -lz $(zip_LIBS) $(libelf) $(libebl) -ldl -lpthread
43 libelf = ../libelf/libelf.a -lz 42 libelf = ../libelf/libelf.a -lz $(zstd_LIBS)
44 libasm = ../libasm/libasm.a 43 libasm = ../libasm/libasm.a
45 else 44 else
46-libdw = ../libdw/libdw.so 45-libdw = ../libdw/libdw.so
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
index 09c9d3ea24..a9f5e030fc 100644
--- 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
@@ -1,4 +1,4 @@
1From ed1975deeaa47f98d212fd144c8bda075b1a5d36 Mon Sep 17 00:00:00 2001 1From 46d9d889a07fc9f9f089f800e5c0e895889c44ae Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Wed, 4 Oct 2017 22:30:46 -0700 3Date: Wed, 4 Oct 2017 22:30:46 -0700
4Subject: [PATCH] libasm may link with libbz2 if found 4Subject: [PATCH] libasm may link with libbz2 if found
@@ -11,26 +11,29 @@ where indirect libraries may be not found by linker
11 11
12Upstream-Status: Pending 12Upstream-Status: Pending
13Signed-off-by: Khem Raj <raj.khem@gmail.com> 13Signed-off-by: Khem Raj <raj.khem@gmail.com>
14
15--- 14---
16 src/Makefile.am | 4 ++-- 15 src/Makefile.am | 4 ++--
17 1 file changed, 2 insertions(+), 2 deletions(-) 16 1 file changed, 2 insertions(+), 2 deletions(-)
18 17
19diff --git a/src/Makefile.am b/src/Makefile.am 18diff --git a/src/Makefile.am b/src/Makefile.am
20index c28d81f..951e978 100644 19index 853eda4..da7f3b4 100644
21--- a/src/Makefile.am 20--- a/src/Makefile.am
22+++ b/src/Makefile.am 21+++ b/src/Makefile.am
23@@ -40,11 +40,11 @@ EXTRA_DIST += make-debug-archive.in 22@@ -40,7 +40,7 @@ EXTRA_DIST += make-debug-archive.in
24 CLEANFILES += make-debug-archive 23 CLEANFILES += make-debug-archive
25 24
26 if BUILD_STATIC 25 if BUILD_STATIC
27-libasm = ../libasm/libasm.a 26-libasm = ../libasm/libasm.a
28+libasm = ../libasm/libasm.a $(zip_LIBS) 27+libasm = ../libasm/libasm.a $(zip_LIBS)
29 libdw = ../libdw/libdw.a -lz $(zip_LIBS) $(libelf) -ldl -lpthread 28 libdw = ../libdw/libdw.a -lz $(zip_LIBS) $(libelf) -ldl -lpthread
30 libelf = ../libelf/libelf.a -lz 29 libelf = ../libelf/libelf.a -lz $(zstd_LIBS)
30 if LIBDEBUGINFOD
31@@ -49,7 +49,7 @@ else
32 libdebuginfod =
33 endif
31 else 34 else
32-libasm = ../libasm/libasm.so 35-libasm = ../libasm/libasm.so
33+libasm = ../libasm/libasm.so $(zip_LIBS) 36+libasm = ../libasm/libasm.so $(zip_LIBS)
34 libdw = ../libdw/libdw.so $(zip_LIBS) $(libelf) $(libebl) -ldl 37 libdw = ../libdw/libdw.so $(zip_LIBS) $(libelf) $(libebl) -ldl
35 libelf = ../libelf/libelf.so 38 libelf = ../libelf/libelf.so
36 endif 39 if LIBDEBUGINFOD
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 c8d55d583a..57e4b3890a 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 f40cbd43acdb1fefef4fa53a6034296d83cbff7d Mon Sep 17 00:00:00 2001 1From 19d9e9d838e74e4a0a22f08ae03167380f8aa490 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
@@ -14,16 +14,15 @@ The segmentation fault happens when prelink call elf_end().
14Upstream-Status: Submitted [https://sourceware.org/ml/elfutils-devel/2018-q3/msg00085.html] 14Upstream-Status: Submitted [https://sourceware.org/ml/elfutils-devel/2018-q3/msg00085.html]
15 15
16Signed-off-by: Robert Yang <liezhi.yang@windriver.com> 16Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
17
18--- 17---
19 libelf/elf_end.c | 6 ++++-- 18 libelf/elf_end.c | 6 ++++--
20 1 file changed, 4 insertions(+), 2 deletions(-) 19 1 file changed, 4 insertions(+), 2 deletions(-)
21 20
22diff --git a/libelf/elf_end.c b/libelf/elf_end.c 21diff --git a/libelf/elf_end.c b/libelf/elf_end.c
23index 160f0b8..5280a70 100644 22index 80f4d13..b103959 100644
24--- a/libelf/elf_end.c 23--- a/libelf/elf_end.c
25+++ b/libelf/elf_end.c 24+++ b/libelf/elf_end.c
26@@ -160,14 +160,16 @@ elf_end (Elf *elf) 25@@ -169,14 +169,16 @@ elf_end (Elf *elf)
27 architecture doesn't require overly stringent 26 architecture doesn't require overly stringent
28 alignment the raw data buffer is the same as the 27 alignment the raw data buffer is the same as the
29 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 114ca63cb5..096361e215 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 2fa52d61b1abdf4a3f3b153c771fb2081666430c Mon Sep 17 00:00:00 2001 1From f9ab54454000fd210dbaa92cf516084d05060f9d 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
@@ -6,10 +6,9 @@ Subject: [PATCH] skip the test when gcc not deployed
6Skip the tests which depend on gcc when 6Skip the tests which depend on gcc when
7gcc not deployed. 7gcc not deployed.
8 8
9Upstream-Status: Submitted[https://sourceware.org/ml/elfutils-devel/2019-q2/msg00091.html] 9Upstream-Status: Submitted [https://sourceware.org/ml/elfutils-devel/2019-q2/msg00091.html]
10 10
11Signed-off-by: Mingli Yu <Mingli.Yu@windriver.com> 11Signed-off-by: Mingli Yu <Mingli.Yu@windriver.com>
12
13--- 12---
14 tests/run-disasm-x86-64.sh | 2 ++ 13 tests/run-disasm-x86-64.sh | 2 ++
15 tests/run-disasm-x86.sh | 2 ++ 14 tests/run-disasm-x86.sh | 2 ++
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
new file mode 100644
index 0000000000..b3032327a2
--- /dev/null
+++ b/meta/recipes-devtools/elfutils/files/0001-srcfiles-fix-unused-variable-BUFFER_SIZE.patch
@@ -0,0 +1,36 @@
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 c494d7f2e5..d410eb13d8 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 22e0e1c01ec680a2970f4d5ca9e47f90259cbdcf Mon Sep 17 00:00:00 2001 1From 2d4dfb814dda02193e49c9203147cf73e6d3f8b7 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
@@ -8,16 +8,15 @@ be reproducible.
8 8
9Upstream-Status: Inappropriate [oe-core specific] 9Upstream-Status: Inappropriate [oe-core specific]
10Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> 10Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
11
12--- 11---
13 tests/Makefile.am | 2 +- 12 tests/Makefile.am | 2 +-
14 1 file changed, 1 insertion(+), 1 deletion(-) 13 1 file changed, 1 insertion(+), 1 deletion(-)
15 14
16diff --git a/tests/Makefile.am b/tests/Makefile.am 15diff --git a/tests/Makefile.am b/tests/Makefile.am
17index a2dfd43..40a0228 100644 16index 3bd8e58..370c6a8 100644
18--- a/tests/Makefile.am 17--- a/tests/Makefile.am
19+++ b/tests/Makefile.am 18+++ b/tests/Makefile.am
20@@ -90,7 +90,7 @@ endif 19@@ -103,7 +103,7 @@ endif
21 test-nlist$(EXEEXT): test-nlist.c 20 test-nlist$(EXEEXT): test-nlist.c
22 $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ 21 $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
23 $(AM_CPPFLAGS) $(CPPFLAGS) \ 22 $(AM_CPPFLAGS) $(CPPFLAGS) \
@@ -25,4 +24,4 @@ index a2dfd43..40a0228 100644
25+ $(CFLAGS) $(GCOV_FLAGS) -o $@ $< $(test_nlist_LDADD) 24+ $(CFLAGS) $(GCOV_FLAGS) -o $@ $< $(test_nlist_LDADD)
26 25
27 TESTS = run-arextract.sh run-arsymtest.sh run-ar.sh newfile test-nlist \ 26 TESTS = run-arextract.sh run-arsymtest.sh run-ar.sh newfile test-nlist \
28 update1 update2 update3 update4 \ 27 run-ar-N.sh \
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 be48ef010b..fa2282b8dd 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 1643d793761216252bb654e28aaa5b8eb1536bca Mon Sep 17 00:00:00 2001 1From d8f07a23d608b744dcc0592f9f32f258b186a77c 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.
@@ -12,16 +12,15 @@ Signed-off-by: Baoshan Pang <BaoShan.Pang@windriver.com>
12 12
13Rebase to 0.170 13Rebase to 0.170
14Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> 14Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
15
16--- 15---
17 libelf/gnuhash_xlate.h | 3 ++- 16 libelf/gnuhash_xlate.h | 3 ++-
18 1 file changed, 2 insertions(+), 1 deletion(-) 17 1 file changed, 2 insertions(+), 1 deletion(-)
19 18
20diff --git a/libelf/gnuhash_xlate.h b/libelf/gnuhash_xlate.h 19diff --git a/libelf/gnuhash_xlate.h b/libelf/gnuhash_xlate.h
21index 6faf113..04d9ca1 100644 20index 3a00ae0..40468fc 100644
22--- a/libelf/gnuhash_xlate.h 21--- a/libelf/gnuhash_xlate.h
23+++ b/libelf/gnuhash_xlate.h 22+++ b/libelf/gnuhash_xlate.h
24@@ -40,6 +40,7 @@ elf_cvt_gnuhash (void *dest, const void *src, size_t len, int encode) 23@@ -42,6 +42,7 @@ elf_cvt_gnuhash (void *dest, const void *src, size_t len, int encode)
25 words. We must detangle them here. */ 24 words. We must detangle them here. */
26 Elf32_Word *dest32 = dest; 25 Elf32_Word *dest32 = dest;
27 const Elf32_Word *src32 = src; 26 const Elf32_Word *src32 = src;
@@ -29,7 +28,7 @@ index 6faf113..04d9ca1 100644
29 28
30 /* First four control words, 32 bits. */ 29 /* First four control words, 32 bits. */
31 for (unsigned int cnt = 0; cnt < 4; ++cnt) 30 for (unsigned int cnt = 0; cnt < 4; ++cnt)
32@@ -50,7 +51,7 @@ elf_cvt_gnuhash (void *dest, const void *src, size_t len, int encode) 31@@ -52,7 +53,7 @@ elf_cvt_gnuhash (void *dest, const void *src, size_t len, int encode)
33 len -= 4; 32 len -= 4;
34 } 33 }
35 34
diff --git a/meta/recipes-devtools/elfutils/files/0002-musl-libs.patch b/meta/recipes-devtools/elfutils/files/0002-musl-libs.patch
deleted file mode 100644
index b373940d37..0000000000
--- a/meta/recipes-devtools/elfutils/files/0002-musl-libs.patch
+++ /dev/null
@@ -1,118 +0,0 @@
1From 18c527991deee93170a887b6da622560d5606913 Mon Sep 17 00:00:00 2001
2From: Hongxu Jia <hongxu.jia@windriver.com>
3Date: Fri, 23 Aug 2019 10:18:47 +0800
4Subject: [PATCH] musl-libs
5
6Collection of fixes needed to compile libelf and other libraries
7provided by elfutils for musl targets
8
9error is glibc specific API, so this patch will mostly not accepted
10upstream given that elfutils has been closely tied to glibc
11
12Signed-off-by: Khem Raj <raj.khem@gmail.com>
13Upstream-Status: Inappropriate [workaround for musl]
14
15Rebase to 0.177
16Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
17
18---
19 lib/error.h | 27 +++++++++++++++++++++++++++
20 lib/fixedsizehash.h | 1 -
21 lib/libeu.h | 1 +
22 libdwfl/linux-kernel-modules.c | 1 +
23 libelf/elf.h | 7 +++++++
24 5 files changed, 36 insertions(+), 1 deletion(-)
25 create mode 100644 lib/error.h
26
27diff --git a/lib/error.h b/lib/error.h
28new file mode 100644
29index 0000000..ef06827
30--- /dev/null
31+++ b/lib/error.h
32@@ -0,0 +1,27 @@
33+#ifndef _ERROR_H_
34+#define _ERROR_H_
35+
36+#include <stdarg.h>
37+#include <stdio.h>
38+#include <stdlib.h>
39+#include <string.h>
40+#include <errno.h>
41+
42+static unsigned int error_message_count = 0;
43+
44+static inline void error(int status, int errnum, const char* format, ...)
45+{
46+ va_list ap;
47+ fprintf(stderr, "%s: ", program_invocation_name);
48+ va_start(ap, format);
49+ vfprintf(stderr, format, ap);
50+ va_end(ap);
51+ if (errnum)
52+ fprintf(stderr, ": %s", strerror(errnum));
53+ fprintf(stderr, "\n");
54+ error_message_count++;
55+ if (status)
56+ exit(status);
57+}
58+
59+#endif /* _ERROR_H_ */
60diff --git a/lib/fixedsizehash.h b/lib/fixedsizehash.h
61index dac2a5f..43016fc 100644
62--- a/lib/fixedsizehash.h
63+++ b/lib/fixedsizehash.h
64@@ -30,7 +30,6 @@
65 #include <errno.h>
66 #include <stdlib.h>
67 #include <string.h>
68-#include <sys/cdefs.h>
69
70 #include <system.h>
71
72diff --git a/lib/libeu.h b/lib/libeu.h
73index ecb4d01..edc85e3 100644
74--- a/lib/libeu.h
75+++ b/lib/libeu.h
76@@ -29,6 +29,7 @@
77 #ifndef LIBEU_H
78 #define LIBEU_H
79
80+#include "system.h"
81 #include <stddef.h>
82 #include <stdint.h>
83
84diff --git a/libdwfl/linux-kernel-modules.c b/libdwfl/linux-kernel-modules.c
85index 6edb27f..f331e3c 100644
86--- a/libdwfl/linux-kernel-modules.c
87+++ b/libdwfl/linux-kernel-modules.c
88@@ -50,6 +50,7 @@
89 #include <sys/utsname.h>
90 #include <fcntl.h>
91 #include <unistd.h>
92+#include "system.h"
93
94 /* If fts.h is included before config.h, its indirect inclusions may not
95 give us the right LFS aliases of these functions, so map them manually. */
96diff --git a/libelf/elf.h b/libelf/elf.h
97index 8e3e618..1353890 100644
98--- a/libelf/elf.h
99+++ b/libelf/elf.h
100@@ -19,6 +19,10 @@
101 #ifndef _ELF_H
102 #define _ELF_H 1
103
104+#ifdef __cplusplus
105+extern "C" {
106+#endif
107+
108 /* Standard ELF types. */
109
110 #include <stdint.h>
111@@ -4102,4 +4106,7 @@ enum
112 #define R_ARC_TLS_LE_S9 0x4a
113 #define R_ARC_TLS_LE_32 0x4b
114
115+#ifdef __cplusplus
116+}
117+#endif
118 #endif /* elf.h */
diff --git a/meta/recipes-devtools/elfutils/files/0003-fixheadercheck.patch b/meta/recipes-devtools/elfutils/files/0003-fixheadercheck.patch
index 212b358dc2..e8b986e4ba 100644
--- a/meta/recipes-devtools/elfutils/files/0003-fixheadercheck.patch
+++ b/meta/recipes-devtools/elfutils/files/0003-fixheadercheck.patch
@@ -1,4 +1,4 @@
1From 7e1f91c42ef5b0bf10afefec10dd08588df3ab1f Mon Sep 17 00:00:00 2001 1From 614f062b22e6da108643f8644a3e92a1108f2b9b 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
@@ -16,16 +16,15 @@ Upstream-Status: Pending
16 16
17Rebase to 0.170 17Rebase to 0.170
18Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> 18Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
19
20--- 19---
21 libelf/elf32_updatenull.c | 4 ++-- 20 libelf/elf32_updatenull.c | 4 ++--
22 1 file changed, 2 insertions(+), 2 deletions(-) 21 1 file changed, 2 insertions(+), 2 deletions(-)
23 22
24diff --git a/libelf/elf32_updatenull.c b/libelf/elf32_updatenull.c 23diff --git a/libelf/elf32_updatenull.c b/libelf/elf32_updatenull.c
25index d0d4d1e..4ecf5a5 100644 24index 3594e8b..a3314e5 100644
26--- a/libelf/elf32_updatenull.c 25--- a/libelf/elf32_updatenull.c
27+++ b/libelf/elf32_updatenull.c 26+++ b/libelf/elf32_updatenull.c
28@@ -354,8 +354,8 @@ __elfw2(LIBELFBITS,updatenull_wrlock) (Elf *elf, int *change_bop, size_t shnum) 27@@ -355,8 +355,8 @@ __elfw2(LIBELFBITS,updatenull_wrlock) (Elf *elf, int *change_bop, size_t shnum)
29 we test for the alignment of the section being large 28 we test for the alignment of the section being large
30 enough for the largest alignment required by a data 29 enough for the largest alignment required by a data
31 block. */ 30 block. */
diff --git a/meta/recipes-devtools/elfutils/files/0003-musl-utils.patch b/meta/recipes-devtools/elfutils/files/0003-musl-utils.patch
index 65593be32f..230ea88f41 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 2dab1a02a3cfd80629f3e0f380805a5e58dd0ac3 Mon Sep 17 00:00:00 2001 1From aab5985a29bd7ab6e0b06eaab190b42a04e10f70 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
@@ -13,7 +13,6 @@ Upstream-Status: Inappropriate [workaround for musl]
13 13
14Rebase to 0.177 14Rebase to 0.177
15Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> 15Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
16
17--- 16---
18 src/arlib.h | 6 ++++++ 17 src/arlib.h | 6 ++++++
19 src/elfcompress.c | 7 +++++++ 18 src/elfcompress.c | 7 +++++++
@@ -22,7 +21,7 @@ Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
22 4 files changed, 29 insertions(+) 21 4 files changed, 29 insertions(+)
23 22
24diff --git a/src/arlib.h b/src/arlib.h 23diff --git a/src/arlib.h b/src/arlib.h
25index e117166..8326f6c 100644 24index d4a4221..f6336d9 100644
26--- a/src/arlib.h 25--- a/src/arlib.h
27+++ b/src/arlib.h 26+++ b/src/arlib.h
28@@ -29,6 +29,12 @@ 27@@ -29,6 +29,12 @@
@@ -39,7 +38,7 @@ index e117166..8326f6c 100644
39 /* State of -D/-U flags. */ 38 /* State of -D/-U flags. */
40 extern bool arlib_deterministic_output; 39 extern bool arlib_deterministic_output;
41diff --git a/src/elfcompress.c b/src/elfcompress.c 40diff --git a/src/elfcompress.c b/src/elfcompress.c
42index 1b5b1e3..21c9024 100644 41index f771b92..263de62 100644
43--- a/src/elfcompress.c 42--- a/src/elfcompress.c
44+++ b/src/elfcompress.c 43+++ b/src/elfcompress.c
45@@ -37,6 +37,13 @@ 44@@ -37,6 +37,13 @@
@@ -57,10 +56,10 @@ index 1b5b1e3..21c9024 100644
57 ARGP_PROGRAM_VERSION_HOOK_DEF = print_version; 56 ARGP_PROGRAM_VERSION_HOOK_DEF = print_version;
58 57
59diff --git a/src/strip.c b/src/strip.c 58diff --git a/src/strip.c b/src/strip.c
60index 7a5d4e4..81a0d57 100644 59index 6436443..1608496 100644
61--- a/src/strip.c 60--- a/src/strip.c
62+++ b/src/strip.c 61+++ b/src/strip.c
63@@ -46,6 +46,13 @@ 62@@ -45,6 +45,13 @@
64 #include <system.h> 63 #include <system.h>
65 #include <printversion.h> 64 #include <printversion.h>
66 65
@@ -75,10 +74,10 @@ index 7a5d4e4..81a0d57 100644
75 74
76 /* Name and version of program. */ 75 /* Name and version of program. */
77diff --git a/src/unstrip.c b/src/unstrip.c 76diff --git a/src/unstrip.c b/src/unstrip.c
78index 8580329..d547487 100644 77index d70053d..b8a6ff3 100644
79--- a/src/unstrip.c 78--- a/src/unstrip.c
80+++ b/src/unstrip.c 79+++ b/src/unstrip.c
81@@ -52,6 +52,15 @@ 80@@ -51,6 +51,15 @@
82 #include "libeu.h" 81 #include "libeu.h"
83 #include "printversion.h" 82 #include "printversion.h"
84 83
diff --git a/meta/recipes-devtools/elfutils/files/0004-Disable-the-test-to-convert-euc-jp.patch b/meta/recipes-devtools/elfutils/files/0004-Disable-the-test-to-convert-euc-jp.patch
deleted file mode 100644
index f407bdd0be..0000000000
--- a/meta/recipes-devtools/elfutils/files/0004-Disable-the-test-to-convert-euc-jp.patch
+++ /dev/null
@@ -1,42 +0,0 @@
1From cd36f34c722dd0babd7beb13c968aa0780c9f726 Mon Sep 17 00:00:00 2001
2From: Hongxu Jia <hongxu.jia@windriver.com>
3Date: Tue, 15 Aug 2017 17:24:06 +0800
4Subject: [PATCH] Disable the test to convert euc-jp
5
6Remove the test "Test against HP-UX 11.11 bug:
7No converter from EUC-JP to UTF-8 is provided"
8since we don't support HP-UX and if the euc-jp is not
9installed on the host, the dependence will be built without
10iconv support and will cause guild-native building fail.
11
12Upstream-Status: Inappropriate [OE specific]
13
14Signed-off-by: Roy Li <rongqing.li@windriver.com>
15
16Rebase to 0.170
17Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
18
19---
20 m4/iconv.m4 | 2 ++
21 1 file changed, 2 insertions(+)
22
23diff --git a/m4/iconv.m4 b/m4/iconv.m4
24index aa159c5..d16312b 100644
25--- a/m4/iconv.m4
26+++ b/m4/iconv.m4
27@@ -165,6 +165,7 @@ AC_DEFUN([AM_ICONV_LINK],
28 }
29 }
30 #endif
31+#if 0
32 /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is
33 provided. */
34 if (/* Try standardized names. */
35@@ -176,6 +177,7 @@ AC_DEFUN([AM_ICONV_LINK],
36 /* Try HP-UX names. */
37 && iconv_open ("utf8", "eucJP") == (iconv_t)(-1))
38 result |= 16;
39+#endif
40 return result;
41 ]])],
42 [am_cv_func_iconv_works=yes], ,
diff --git a/meta/recipes-devtools/elfutils/files/0004-Fix-error-on-musl.patch b/meta/recipes-devtools/elfutils/files/0004-Fix-error-on-musl.patch
deleted file mode 100644
index 8e1e97041f..0000000000
--- a/meta/recipes-devtools/elfutils/files/0004-Fix-error-on-musl.patch
+++ /dev/null
@@ -1,36 +0,0 @@
1From ce3b1403bd88261b5461a9dcb7d6d6be9185703e Mon Sep 17 00:00:00 2001
2From: Richard Purdie <richard.purdie@linuxfoundation.org>
3Date: Wed, 1 May 2019 22:15:03 +0100
4Subject: [PATCH] Fix error on musl:
5
6| ../../elfutils-0.176/tests/elfstrmerge.c: In function 'main':
7| ../../elfutils-0.176/tests/elfstrmerge.c:370:60: error: 'ALLPERMS' undeclared (first use in this function); did you mean 'EPERM'?
8| fdnew = open (fnew, O_WRONLY | O_CREAT, st.st_mode & ALLPERMS);
9| ^~~~~~~~
10| EPERM
11| ../../elfutils-0.176/tests/elfstrmerge.c:370:60: note: each undeclared identifier is reported only once for each function it appears in
12
13Upstream-Status: Inappropriate [workaround in musl]
14
15Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
16
17---
18 tests/elfstrmerge.c | 5 +++++
19 1 file changed, 5 insertions(+)
20
21diff --git a/tests/elfstrmerge.c b/tests/elfstrmerge.c
22index abbdf3f..bd90f4d 100644
23--- a/tests/elfstrmerge.c
24+++ b/tests/elfstrmerge.c
25@@ -33,6 +33,11 @@
26 #include ELFUTILS_HEADER(dwelf)
27 #include "elf-knowledge.h"
28
29+/* for musl */
30+#ifndef ALLPERMS
31+# define ALLPERMS (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO)/* 07777 */
32+#endif
33+
34 /* The original ELF file. */
35 static int fd = -1;
36 static Elf *elf = NULL;
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
index 8942ad7828..149e0e6a7b 100644
--- 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
@@ -1,4 +1,4 @@
1From 2396fd67d81e54e18fbad67a5ff67d5684a01013 Mon Sep 17 00:00:00 2001 1From 4409f128c81a9d76b9360b002a1d76043c77b53e 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:27:30 +0800 3Date: Tue, 15 Aug 2017 17:27:30 +0800
4Subject: [PATCH] Fix build on aarch64/musl 4Subject: [PATCH] Fix build on aarch64/musl
@@ -16,7 +16,6 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
16 16
17Rebase to 0.170 17Rebase to 0.170
18Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> 18Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
19
20--- 19---
21 backends/aarch64_initreg.c | 4 ++-- 20 backends/aarch64_initreg.c | 4 ++--
22 backends/arm_initreg.c | 2 +- 21 backends/arm_initreg.c | 2 +-
diff --git a/meta/recipes-devtools/elfutils/files/0015-config-eu.am-do-not-use-Werror.patch b/meta/recipes-devtools/elfutils/files/0015-config-eu.am-do-not-use-Werror.patch
deleted file mode 100644
index 205362626d..0000000000
--- a/meta/recipes-devtools/elfutils/files/0015-config-eu.am-do-not-use-Werror.patch
+++ /dev/null
@@ -1,37 +0,0 @@
1From dfe11e043cd8ea0b0f0252bcff9f5a6b98c0ecd3 Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex.kanavin@gmail.com>
3Date: Mon, 22 Jun 2020 21:35:16 +0000
4Subject: [PATCH] config/eu.am: do not use -Werror
5
6Due to re-definition of error() on musl, gcc starts throwing
7errors where none happen with glibc. Since upstream is not
8likely to be interested in musl builds, lets just disable
9Werror.
10
11Upstream-Status: Inappropriate [oe core specific]
12Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
13
14---
15 config/eu.am | 2 --
16 1 file changed, 2 deletions(-)
17
18diff --git a/config/eu.am b/config/eu.am
19index 6c3c444..3bc0dc9 100644
20--- a/config/eu.am
21+++ b/config/eu.am
22@@ -73,7 +73,6 @@ AM_CFLAGS = -std=gnu99 -Wall -Wshadow -Wformat=2 \
23 -Wold-style-definition -Wstrict-prototypes -Wtrampolines \
24 $(LOGICAL_OP_WARNING) $(DUPLICATED_COND_WARNING) \
25 $(NULL_DEREFERENCE_WARNING) $(IMPLICIT_FALLTHROUGH_WARNING) \
26- $(if $($(*F)_no_Werror),,-Werror) \
27 $(if $($(*F)_no_Wunused),,-Wunused -Wextra) \
28 $(if $($(*F)_no_Wstack_usage),,$(STACK_USAGE_WARNING)) \
29 $(if $($(*F)_no_Wpacked_not_aligned),-Wno-packed-not-aligned,) \
30@@ -83,7 +82,6 @@ AM_CXXFLAGS = -std=c++11 -Wall -Wshadow \
31 -Wtrampolines \
32 $(LOGICAL_OP_WARNING) $(DUPLICATED_COND_WARNING) \
33 $(NULL_DEREFERENCE_WARNING) $(IMPLICIT_FALLTHROUGH_WARNING) \
34- $(if $($(*F)_no_Werror),,-Werror) \
35 $(if $($(*F)_no_Wunused),,-Wunused -Wextra) \
36 $(if $($(*F)_no_Wstack_usage),,$(STACK_USAGE_WARNING)) \
37 $(if $($(*F)_no_Wpacked_not_aligned),-Wno-packed-not-aligned,) \
diff --git a/meta/recipes-devtools/elfutils/files/ptest.patch b/meta/recipes-devtools/elfutils/files/ptest.patch
index fe6f272a83..2152875d63 100644
--- a/meta/recipes-devtools/elfutils/files/ptest.patch
+++ b/meta/recipes-devtools/elfutils/files/ptest.patch
@@ -1,4 +1,4 @@
1From bfbf393e7d5b1b41df85ce1c37e887776c45d529 Mon Sep 17 00:00:00 2001 1From d49f6a135762ec1f1831d0e80b8df2a4269b0a66 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:
@@ -14,7 +14,6 @@ d) Add an oecheck make target which we can use to build the test binaries we nee
14Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> 14Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
15 15
16Upstream-Status: Inappropriate [oe specific] 16Upstream-Status: Inappropriate [oe specific]
17
18--- 17---
19 configure.ac | 2 +- 18 configure.ac | 2 +-
20 tests/Makefile.am | 2 ++ 19 tests/Makefile.am | 2 ++
@@ -22,10 +21,10 @@ Upstream-Status: Inappropriate [oe specific]
22 3 files changed, 3 insertions(+), 7 deletions(-) 21 3 files changed, 3 insertions(+), 7 deletions(-)
23 22
24diff --git a/configure.ac b/configure.ac 23diff --git a/configure.ac b/configure.ac
25index d345495..67933d1 100644 24index bbe8673..488712b 100644
26--- a/configure.ac 25--- a/configure.ac
27+++ b/configure.ac 26+++ b/configure.ac
28@@ -48,7 +48,7 @@ AC_COPYRIGHT([Copyright (C) 1996-2021 The elfutils developers.]) 27@@ -49,7 +49,7 @@ AC_COPYRIGHT([Copyright (C) 1996-2024 The elfutils developers.])
29 AC_PREREQ(2.63) dnl Minimum Autoconf version required. 28 AC_PREREQ(2.63) dnl Minimum Autoconf version required.
30 29
31 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.
@@ -35,10 +34,10 @@ index d345495..67933d1 100644
35 34
36 AM_SILENT_RULES([yes]) 35 AM_SILENT_RULES([yes])
37diff --git a/tests/Makefile.am b/tests/Makefile.am 36diff --git a/tests/Makefile.am b/tests/Makefile.am
38index 72afd0e..a2dfd43 100644 37index ee49d07..3bd8e58 100644
39--- a/tests/Makefile.am 38--- a/tests/Makefile.am
40+++ b/tests/Makefile.am 39+++ b/tests/Makefile.am
41@@ -698,3 +698,5 @@ check: check-am coverage 40@@ -852,3 +852,5 @@ check: check-am coverage
42 coverage: 41 coverage:
43 -$(srcdir)/coverage.sh 42 -$(srcdir)/coverage.sh
44 endif 43 endif