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" |
| 3 | SECTION = "base" |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame^] | 4 | LICENSE = "GPLv2 & GPLv2+ & LGPLv3+ & GPLv3+" |
| 5 | LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \ |
| 6 | file://debuginfod/debuginfod-client.c;endline=27;md5=f8e9d171c401c493ec45a0b2992ea2ed \ |
| 7 | " |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 8 | DEPENDS = "zlib virtual/libintl" |
| 9 | DEPENDS_append_libc-musl = " argp-standalone fts musl-obstack " |
| 10 | # The Debian patches below are from: |
| 11 | # http://ftp.de.debian.org/debian/pool/main/e/elfutils/elfutils_0.176-1.debian.tar.xz |
| 12 | SRC_URI = "https://sourceware.org/elfutils/ftp/${PV}/${BP}.tar.bz2 \ |
| 13 | file://0001-dso-link-change.patch \ |
| 14 | file://0002-Fix-elf_cvt_gunhash-if-dest-and-src-are-same.patch \ |
| 15 | file://0003-fixheadercheck.patch \ |
| 16 | file://0004-Disable-the-test-to-convert-euc-jp.patch \ |
| 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 \ |
| 21 | file://0001-ppc_initreg.c-Incliude-asm-ptrace.h-for-pt_regs-defi.patch \ |
| 22 | file://run-ptest \ |
| 23 | file://ptest.patch \ |
Andrew Geissler | 475cb72 | 2020-07-10 16:00:51 -0500 | [diff] [blame] | 24 | file://0001-tests-Makefile.am-compile-test_nlist-with-standard-C.patch \ |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame^] | 25 | file://0001-add-support-for-ipkg-to-debuginfod.cxx.patch \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 26 | " |
| 27 | SRC_URI_append_libc-musl = " \ |
| 28 | file://0001-musl-obstack-fts.patch \ |
| 29 | file://0002-musl-libs.patch \ |
| 30 | file://0003-musl-utils.patch \ |
| 31 | file://0004-Fix-error-on-musl.patch \ |
Andrew Geissler | 475cb72 | 2020-07-10 16:00:51 -0500 | [diff] [blame] | 32 | file://0015-config-eu.am-do-not-use-Werror.patch \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 33 | " |
Andrew Geissler | 09209ee | 2020-12-13 08:44:15 -0600 | [diff] [blame] | 34 | SRC_URI[sha256sum] = "ecc406914edf335f0b7fc084ebe6c460c4d6d5175bfdd6688c1c78d9146b8858" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 35 | |
| 36 | inherit autotools gettext ptest pkgconfig |
| 37 | |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame^] | 38 | EXTRA_OECONF = "--program-prefix=eu-" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 39 | |
| 40 | DEPENDS_BZIP2 = "bzip2-replacement-native" |
| 41 | DEPENDS_BZIP2_class-target = "bzip2" |
| 42 | |
| 43 | PACKAGECONFIG ??= "" |
| 44 | PACKAGECONFIG[bzip2] = "--with-bzlib,--without-bzlib,${DEPENDS_BZIP2}" |
| 45 | PACKAGECONFIG[xz] = "--with-lzma,--without-lzma,xz" |
Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 46 | PACKAGECONFIG[libdebuginfod] = "--enable-libdebuginfod,--disable-libdebuginfod,curl" |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame^] | 47 | PACKAGECONFIG[debuginfod] = "--enable-debuginfod,--disable-debuginfod,libarchive sqlite3 libmicrohttpd" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 48 | |
| 49 | RDEPENDS_${PN}-ptest += "libasm libelf bash make coreutils ${PN}-binutils" |
| 50 | |
| 51 | EXTRA_OECONF_append_class-target = " --disable-tests-rpath" |
| 52 | |
| 53 | RDEPENDS_${PN}-ptest_append_libc-glibc = " glibc-utils" |
| 54 | |
| 55 | do_compile_ptest() { |
| 56 | cd ${B}/tests |
| 57 | oe_runmake buildtest-TESTS oecheck |
| 58 | } |
| 59 | |
| 60 | do_install_ptest() { |
| 61 | if [ ${PTEST_ENABLED} = "1" ]; then |
| 62 | # copy the files which needed by the cases |
| 63 | TEST_FILES="strip strip.o addr2line elfcmp objdump readelf size.o nm.o nm elflint elfcompress elfclassify stack unstrip" |
| 64 | install -d -m 755 ${D}${PTEST_PATH}/src |
| 65 | install -d -m 755 ${D}${PTEST_PATH}/libelf |
| 66 | install -d -m 755 ${D}${PTEST_PATH}/libdw |
Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 67 | install -d -m 755 ${D}${PTEST_PATH}/libdwfl |
| 68 | install -d -m 755 ${D}${PTEST_PATH}/libdwelf |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 69 | install -d -m 755 ${D}${PTEST_PATH}/libasm |
| 70 | for test_file in ${TEST_FILES}; do |
| 71 | if [ -f ${B}/src/${test_file} ]; then |
| 72 | cp -r ${B}/src/${test_file} ${D}${PTEST_PATH}/src |
| 73 | fi |
| 74 | done |
| 75 | cp ${D}${libdir}/libelf-${PV}.so ${D}${PTEST_PATH}/libelf/libelf.so |
| 76 | cp ${D}${libdir}/libdw-${PV}.so ${D}${PTEST_PATH}/libdw/libdw.so |
| 77 | cp ${D}${libdir}/libasm-${PV}.so ${D}${PTEST_PATH}/libasm/libasm.so |
Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 78 | cp ${S}/libelf/*.h ${D}${PTEST_PATH}/libelf/ |
| 79 | cp ${S}/libdw/*.h ${D}${PTEST_PATH}/libdw/ |
| 80 | cp ${S}/libdwfl/*.h ${D}${PTEST_PATH}/libdwfl/ |
| 81 | cp ${S}/libdwelf/*.h ${D}${PTEST_PATH}/libdwelf/ |
| 82 | cp ${S}/libasm/*.h ${D}${PTEST_PATH}/libasm/ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 83 | cp -r ${S}/tests/ ${D}${PTEST_PATH} |
| 84 | cp -r ${B}/tests/* ${D}${PTEST_PATH}/tests |
| 85 | cp -r ${B}/config.h ${D}${PTEST_PATH} |
| 86 | cp -r ${B}/backends ${D}${PTEST_PATH} |
| 87 | sed -i '/^Makefile:/c Makefile:' ${D}${PTEST_PATH}/tests/Makefile |
| 88 | find ${D}${PTEST_PATH} -type f -name *.[hoc] | xargs -i rm {} |
| 89 | fi |
| 90 | } |
| 91 | |
| 92 | EXTRA_OEMAKE_class-native = "" |
| 93 | EXTRA_OEMAKE_class-nativesdk = "" |
| 94 | |
| 95 | BBCLASSEXTEND = "native nativesdk" |
| 96 | |
| 97 | # Package utilities separately |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame^] | 98 | PACKAGES =+ "${PN}-binutils libelf libasm libdw libdebuginfod" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 99 | |
| 100 | # shared libraries are licensed GPLv2 or GPLv3+, binaries GPLv3+ |
| 101 | # according to NEWS file: |
| 102 | # "The license is now GPLv2/LGPLv3+ for the libraries and GPLv3+ for stand-alone |
| 103 | # programs. There is now also a formal CONTRIBUTING document describing how to |
| 104 | # submit patches." |
| 105 | LICENSE_${PN}-binutils = "GPLv3+" |
| 106 | LICENSE_${PN} = "GPLv3+" |
| 107 | LICENSE_libelf = "GPLv2 | LGPLv3+" |
| 108 | LICENSE_libasm = "GPLv2 | LGPLv3+" |
| 109 | LICENSE_libdw = "GPLv2 | LGPLv3+" |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame^] | 110 | LICENSE_libdebuginfod = "GPLv2+ | LGPLv3+" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 111 | |
| 112 | FILES_${PN}-binutils = "\ |
| 113 | ${bindir}/eu-addr2line \ |
| 114 | ${bindir}/eu-ld \ |
| 115 | ${bindir}/eu-nm \ |
| 116 | ${bindir}/eu-readelf \ |
| 117 | ${bindir}/eu-size \ |
| 118 | ${bindir}/eu-strip" |
| 119 | |
| 120 | FILES_libelf = "${libdir}/libelf-${PV}.so ${libdir}/libelf.so.*" |
| 121 | FILES_libasm = "${libdir}/libasm-${PV}.so ${libdir}/libasm.so.*" |
| 122 | FILES_libdw = "${libdir}/libdw-${PV}.so ${libdir}/libdw.so.* ${libdir}/elfutils/lib*" |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame^] | 123 | FILES_libdebuginfod = "${libdir}/libdebuginfod-${PV}.so ${libdir}/libdebuginfod.so.*" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 124 | # Some packages have the version preceeding the .so instead properly |
| 125 | # versioned .so.<version>, so we need to reorder and repackage. |
| 126 | #FILES_${PN} += "${libdir}/*-${PV}.so ${base_libdir}/*-${PV}.so" |
| 127 | #FILES_SOLIBSDEV = "${libdir}/libasm.so ${libdir}/libdw.so ${libdir}/libelf.so" |
| 128 | |
| 129 | # The package contains symlinks that trip up insane |
| 130 | INSANE_SKIP_${MLPREFIX}libdw = "dev-so" |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 131 | # The nlist binary in the tests uses explicitly minimal compiler flags |
| 132 | INSANE_SKIP_${PN}-ptest += "ldflags" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 133 | |
| 134 | # avoid stripping some generated binaries otherwise some of the tests such as test-nlist, |
| 135 | # run-strip-reloc.sh, run-strip-strmerge.sh and so on will fail |
| 136 | INHIBIT_PACKAGE_STRIP_FILES = "\ |
| 137 | ${PKGD}${PTEST_PATH}/tests/test-nlist \ |
| 138 | ${PKGD}${PTEST_PATH}/tests/elfstrmerge \ |
| 139 | ${PKGD}${PTEST_PATH}/tests/backtrace-child \ |
| 140 | ${PKGD}${PTEST_PATH}/tests/backtrace-data \ |
| 141 | ${PKGD}${PTEST_PATH}/tests/backtrace-dwarf \ |
| 142 | ${PKGD}${PTEST_PATH}/tests/deleted \ |
| 143 | ${PKGD}${PTEST_PATH}/src/strip \ |
| 144 | ${PKGD}${PTEST_PATH}/src/addr2line \ |
| 145 | ${PKGD}${PTEST_PATH}/src/elfcmp \ |
| 146 | ${PKGD}${PTEST_PATH}/src/objdump \ |
| 147 | ${PKGD}${PTEST_PATH}/src/readelf \ |
| 148 | ${PKGD}${PTEST_PATH}/src/nm \ |
| 149 | ${PKGD}${PTEST_PATH}/src/elflint \ |
| 150 | ${PKGD}${PTEST_PATH}/src/elfclassify \ |
| 151 | ${PKGD}${PTEST_PATH}/src/stack \ |
| 152 | ${PKGD}${PTEST_PATH}/src/unstrip \ |
| 153 | ${PKGD}${PTEST_PATH}/libelf/libelf.so \ |
| 154 | ${PKGD}${PTEST_PATH}/libdw/libdw.so \ |
| 155 | ${PKGD}${PTEST_PATH}/libasm/libasm.so \ |
| 156 | ${PKGD}${PTEST_PATH}/backends/libebl_i386.so \ |
| 157 | ${PKGD}${PTEST_PATH}/backends/libebl_x86_64.so \ |
| 158 | " |
| 159 | |
| 160 | PRIVATE_LIBS_${PN}-ptest = "libdw.so.1 libelf.so.1 libasm.so.1" |