summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/elfutils/elfutils_0.193.bb
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/elfutils/elfutils_0.193.bb')
-rw-r--r--meta/recipes-devtools/elfutils/elfutils_0.193.bb175
1 files changed, 175 insertions, 0 deletions
diff --git a/meta/recipes-devtools/elfutils/elfutils_0.193.bb b/meta/recipes-devtools/elfutils/elfutils_0.193.bb
new file mode 100644
index 0000000000..4ccea2bea3
--- /dev/null
+++ b/meta/recipes-devtools/elfutils/elfutils_0.193.bb
@@ -0,0 +1,175 @@
1SUMMARY = "Utilities and libraries for handling compiled object files"
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."
4SECTION = "base"
5LICENSE = "( GPL-2.0-or-later | LGPL-3.0-or-later ) & GPL-3.0-or-later"
6LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
7 file://debuginfod/debuginfod-client.c;endline=28;md5=6b7b0a4b25197d7f2e12b2f4aa1c86b8 \
8 "
9DEPENDS = "zlib virtual/libintl"
10DEPENDS:append:libc-musl = " argp-standalone fts musl-legacy-error musl-obstack"
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
13SRC_URI = "https://sourceware.org/elfutils/ftp/${PV}/${BP}.tar.bz2 \
14 file://run-ptest \
15 file://0002-Fix-elf_cvt_gunhash-if-dest-and-src-are-same.patch \
16 file://0003-fixheadercheck.patch \
17 file://0001-libelf-elf_end.c-check-data_list.data.d.d_buf-before.patch \
18 file://0001-skip-the-test-when-gcc-not-deployed.patch \
19 file://ptest.patch \
20 file://0001-tests-Makefile.am-compile-test_nlist-with-standard-C.patch \
21 file://0001-config-eu.am-do-not-force-Werror.patch \
22 file://0001-libelf-Add-libeu-objects-to-libelf.a-static-archive.patch \
23 "
24SRC_URI:append:libc-musl = " \
25 file://0003-musl-utils.patch \
26 "
27SRC_URI[sha256sum] = "7857f44b624f4d8d421df851aaae7b1402cfe6bcdd2d8049f15fc07d3dde7635"
28
29inherit autotools gettext ptest pkgconfig
30
31EXTRA_OECONF = "--program-prefix=eu-"
32
33# Only used at runtime for make check but we want deterministic makefiles for ptest so hardcode
34CACHED_CONFIGUREVARS += "ac_cv_prog_HAVE_BUNZIP2=yes"
35
36BUILD_CFLAGS += "-Wno-error=stringop-overflow"
37
38DEPENDS_BZIP2 = "bzip2-replacement-native"
39DEPENDS_BZIP2:class-target = "bzip2"
40
41PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'debuginfod', 'debuginfod libdebuginfod', '', d)} \
42 ${@bb.utils.contains('DISTRO_FEATURES', 'minidebuginfo', 'xz', '', d)} \
43 "
44PACKAGECONFIG[bzip2] = "--with-bzlib,--without-bzlib,${DEPENDS_BZIP2}"
45PACKAGECONFIG[xz] = "--with-lzma,--without-lzma,xz"
46PACKAGECONFIG[zstd] = "--with-zstd,--without-zstd,zstd"
47PACKAGECONFIG[libdebuginfod] = "--enable-libdebuginfod,--disable-libdebuginfod,curl json-c"
48PACKAGECONFIG[debuginfod] = "--enable-debuginfod,--disable-debuginfod,libarchive sqlite3 libmicrohttpd"
49
50RDEPENDS:${PN}-ptest += "libasm libelf bash make coreutils ${PN}-binutils iproute2-ss bsdtar gcc-symlinks binutils-symlinks libgcc-dev"
51
52EXTRA_OECONF:append:class-target = " --disable-tests-rpath"
53
54# symver functions not currently supported on microblaze
55EXTRA_OECONF:append:class-target:microblaze = " --disable-symbol-versioning"
56
57RDEPENDS:${PN}-ptest:append:libc-glibc = " glibc-utils glibc-dbg glibc-dev"
58INSANE_SKIP:${PN}-ptest = "debug-deps dev-deps"
59
60do_compile_ptest() {
61 cd ${B}/tests
62 oe_runmake buildtest-TESTS oecheck
63}
64PTEST_PARALLEL_MAKE = ""
65
66do_install_ptest() {
67 # 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"
69 install -d -m 755 ${D}${PTEST_PATH}/src
70 install -d -m 755 ${D}${PTEST_PATH}/config
71 install -d -m 755 ${D}${PTEST_PATH}/lib
72 install -d -m 755 ${D}${PTEST_PATH}/libelf
73 install -d -m 755 ${D}${PTEST_PATH}/libdw
74 install -d -m 755 ${D}${PTEST_PATH}/libdwfl
75 install -d -m 755 ${D}${PTEST_PATH}/libdwelf
76 install -d -m 755 ${D}${PTEST_PATH}/libasm
77 install -d -m 755 ${D}${PTEST_PATH}/libcpu
78 install -d -m 755 ${D}${PTEST_PATH}/libebl
79 for test_file in ${TEST_FILES}; do
80 if [ -f ${B}/src/${test_file} ]; then
81 cp -r ${B}/src/${test_file} ${D}${PTEST_PATH}/src
82 fi
83 done
84 cp ${D}${libdir}/libelf-${PV}.so ${D}${PTEST_PATH}/libelf/libelf.so
85 cp ${D}${libdir}/libdw-${PV}.so ${D}${PTEST_PATH}/libdw/libdw.so
86 cp ${D}${libdir}/libasm-${PV}.so ${D}${PTEST_PATH}/libasm/libasm.so
87 cp ${B}/libcpu/libcpu.a ${D}${PTEST_PATH}/libcpu/
88 cp ${B}/libebl/libebl.a ${D}${PTEST_PATH}/libebl/
89 cp ${B}/lib/libeu.a ${D}${PTEST_PATH}/lib/
90 cp ${S}/libelf/*.h ${D}${PTEST_PATH}/libelf/
91 cp ${S}/libdw/*.h ${D}${PTEST_PATH}/libdw/
92 cp ${S}/libdwfl/*.h ${D}${PTEST_PATH}/libdwfl/
93 cp ${S}/libdwelf/*.h ${D}${PTEST_PATH}/libdwelf/
94 cp ${S}/libasm/*.h ${D}${PTEST_PATH}/libasm/
95 cp -r ${S}/tests/ ${D}${PTEST_PATH}
96 cp -r ${B}/tests/* ${D}${PTEST_PATH}/tests
97 cp -r ${B}/config.h ${D}${PTEST_PATH}
98 cp -r ${B}/config/profile.sh ${D}${PTEST_PATH}/config
99 cp -r ${B}/backends ${D}${PTEST_PATH}
100 cp -r ${B}/debuginfod ${D}${PTEST_PATH}
101 sed -i '/^Makefile:/c Makefile:' ${D}${PTEST_PATH}/tests/Makefile
102 find ${D}${PTEST_PATH} -type f -name *.[hoc] | xargs -i rm {}
103}
104
105EXTRA_OEMAKE:class-native = ""
106EXTRA_OEMAKE:class-nativesdk = ""
107
108BBCLASSEXTEND = "native nativesdk"
109
110# Package utilities and libraries are listed separately
111PACKAGES =+ "${PN}-binutils libelf libasm libdw libdebuginfod"
112
113# According to the upstream website https://sourceware.org/elfutils, the latest
114# license policy is as follows:
115# "License. The libraries and backends are dual GPLv2+/LGPLv3+. The utilities
116# are GPLv3+."
117LICENSE:${PN}-binutils = "GPL-3.0-or-later"
118LICENSE:${PN} = "GPL-3.0-or-later"
119LICENSE:libelf = "GPL-2.0-or-later | LGPL-3.0-or-later"
120LICENSE:libasm = "GPL-2.0-or-later | LGPL-3.0-or-later"
121LICENSE:libdw = "GPL-2.0-or-later | LGPL-3.0-or-later"
122LICENSE:libdebuginfod = "GPL-2.0-or-later | LGPL-3.0-or-later"
123
124FILES:${PN} += "${datadir}/fish"
125FILES:${PN}-binutils = "\
126 ${bindir}/eu-addr2line \
127 ${bindir}/eu-ld \
128 ${bindir}/eu-nm \
129 ${bindir}/eu-readelf \
130 ${bindir}/eu-size \
131 ${bindir}/eu-strip"
132
133FILES:libelf = "${libdir}/libelf-${PV}.so ${libdir}/libelf.so.*"
134FILES:libasm = "${libdir}/libasm-${PV}.so ${libdir}/libasm.so.*"
135FILES:libdw = "${libdir}/libdw-${PV}.so ${libdir}/libdw.so.* ${libdir}/elfutils/lib*"
136FILES:libdebuginfod = "${libdir}/libdebuginfod-${PV}.so ${libdir}/libdebuginfod.so.*"
137# Some packages have the version preceeding the .so instead properly
138# versioned .so.<version>, so we need to reorder and repackage.
139#FILES:${PN} += "${libdir}/*-${PV}.so ${base_libdir}/*-${PV}.so"
140#FILES_SOLIBSDEV = "${libdir}/libasm.so ${libdir}/libdw.so ${libdir}/libelf.so"
141
142# The package contains symlinks that trip up insane
143INSANE_SKIP:${MLPREFIX}libdw = "dev-so"
144# The nlist binary in the tests uses explicitly minimal compiler flags
145INSANE_SKIP:${PN}-ptest += "ldflags"
146
147# avoid stripping some generated binaries otherwise some of the tests such as test-nlist,
148# run-strip-reloc.sh, run-strip-strmerge.sh and so on will fail
149INHIBIT_PACKAGE_STRIP_FILES = "\
150 ${PKGD}${PTEST_PATH}/tests/test-nlist \
151 ${PKGD}${PTEST_PATH}/tests/elfstrmerge \
152 ${PKGD}${PTEST_PATH}/tests/backtrace-child \
153 ${PKGD}${PTEST_PATH}/tests/backtrace-data \
154 ${PKGD}${PTEST_PATH}/tests/backtrace-dwarf \
155 ${PKGD}${PTEST_PATH}/tests/deleted \
156 ${PKGD}${PTEST_PATH}/tests/dwfllines \
157 ${PKGD}${PTEST_PATH}/src/strip \
158 ${PKGD}${PTEST_PATH}/src/addr2line \
159 ${PKGD}${PTEST_PATH}/src/elfcmp \
160 ${PKGD}${PTEST_PATH}/src/objdump \
161 ${PKGD}${PTEST_PATH}/src/readelf \
162 ${PKGD}${PTEST_PATH}/src/nm \
163 ${PKGD}${PTEST_PATH}/src/elflint \
164 ${PKGD}${PTEST_PATH}/src/elfclassify \
165 ${PKGD}${PTEST_PATH}/src/stack \
166 ${PKGD}${PTEST_PATH}/src/unstrip \
167 ${PKGD}${PTEST_PATH}/src/srcfiles \
168 ${PKGD}${PTEST_PATH}/libelf/libelf.so \
169 ${PKGD}${PTEST_PATH}/libdw/libdw.so \
170 ${PKGD}${PTEST_PATH}/libasm/libasm.so \
171 ${PKGD}${PTEST_PATH}/backends/libebl_i386.so \
172 ${PKGD}${PTEST_PATH}/backends/libebl_x86_64.so \
173"
174
175PRIVATE_LIBS:${PN}-ptest = "libdw.so.1 libelf.so.1 libasm.so.1 libdebuginfod.so.1"