Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 1 | SUMMARY = "Utilities and libraries for handling compiled object files" |
| 2 | HOMEPAGE = "https://sourceware.org/elfutils" |
| 3 | SECTION = "base" |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 4 | LICENSE = "GPLv2 & LGPLv3+ & GPLv3+" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 5 | LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504" |
Brad Bishop | 64c979e | 2019-11-04 13:55:29 -0500 | [diff] [blame] | 6 | DEPENDS = "zlib virtual/libintl" |
Brad Bishop | 96ff198 | 2019-08-19 13:50:42 -0400 | [diff] [blame] | 7 | DEPENDS_append_libc-musl = " argp-standalone fts musl-obstack " |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 8 | # The Debian patches below are from: |
Brad Bishop | a34c030 | 2019-09-23 22:34:48 -0400 | [diff] [blame] | 9 | # http://ftp.de.debian.org/debian/pool/main/e/elfutils/elfutils_0.176-1.debian.tar.xz |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 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://0007-Fix-control-path-where-we-have-str-as-uninitialized-.patch \ |
| 17 | file://0001-libasm-may-link-with-libbz2-if-found.patch \ |
| 18 | file://0001-libelf-elf_end.c-check-data_list.data.d.d_buf-before.patch \ |
| 19 | file://debian/hppa_backend.diff \ |
| 20 | file://debian/arm_backend.diff \ |
| 21 | file://debian/mips_backend.diff \ |
| 22 | file://debian/mips_readelf_w.patch \ |
| 23 | file://debian/kfreebsd_path.patch \ |
| 24 | file://debian/0001-Ignore-differences-between-mips-machine-identifiers.patch \ |
| 25 | file://debian/0002-Add-support-for-mips64-abis-in-mips_retval.c.patch \ |
| 26 | file://debian/0003-Add-mips-n64-relocation-format-hack.patch \ |
| 27 | file://debian/hurd_path.patch \ |
| 28 | file://debian/ignore_strmerge.diff \ |
| 29 | file://debian/disable_werror.patch \ |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 30 | file://debian/testsuite-ignore-elflint.diff \ |
Brad Bishop | a34c030 | 2019-09-23 22:34:48 -0400 | [diff] [blame] | 31 | file://debian/mips_cfi.patch \ |
| 32 | file://debian/0001-fix-compile-failure-with-debian-patches.patch \ |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 33 | file://0001-skip-the-test-when-gcc-not-deployed.patch \ |
Brad Bishop | a34c030 | 2019-09-23 22:34:48 -0400 | [diff] [blame] | 34 | file://0001-ppc_initreg.c-Incliude-asm-ptrace.h-for-pt_regs-defi.patch \ |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 35 | file://run-ptest \ |
| 36 | file://ptest.patch \ |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 37 | " |
Brad Bishop | 96ff198 | 2019-08-19 13:50:42 -0400 | [diff] [blame] | 38 | SRC_URI_append_libc-musl = " \ |
| 39 | file://musl-obstack-fts.patch \ |
| 40 | file://musl-libs.patch \ |
| 41 | file://musl-utils.patch \ |
| 42 | file://musl-tests.patch \ |
| 43 | " |
Brad Bishop | a34c030 | 2019-09-23 22:34:48 -0400 | [diff] [blame] | 44 | SRC_URI[md5sum] = "0b583722f911e1632544718d502aab87" |
| 45 | SRC_URI[sha256sum] = "fa489deccbcae7d8c920f60d85906124c1989c591196d90e0fd668e3dc05042e" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 46 | |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 47 | inherit autotools gettext ptest |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 48 | |
Brad Bishop | 64c979e | 2019-11-04 13:55:29 -0500 | [diff] [blame] | 49 | EXTRA_OECONF = "--program-prefix=eu-" |
| 50 | |
| 51 | DEPENDS_BZIP2 = "bzip2-replacement-native" |
| 52 | DEPENDS_BZIP2_class-target = "bzip2" |
| 53 | |
| 54 | PACKAGECONFIG ??= "" |
| 55 | PACKAGECONFIG[bzip2] = "--with-bzlib,--without-bzlib,${DEPENDS_BZIP2}" |
| 56 | PACKAGECONFIG[xz] = "--with-lzma,--without-lzma,xz" |
| 57 | |
Brad Bishop | 15ae250 | 2019-06-18 21:44:24 -0400 | [diff] [blame] | 58 | RDEPENDS_${PN}-ptest += "libasm libelf bash make coreutils ${PN}-binutils" |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 59 | |
| 60 | EXTRA_OECONF_append_class-target += "--disable-tests-rpath" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 61 | |
| 62 | do_install_append() { |
| 63 | if [ "${TARGET_ARCH}" != "x86_64" ] && [ -z `echo "${TARGET_ARCH}"|grep 'i.86'` ];then |
| 64 | rm -f ${D}${bindir}/eu-objdump |
| 65 | fi |
| 66 | } |
| 67 | |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 68 | do_compile_ptest() { |
| 69 | cd ${B}/tests |
| 70 | oe_runmake buildtest-TESTS oecheck |
| 71 | } |
| 72 | |
| 73 | do_install_ptest() { |
| 74 | if [ ${PTEST_ENABLED} = "1" ]; then |
Brad Bishop | 15ae250 | 2019-06-18 21:44:24 -0400 | [diff] [blame] | 75 | # copy the files which needed by the cases |
| 76 | TEST_FILES="strip strip.o addr2line elfcmp objdump readelf size.o nm.o nm elflint" |
| 77 | install -d -m 755 ${D}${PTEST_PATH}/src |
| 78 | install -d -m 755 ${D}${PTEST_PATH}/libelf |
| 79 | install -d -m 755 ${D}${PTEST_PATH}/libdw |
| 80 | for test_file in ${TEST_FILES}; do |
| 81 | if [ -f ${B}/src/${test_file} ]; then |
| 82 | cp -r ${B}/src/${test_file} ${D}${PTEST_PATH}/src |
| 83 | fi |
| 84 | done |
| 85 | cp ${D}${libdir}/libelf-${PV}.so ${D}${PTEST_PATH}/libelf/libelf.so |
| 86 | cp ${D}${libdir}/libdw-${PV}.so ${D}${PTEST_PATH}/libdw/libdw.so |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 87 | cp -r ${S}/tests/ ${D}${PTEST_PATH} |
| 88 | cp -r ${B}/tests/* ${D}${PTEST_PATH}/tests |
| 89 | cp -r ${B}/config.h ${D}${PTEST_PATH} |
| 90 | cp -r ${B}/backends ${D}${PTEST_PATH} |
| 91 | sed -i '/^Makefile:/c Makefile:' ${D}${PTEST_PATH}/tests/Makefile |
| 92 | find ${D}${PTEST_PATH} -type f -name *.[hoc] | xargs -i rm {} |
| 93 | fi |
| 94 | } |
| 95 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 96 | EXTRA_OEMAKE_class-native = "" |
| 97 | EXTRA_OEMAKE_class-nativesdk = "" |
| 98 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 99 | BBCLASSEXTEND = "native nativesdk" |
| 100 | |
| 101 | # Package utilities separately |
| 102 | PACKAGES =+ "${PN}-binutils libelf libasm libdw" |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 103 | |
| 104 | # shared libraries are licensed GPLv2 or GPLv3+, binaries GPLv3+ |
| 105 | # according to NEWS file: |
| 106 | # "The license is now GPLv2/LGPLv3+ for the libraries and GPLv3+ for stand-alone |
| 107 | # programs. There is now also a formal CONTRIBUTING document describing how to |
| 108 | # submit patches." |
| 109 | LICENSE_${PN}-binutils = "GPLv3+" |
| 110 | LICENSE_${PN} = "GPLv3+" |
| 111 | LICENSE_libelf = "GPLv2 | LGPLv3+" |
| 112 | LICENSE_libasm = "GPLv2 | LGPLv3+" |
| 113 | LICENSE_libdw = "GPLv2 | LGPLv3+" |
| 114 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 115 | FILES_${PN}-binutils = "\ |
| 116 | ${bindir}/eu-addr2line \ |
| 117 | ${bindir}/eu-ld \ |
| 118 | ${bindir}/eu-nm \ |
| 119 | ${bindir}/eu-readelf \ |
| 120 | ${bindir}/eu-size \ |
| 121 | ${bindir}/eu-strip" |
| 122 | |
| 123 | FILES_libelf = "${libdir}/libelf-${PV}.so ${libdir}/libelf.so.*" |
| 124 | FILES_libasm = "${libdir}/libasm-${PV}.so ${libdir}/libasm.so.*" |
| 125 | FILES_libdw = "${libdir}/libdw-${PV}.so ${libdir}/libdw.so.* ${libdir}/elfutils/lib*" |
| 126 | # Some packages have the version preceeding the .so instead properly |
| 127 | # versioned .so.<version>, so we need to reorder and repackage. |
| 128 | #FILES_${PN} += "${libdir}/*-${PV}.so ${base_libdir}/*-${PV}.so" |
| 129 | #FILES_SOLIBSDEV = "${libdir}/libasm.so ${libdir}/libdw.so ${libdir}/libelf.so" |
| 130 | |
| 131 | # The package contains symlinks that trip up insane |
| 132 | INSANE_SKIP_${MLPREFIX}libdw = "dev-so" |
Brad Bishop | 15ae250 | 2019-06-18 21:44:24 -0400 | [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/deleted \ |
| 142 | ${PKGD}${PTEST_PATH}/src/strip \ |
| 143 | ${PKGD}${PTEST_PATH}/src/addr2line \ |
| 144 | ${PKGD}${PTEST_PATH}/src/elfcmp \ |
| 145 | ${PKGD}${PTEST_PATH}/src/objdump \ |
| 146 | ${PKGD}${PTEST_PATH}/src/readelf \ |
| 147 | ${PKGD}${PTEST_PATH}/src/nm \ |
| 148 | ${PKGD}${PTEST_PATH}/src/elflint \ |
| 149 | ${PKGD}${PTEST_PATH}/libelf/libelf.so \ |
| 150 | ${PKGD}${PTEST_PATH}/libdw/libdw.so \ |
| 151 | ${PKGD}${PTEST_PATH}/backends/libebl_i386.so \ |
| 152 | ${PKGD}${PTEST_PATH}/backends/libebl_x86_64.so \ |
| 153 | " |
| 154 | |
Brad Bishop | 08902b0 | 2019-08-20 09:16:51 -0400 | [diff] [blame] | 155 | PRIVATE_LIBS_${PN}-ptest = "libdw.so.1 libelf.so.1" |