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" |
| 4 | LICENSE = "GPLv2 & LGPLv3+ & GPLv3+" |
| 5 | LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504" |
| 6 | DEPENDS = "zlib virtual/libintl" |
| 7 | DEPENDS_append_libc-musl = " argp-standalone fts musl-obstack " |
| 8 | # The Debian patches below are from: |
| 9 | # http://ftp.de.debian.org/debian/pool/main/e/elfutils/elfutils_0.176-1.debian.tar.xz |
| 10 | SRC_URI = "https://sourceware.org/elfutils/ftp/${PV}/${BP}.tar.bz2 \ |
| 11 | file://0001-dso-link-change.patch \ |
| 12 | file://0002-Fix-elf_cvt_gunhash-if-dest-and-src-are-same.patch \ |
| 13 | file://0003-fixheadercheck.patch \ |
| 14 | file://0004-Disable-the-test-to-convert-euc-jp.patch \ |
| 15 | file://0006-Fix-build-on-aarch64-musl.patch \ |
| 16 | file://0001-libasm-may-link-with-libbz2-if-found.patch \ |
| 17 | file://0001-libelf-elf_end.c-check-data_list.data.d.d_buf-before.patch \ |
| 18 | file://debian/hppa_backend.diff \ |
| 19 | file://debian/arm_backend.diff \ |
| 20 | file://debian/mips_backend.diff \ |
| 21 | file://debian/mips_readelf_w.patch \ |
| 22 | file://debian/kfreebsd_path.patch \ |
| 23 | file://debian/0001-Ignore-differences-between-mips-machine-identifiers.patch \ |
| 24 | file://debian/0002-Add-support-for-mips64-abis-in-mips_retval.c.patch \ |
| 25 | file://debian/0003-Add-mips-n64-relocation-format-hack.patch \ |
| 26 | file://debian/hurd_path.patch \ |
| 27 | file://debian/ignore_strmerge.diff \ |
| 28 | file://debian/disable_werror.patch \ |
| 29 | file://debian/testsuite-ignore-elflint.diff \ |
| 30 | file://debian/mips_cfi.patch \ |
| 31 | file://debian/0001-fix-compile-failure-with-debian-patches.patch \ |
| 32 | file://0001-skip-the-test-when-gcc-not-deployed.patch \ |
| 33 | file://0001-ppc_initreg.c-Incliude-asm-ptrace.h-for-pt_regs-defi.patch \ |
| 34 | file://run-ptest \ |
| 35 | file://ptest.patch \ |
| 36 | " |
| 37 | SRC_URI_append_libc-musl = " \ |
| 38 | file://0001-musl-obstack-fts.patch \ |
| 39 | file://0002-musl-libs.patch \ |
| 40 | file://0003-musl-utils.patch \ |
| 41 | file://0004-Fix-error-on-musl.patch \ |
| 42 | " |
| 43 | SRC_URI[md5sum] = "8ee56b371b5a7ea081284c44e5164600" |
| 44 | SRC_URI[sha256sum] = "25a545566cbacaa37ae6222e58f1c48ea4570f53ba991886e2f5ce96e22a23a2" |
| 45 | |
| 46 | inherit autotools gettext ptest pkgconfig |
| 47 | |
| 48 | EXTRA_OECONF = "--program-prefix=eu- --disable-debuginfod" |
| 49 | |
| 50 | DEPENDS_BZIP2 = "bzip2-replacement-native" |
| 51 | DEPENDS_BZIP2_class-target = "bzip2" |
| 52 | |
| 53 | PACKAGECONFIG ??= "" |
| 54 | PACKAGECONFIG[bzip2] = "--with-bzlib,--without-bzlib,${DEPENDS_BZIP2}" |
| 55 | PACKAGECONFIG[xz] = "--with-lzma,--without-lzma,xz" |
| 56 | |
| 57 | RDEPENDS_${PN}-ptest += "libasm libelf bash make coreutils ${PN}-binutils" |
| 58 | |
| 59 | EXTRA_OECONF_append_class-target = " --disable-tests-rpath" |
| 60 | |
| 61 | RDEPENDS_${PN}-ptest_append_libc-glibc = " glibc-utils" |
| 62 | |
| 63 | do_compile_ptest() { |
| 64 | cd ${B}/tests |
| 65 | oe_runmake buildtest-TESTS oecheck |
| 66 | } |
| 67 | |
| 68 | do_install_ptest() { |
| 69 | if [ ${PTEST_ENABLED} = "1" ]; then |
| 70 | # copy the files which needed by the cases |
| 71 | TEST_FILES="strip strip.o addr2line elfcmp objdump readelf size.o nm.o nm elflint elfcompress elfclassify stack unstrip" |
| 72 | install -d -m 755 ${D}${PTEST_PATH}/src |
| 73 | install -d -m 755 ${D}${PTEST_PATH}/libelf |
| 74 | install -d -m 755 ${D}${PTEST_PATH}/libdw |
| 75 | install -d -m 755 ${D}${PTEST_PATH}/libasm |
| 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 |
| 84 | cp -r ${S}/tests/ ${D}${PTEST_PATH} |
| 85 | cp -r ${B}/tests/* ${D}${PTEST_PATH}/tests |
| 86 | cp -r ${B}/config.h ${D}${PTEST_PATH} |
| 87 | cp -r ${B}/backends ${D}${PTEST_PATH} |
| 88 | sed -i '/^Makefile:/c Makefile:' ${D}${PTEST_PATH}/tests/Makefile |
| 89 | find ${D}${PTEST_PATH} -type f -name *.[hoc] | xargs -i rm {} |
| 90 | fi |
| 91 | } |
| 92 | |
| 93 | EXTRA_OEMAKE_class-native = "" |
| 94 | EXTRA_OEMAKE_class-nativesdk = "" |
| 95 | |
| 96 | BBCLASSEXTEND = "native nativesdk" |
| 97 | |
| 98 | # Package utilities separately |
| 99 | PACKAGES =+ "${PN}-binutils libelf libasm libdw" |
| 100 | |
| 101 | # shared libraries are licensed GPLv2 or GPLv3+, binaries GPLv3+ |
| 102 | # according to NEWS file: |
| 103 | # "The license is now GPLv2/LGPLv3+ for the libraries and GPLv3+ for stand-alone |
| 104 | # programs. There is now also a formal CONTRIBUTING document describing how to |
| 105 | # submit patches." |
| 106 | LICENSE_${PN}-binutils = "GPLv3+" |
| 107 | LICENSE_${PN} = "GPLv3+" |
| 108 | LICENSE_libelf = "GPLv2 | LGPLv3+" |
| 109 | LICENSE_libasm = "GPLv2 | LGPLv3+" |
| 110 | LICENSE_libdw = "GPLv2 | LGPLv3+" |
| 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*" |
| 123 | # Some packages have the version preceeding the .so instead properly |
| 124 | # versioned .so.<version>, so we need to reorder and repackage. |
| 125 | #FILES_${PN} += "${libdir}/*-${PV}.so ${base_libdir}/*-${PV}.so" |
| 126 | #FILES_SOLIBSDEV = "${libdir}/libasm.so ${libdir}/libdw.so ${libdir}/libelf.so" |
| 127 | |
| 128 | # The package contains symlinks that trip up insane |
| 129 | INSANE_SKIP_${MLPREFIX}libdw = "dev-so" |
| 130 | |
| 131 | # avoid stripping some generated binaries otherwise some of the tests such as test-nlist, |
| 132 | # run-strip-reloc.sh, run-strip-strmerge.sh and so on will fail |
| 133 | INHIBIT_PACKAGE_STRIP_FILES = "\ |
| 134 | ${PKGD}${PTEST_PATH}/tests/test-nlist \ |
| 135 | ${PKGD}${PTEST_PATH}/tests/elfstrmerge \ |
| 136 | ${PKGD}${PTEST_PATH}/tests/backtrace-child \ |
| 137 | ${PKGD}${PTEST_PATH}/tests/backtrace-data \ |
| 138 | ${PKGD}${PTEST_PATH}/tests/backtrace-dwarf \ |
| 139 | ${PKGD}${PTEST_PATH}/tests/deleted \ |
| 140 | ${PKGD}${PTEST_PATH}/src/strip \ |
| 141 | ${PKGD}${PTEST_PATH}/src/addr2line \ |
| 142 | ${PKGD}${PTEST_PATH}/src/elfcmp \ |
| 143 | ${PKGD}${PTEST_PATH}/src/objdump \ |
| 144 | ${PKGD}${PTEST_PATH}/src/readelf \ |
| 145 | ${PKGD}${PTEST_PATH}/src/nm \ |
| 146 | ${PKGD}${PTEST_PATH}/src/elflint \ |
| 147 | ${PKGD}${PTEST_PATH}/src/elfclassify \ |
| 148 | ${PKGD}${PTEST_PATH}/src/stack \ |
| 149 | ${PKGD}${PTEST_PATH}/src/unstrip \ |
| 150 | ${PKGD}${PTEST_PATH}/libelf/libelf.so \ |
| 151 | ${PKGD}${PTEST_PATH}/libdw/libdw.so \ |
| 152 | ${PKGD}${PTEST_PATH}/libasm/libasm.so \ |
| 153 | ${PKGD}${PTEST_PATH}/backends/libebl_i386.so \ |
| 154 | ${PKGD}${PTEST_PATH}/backends/libebl_x86_64.so \ |
| 155 | " |
| 156 | |
| 157 | PRIVATE_LIBS_${PN}-ptest = "libdw.so.1 libelf.so.1 libasm.so.1" |