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" |
| 6 | DEPENDS = "libtool bzip2 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: |
| 9 | # http://ftp.de.debian.org/debian/pool/main/e/elfutils/elfutils_0.175-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://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 \ |
| 31 | file://0001-skip-the-test-when-gcc-not-deployed.patch \ |
| 32 | file://run-ptest \ |
| 33 | file://ptest.patch \ |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 34 | " |
Brad Bishop | 96ff198 | 2019-08-19 13:50:42 -0400 | [diff] [blame] | 35 | SRC_URI_append_libc-musl = " \ |
| 36 | file://musl-obstack-fts.patch \ |
| 37 | file://musl-libs.patch \ |
| 38 | file://musl-utils.patch \ |
| 39 | file://musl-tests.patch \ |
| 40 | " |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 41 | SRC_URI[md5sum] = "077e4f49320cad82bf17a997068b1db9" |
| 42 | SRC_URI[sha256sum] = "eb5747c371b0af0f71e86215a5ebb88728533c3a104a43d4231963f308cd1023" |
| 43 | |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 44 | inherit autotools gettext ptest |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 45 | |
| 46 | EXTRA_OECONF = "--program-prefix=eu- --without-lzma" |
| 47 | EXTRA_OECONF_append_class-native = " --without-bzlib" |
Brad Bishop | 15ae250 | 2019-06-18 21:44:24 -0400 | [diff] [blame] | 48 | RDEPENDS_${PN}-ptest += "libasm libelf bash make coreutils ${PN}-binutils" |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 49 | |
| 50 | EXTRA_OECONF_append_class-target += "--disable-tests-rpath" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 51 | |
| 52 | do_install_append() { |
| 53 | if [ "${TARGET_ARCH}" != "x86_64" ] && [ -z `echo "${TARGET_ARCH}"|grep 'i.86'` ];then |
| 54 | rm -f ${D}${bindir}/eu-objdump |
| 55 | fi |
| 56 | } |
| 57 | |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 58 | do_compile_ptest() { |
| 59 | cd ${B}/tests |
| 60 | oe_runmake buildtest-TESTS oecheck |
| 61 | } |
| 62 | |
| 63 | do_install_ptest() { |
| 64 | if [ ${PTEST_ENABLED} = "1" ]; then |
Brad Bishop | 15ae250 | 2019-06-18 21:44:24 -0400 | [diff] [blame] | 65 | # copy the files which needed by the cases |
| 66 | TEST_FILES="strip strip.o addr2line elfcmp objdump readelf size.o nm.o nm elflint" |
| 67 | install -d -m 755 ${D}${PTEST_PATH}/src |
| 68 | install -d -m 755 ${D}${PTEST_PATH}/libelf |
| 69 | install -d -m 755 ${D}${PTEST_PATH}/libdw |
| 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 |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 77 | cp -r ${S}/tests/ ${D}${PTEST_PATH} |
| 78 | cp -r ${B}/tests/* ${D}${PTEST_PATH}/tests |
| 79 | cp -r ${B}/config.h ${D}${PTEST_PATH} |
| 80 | cp -r ${B}/backends ${D}${PTEST_PATH} |
| 81 | sed -i '/^Makefile:/c Makefile:' ${D}${PTEST_PATH}/tests/Makefile |
| 82 | find ${D}${PTEST_PATH} -type f -name *.[hoc] | xargs -i rm {} |
| 83 | fi |
| 84 | } |
| 85 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 86 | EXTRA_OEMAKE_class-native = "" |
| 87 | EXTRA_OEMAKE_class-nativesdk = "" |
| 88 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 89 | BBCLASSEXTEND = "native nativesdk" |
| 90 | |
| 91 | # Package utilities separately |
| 92 | PACKAGES =+ "${PN}-binutils libelf libasm libdw" |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 93 | |
| 94 | # shared libraries are licensed GPLv2 or GPLv3+, binaries GPLv3+ |
| 95 | # according to NEWS file: |
| 96 | # "The license is now GPLv2/LGPLv3+ for the libraries and GPLv3+ for stand-alone |
| 97 | # programs. There is now also a formal CONTRIBUTING document describing how to |
| 98 | # submit patches." |
| 99 | LICENSE_${PN}-binutils = "GPLv3+" |
| 100 | LICENSE_${PN} = "GPLv3+" |
| 101 | LICENSE_libelf = "GPLv2 | LGPLv3+" |
| 102 | LICENSE_libasm = "GPLv2 | LGPLv3+" |
| 103 | LICENSE_libdw = "GPLv2 | LGPLv3+" |
| 104 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 105 | FILES_${PN}-binutils = "\ |
| 106 | ${bindir}/eu-addr2line \ |
| 107 | ${bindir}/eu-ld \ |
| 108 | ${bindir}/eu-nm \ |
| 109 | ${bindir}/eu-readelf \ |
| 110 | ${bindir}/eu-size \ |
| 111 | ${bindir}/eu-strip" |
| 112 | |
| 113 | FILES_libelf = "${libdir}/libelf-${PV}.so ${libdir}/libelf.so.*" |
| 114 | FILES_libasm = "${libdir}/libasm-${PV}.so ${libdir}/libasm.so.*" |
| 115 | FILES_libdw = "${libdir}/libdw-${PV}.so ${libdir}/libdw.so.* ${libdir}/elfutils/lib*" |
| 116 | # Some packages have the version preceeding the .so instead properly |
| 117 | # versioned .so.<version>, so we need to reorder and repackage. |
| 118 | #FILES_${PN} += "${libdir}/*-${PV}.so ${base_libdir}/*-${PV}.so" |
| 119 | #FILES_SOLIBSDEV = "${libdir}/libasm.so ${libdir}/libdw.so ${libdir}/libelf.so" |
| 120 | |
| 121 | # The package contains symlinks that trip up insane |
| 122 | INSANE_SKIP_${MLPREFIX}libdw = "dev-so" |
Brad Bishop | 15ae250 | 2019-06-18 21:44:24 -0400 | [diff] [blame] | 123 | |
| 124 | # avoid stripping some generated binaries otherwise some of the tests such as test-nlist, |
| 125 | # run-strip-reloc.sh, run-strip-strmerge.sh and so on will fail |
| 126 | INHIBIT_PACKAGE_STRIP_FILES = "\ |
| 127 | ${PKGD}${PTEST_PATH}/tests/test-nlist \ |
| 128 | ${PKGD}${PTEST_PATH}/tests/elfstrmerge \ |
| 129 | ${PKGD}${PTEST_PATH}/tests/backtrace-child \ |
| 130 | ${PKGD}${PTEST_PATH}/tests/backtrace-data \ |
| 131 | ${PKGD}${PTEST_PATH}/tests/deleted \ |
| 132 | ${PKGD}${PTEST_PATH}/src/strip \ |
| 133 | ${PKGD}${PTEST_PATH}/src/addr2line \ |
| 134 | ${PKGD}${PTEST_PATH}/src/elfcmp \ |
| 135 | ${PKGD}${PTEST_PATH}/src/objdump \ |
| 136 | ${PKGD}${PTEST_PATH}/src/readelf \ |
| 137 | ${PKGD}${PTEST_PATH}/src/nm \ |
| 138 | ${PKGD}${PTEST_PATH}/src/elflint \ |
| 139 | ${PKGD}${PTEST_PATH}/libelf/libelf.so \ |
| 140 | ${PKGD}${PTEST_PATH}/libdw/libdw.so \ |
| 141 | ${PKGD}${PTEST_PATH}/backends/libebl_i386.so \ |
| 142 | ${PKGD}${PTEST_PATH}/backends/libebl_x86_64.so \ |
| 143 | " |
| 144 | |
Brad Bishop | 08902b0 | 2019-08-20 09:16:51 -0400 | [diff] [blame] | 145 | PRIVATE_LIBS_${PN}-ptest = "libdw.so.1 libelf.so.1" |