Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 1 | SUMMARY = "Utilities and libraries for handling compiled object files" |
| 2 | HOMEPAGE = "https://sourceware.org/elfutils" |
Andrew Geissler | 90fd73c | 2021-03-05 15:25:55 -0600 | [diff] [blame] | 3 | DESCRIPTION = "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." |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 4 | SECTION = "base" |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 5 | LICENSE = "GPLv2 & GPLv2+ & LGPLv3+ & GPLv3+" |
| 6 | LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \ |
| 7 | file://debuginfod/debuginfod-client.c;endline=27;md5=f8e9d171c401c493ec45a0b2992ea2ed \ |
| 8 | " |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 9 | DEPENDS = "zlib virtual/libintl" |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 10 | DEPENDS:append:libc-musl = " argp-standalone fts musl-obstack " |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 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 |
| 13 | SRC_URI = "https://sourceware.org/elfutils/ftp/${PV}/${BP}.tar.bz2 \ |
| 14 | file://0001-dso-link-change.patch \ |
| 15 | file://0002-Fix-elf_cvt_gunhash-if-dest-and-src-are-same.patch \ |
| 16 | file://0003-fixheadercheck.patch \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 17 | file://0006-Fix-build-on-aarch64-musl.patch \ |
| 18 | file://0001-libasm-may-link-with-libbz2-if-found.patch \ |
| 19 | file://0001-libelf-elf_end.c-check-data_list.data.d.d_buf-before.patch \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 20 | file://0001-skip-the-test-when-gcc-not-deployed.patch \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 21 | file://run-ptest \ |
| 22 | file://ptest.patch \ |
Andrew Geissler | 475cb72 | 2020-07-10 16:00:51 -0500 | [diff] [blame] | 23 | file://0001-tests-Makefile.am-compile-test_nlist-with-standard-C.patch \ |
Andrew Geissler | c926e17 | 2021-05-07 16:11:35 -0500 | [diff] [blame] | 24 | file://0001-debuginfod-debuginfod-client.c-correct-string-format.patch \ |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 25 | file://glibc-2.34-fix.patch \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 26 | " |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 27 | SRC_URI:append:libc-musl = " \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 28 | file://0002-musl-libs.patch \ |
| 29 | file://0003-musl-utils.patch \ |
| 30 | file://0004-Fix-error-on-musl.patch \ |
Andrew Geissler | 475cb72 | 2020-07-10 16:00:51 -0500 | [diff] [blame] | 31 | file://0015-config-eu.am-do-not-use-Werror.patch \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 32 | " |
Andrew Geissler | 0903674 | 2021-06-25 14:25:14 -0500 | [diff] [blame] | 33 | SRC_URI[sha256sum] = "dc8d3e74ab209465e7f568e1b3bb9a5a142f8656e2b57d10049a73da2ae6b5a6" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 34 | |
Andrew Geissler | d159c7f | 2021-09-02 21:05:58 -0500 | [diff] [blame] | 35 | # remove at next version upgrade or when output changes |
| 36 | PR = "r1" |
Andrew Geissler | d159c7f | 2021-09-02 21:05:58 -0500 | [diff] [blame] | 37 | |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 38 | inherit autotools gettext ptest pkgconfig |
| 39 | |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 40 | EXTRA_OECONF = "--program-prefix=eu-" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 41 | |
| 42 | DEPENDS_BZIP2 = "bzip2-replacement-native" |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 43 | DEPENDS_BZIP2:class-target = "bzip2" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 44 | |
Andrew Geissler | c926e17 | 2021-05-07 16:11:35 -0500 | [diff] [blame] | 45 | PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'debuginfod', 'debuginfod libdebuginfod', '', d)}" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 46 | PACKAGECONFIG[bzip2] = "--with-bzlib,--without-bzlib,${DEPENDS_BZIP2}" |
| 47 | PACKAGECONFIG[xz] = "--with-lzma,--without-lzma,xz" |
Andrew Geissler | d159c7f | 2021-09-02 21:05:58 -0500 | [diff] [blame] | 48 | PACKAGECONFIG[zstd] = "--with-zstd,--without-zstd,zstd" |
Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 49 | PACKAGECONFIG[libdebuginfod] = "--enable-libdebuginfod,--disable-libdebuginfod,curl" |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 50 | PACKAGECONFIG[debuginfod] = "--enable-debuginfod,--disable-debuginfod,libarchive sqlite3 libmicrohttpd" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 51 | |
Andrew Geissler | d159c7f | 2021-09-02 21:05:58 -0500 | [diff] [blame] | 52 | RDEPENDS:${PN}-ptest += "libasm libelf bash make coreutils ${PN}-binutils iproute2-ss bsdtar gcc-symlinks binutils-symlinks libgcc-dev" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 53 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 54 | EXTRA_OECONF:append:class-target = " --disable-tests-rpath" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 55 | |
Andrew Geissler | d159c7f | 2021-09-02 21:05:58 -0500 | [diff] [blame] | 56 | RDEPENDS:${PN}-ptest:append:libc-glibc = " glibc-utils glibc-dbg glibc-dev" |
| 57 | INSANE_SKIP:${PN}-ptest = "debug-deps dev-deps" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 58 | |
| 59 | do_compile_ptest() { |
| 60 | cd ${B}/tests |
| 61 | oe_runmake buildtest-TESTS oecheck |
| 62 | } |
| 63 | |
| 64 | do_install_ptest() { |
| 65 | if [ ${PTEST_ENABLED} = "1" ]; then |
| 66 | # copy the files which needed by the cases |
| 67 | TEST_FILES="strip strip.o addr2line elfcmp objdump readelf size.o nm.o nm elflint elfcompress elfclassify stack unstrip" |
| 68 | install -d -m 755 ${D}${PTEST_PATH}/src |
| 69 | install -d -m 755 ${D}${PTEST_PATH}/libelf |
| 70 | install -d -m 755 ${D}${PTEST_PATH}/libdw |
Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 71 | install -d -m 755 ${D}${PTEST_PATH}/libdwfl |
| 72 | install -d -m 755 ${D}${PTEST_PATH}/libdwelf |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 73 | install -d -m 755 ${D}${PTEST_PATH}/libasm |
Andrew Geissler | 90fd73c | 2021-03-05 15:25:55 -0600 | [diff] [blame] | 74 | install -d -m 755 ${D}${PTEST_PATH}/libcpu |
| 75 | install -d -m 755 ${D}${PTEST_PATH}/libebl |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 76 | for test_file in ${TEST_FILES}; do |
| 77 | if [ -f ${B}/src/${test_file} ]; then |
| 78 | cp -r ${B}/src/${test_file} ${D}${PTEST_PATH}/src |
| 79 | fi |
| 80 | done |
| 81 | cp ${D}${libdir}/libelf-${PV}.so ${D}${PTEST_PATH}/libelf/libelf.so |
| 82 | cp ${D}${libdir}/libdw-${PV}.so ${D}${PTEST_PATH}/libdw/libdw.so |
| 83 | cp ${D}${libdir}/libasm-${PV}.so ${D}${PTEST_PATH}/libasm/libasm.so |
Andrew Geissler | 90fd73c | 2021-03-05 15:25:55 -0600 | [diff] [blame] | 84 | cp ${B}/libcpu/libcpu.a ${D}${PTEST_PATH}/libcpu/ |
| 85 | cp ${B}/libebl/libebl.a ${D}${PTEST_PATH}/libebl/ |
Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 86 | cp ${S}/libelf/*.h ${D}${PTEST_PATH}/libelf/ |
| 87 | cp ${S}/libdw/*.h ${D}${PTEST_PATH}/libdw/ |
| 88 | cp ${S}/libdwfl/*.h ${D}${PTEST_PATH}/libdwfl/ |
| 89 | cp ${S}/libdwelf/*.h ${D}${PTEST_PATH}/libdwelf/ |
| 90 | cp ${S}/libasm/*.h ${D}${PTEST_PATH}/libasm/ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 91 | cp -r ${S}/tests/ ${D}${PTEST_PATH} |
| 92 | cp -r ${B}/tests/* ${D}${PTEST_PATH}/tests |
| 93 | cp -r ${B}/config.h ${D}${PTEST_PATH} |
| 94 | cp -r ${B}/backends ${D}${PTEST_PATH} |
Andrew Geissler | c926e17 | 2021-05-07 16:11:35 -0500 | [diff] [blame] | 95 | cp -r ${B}/debuginfod ${D}${PTEST_PATH} |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 96 | sed -i '/^Makefile:/c Makefile:' ${D}${PTEST_PATH}/tests/Makefile |
| 97 | find ${D}${PTEST_PATH} -type f -name *.[hoc] | xargs -i rm {} |
| 98 | fi |
| 99 | } |
| 100 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 101 | EXTRA_OEMAKE:class-native = "" |
| 102 | EXTRA_OEMAKE:class-nativesdk = "" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 103 | |
| 104 | BBCLASSEXTEND = "native nativesdk" |
| 105 | |
| 106 | # Package utilities separately |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 107 | PACKAGES =+ "${PN}-binutils libelf libasm libdw libdebuginfod" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 108 | |
| 109 | # shared libraries are licensed GPLv2 or GPLv3+, binaries GPLv3+ |
| 110 | # according to NEWS file: |
| 111 | # "The license is now GPLv2/LGPLv3+ for the libraries and GPLv3+ for stand-alone |
| 112 | # programs. There is now also a formal CONTRIBUTING document describing how to |
| 113 | # submit patches." |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 114 | LICENSE:${PN}-binutils = "GPLv3+" |
| 115 | LICENSE:${PN} = "GPLv3+" |
| 116 | LICENSE:libelf = "GPLv2 | LGPLv3+" |
| 117 | LICENSE:libasm = "GPLv2 | LGPLv3+" |
| 118 | LICENSE:libdw = "GPLv2 | LGPLv3+" |
| 119 | LICENSE:libdebuginfod = "GPLv2+ | LGPLv3+" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 120 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 121 | FILES:${PN}-binutils = "\ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 122 | ${bindir}/eu-addr2line \ |
| 123 | ${bindir}/eu-ld \ |
| 124 | ${bindir}/eu-nm \ |
| 125 | ${bindir}/eu-readelf \ |
| 126 | ${bindir}/eu-size \ |
| 127 | ${bindir}/eu-strip" |
| 128 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 129 | FILES:libelf = "${libdir}/libelf-${PV}.so ${libdir}/libelf.so.*" |
| 130 | FILES:libasm = "${libdir}/libasm-${PV}.so ${libdir}/libasm.so.*" |
| 131 | FILES:libdw = "${libdir}/libdw-${PV}.so ${libdir}/libdw.so.* ${libdir}/elfutils/lib*" |
| 132 | FILES:libdebuginfod = "${libdir}/libdebuginfod-${PV}.so ${libdir}/libdebuginfod.so.*" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 133 | # Some packages have the version preceeding the .so instead properly |
| 134 | # versioned .so.<version>, so we need to reorder and repackage. |
Patrick Williams | 0ca19cc | 2021-08-16 14:03:13 -0500 | [diff] [blame] | 135 | #FILES:${PN} += "${libdir}/*-${PV}.so ${base_libdir}/*-${PV}.so" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 136 | #FILES_SOLIBSDEV = "${libdir}/libasm.so ${libdir}/libdw.so ${libdir}/libelf.so" |
| 137 | |
| 138 | # The package contains symlinks that trip up insane |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 139 | INSANE_SKIP:${MLPREFIX}libdw = "dev-so" |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 140 | # The nlist binary in the tests uses explicitly minimal compiler flags |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 141 | INSANE_SKIP:${PN}-ptest += "ldflags" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 142 | |
| 143 | # avoid stripping some generated binaries otherwise some of the tests such as test-nlist, |
| 144 | # run-strip-reloc.sh, run-strip-strmerge.sh and so on will fail |
| 145 | INHIBIT_PACKAGE_STRIP_FILES = "\ |
| 146 | ${PKGD}${PTEST_PATH}/tests/test-nlist \ |
| 147 | ${PKGD}${PTEST_PATH}/tests/elfstrmerge \ |
| 148 | ${PKGD}${PTEST_PATH}/tests/backtrace-child \ |
| 149 | ${PKGD}${PTEST_PATH}/tests/backtrace-data \ |
| 150 | ${PKGD}${PTEST_PATH}/tests/backtrace-dwarf \ |
| 151 | ${PKGD}${PTEST_PATH}/tests/deleted \ |
Andrew Geissler | c926e17 | 2021-05-07 16:11:35 -0500 | [diff] [blame] | 152 | ${PKGD}${PTEST_PATH}/tests/dwfllines \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 153 | ${PKGD}${PTEST_PATH}/src/strip \ |
| 154 | ${PKGD}${PTEST_PATH}/src/addr2line \ |
| 155 | ${PKGD}${PTEST_PATH}/src/elfcmp \ |
| 156 | ${PKGD}${PTEST_PATH}/src/objdump \ |
| 157 | ${PKGD}${PTEST_PATH}/src/readelf \ |
| 158 | ${PKGD}${PTEST_PATH}/src/nm \ |
| 159 | ${PKGD}${PTEST_PATH}/src/elflint \ |
| 160 | ${PKGD}${PTEST_PATH}/src/elfclassify \ |
| 161 | ${PKGD}${PTEST_PATH}/src/stack \ |
| 162 | ${PKGD}${PTEST_PATH}/src/unstrip \ |
| 163 | ${PKGD}${PTEST_PATH}/libelf/libelf.so \ |
| 164 | ${PKGD}${PTEST_PATH}/libdw/libdw.so \ |
| 165 | ${PKGD}${PTEST_PATH}/libasm/libasm.so \ |
| 166 | ${PKGD}${PTEST_PATH}/backends/libebl_i386.so \ |
| 167 | ${PKGD}${PTEST_PATH}/backends/libebl_x86_64.so \ |
| 168 | " |
| 169 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 170 | PRIVATE_LIBS:${PN}-ptest = "libdw.so.1 libelf.so.1 libasm.so.1 libdebuginfod.so.1" |