elfutils_0.181.bb 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  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://0001-skip-the-test-when-gcc-not-deployed.patch \
  19. file://0001-ppc_initreg.c-Incliude-asm-ptrace.h-for-pt_regs-defi.patch \
  20. file://run-ptest \
  21. file://ptest.patch \
  22. file://0001-tests-Makefile.am-compile-test_nlist-with-standard-C.patch \
  23. "
  24. SRC_URI_append_libc-musl = " \
  25. file://0001-musl-obstack-fts.patch \
  26. file://0002-musl-libs.patch \
  27. file://0003-musl-utils.patch \
  28. file://0004-Fix-error-on-musl.patch \
  29. file://0015-config-eu.am-do-not-use-Werror.patch \
  30. "
  31. SRC_URI[sha256sum] = "29a6ad7421ec2acfee489bb4a699908281ead2cb63a20a027ce8804a165f0eb3"
  32. inherit autotools gettext ptest pkgconfig
  33. EXTRA_OECONF = "--program-prefix=eu- --disable-debuginfod"
  34. DEPENDS_BZIP2 = "bzip2-replacement-native"
  35. DEPENDS_BZIP2_class-target = "bzip2"
  36. PACKAGECONFIG ??= ""
  37. PACKAGECONFIG[bzip2] = "--with-bzlib,--without-bzlib,${DEPENDS_BZIP2}"
  38. PACKAGECONFIG[xz] = "--with-lzma,--without-lzma,xz"
  39. PACKAGECONFIG[libdebuginfod] = "--enable-libdebuginfod,--disable-libdebuginfod,curl"
  40. RDEPENDS_${PN}-ptest += "libasm libelf bash make coreutils ${PN}-binutils"
  41. EXTRA_OECONF_append_class-target = " --disable-tests-rpath"
  42. RDEPENDS_${PN}-ptest_append_libc-glibc = " glibc-utils"
  43. do_compile_ptest() {
  44. cd ${B}/tests
  45. oe_runmake buildtest-TESTS oecheck
  46. }
  47. do_install_ptest() {
  48. if [ ${PTEST_ENABLED} = "1" ]; then
  49. # copy the files which needed by the cases
  50. TEST_FILES="strip strip.o addr2line elfcmp objdump readelf size.o nm.o nm elflint elfcompress elfclassify stack unstrip"
  51. install -d -m 755 ${D}${PTEST_PATH}/src
  52. install -d -m 755 ${D}${PTEST_PATH}/libelf
  53. install -d -m 755 ${D}${PTEST_PATH}/libdw
  54. install -d -m 755 ${D}${PTEST_PATH}/libdwfl
  55. install -d -m 755 ${D}${PTEST_PATH}/libdwelf
  56. install -d -m 755 ${D}${PTEST_PATH}/libasm
  57. for test_file in ${TEST_FILES}; do
  58. if [ -f ${B}/src/${test_file} ]; then
  59. cp -r ${B}/src/${test_file} ${D}${PTEST_PATH}/src
  60. fi
  61. done
  62. cp ${D}${libdir}/libelf-${PV}.so ${D}${PTEST_PATH}/libelf/libelf.so
  63. cp ${D}${libdir}/libdw-${PV}.so ${D}${PTEST_PATH}/libdw/libdw.so
  64. cp ${D}${libdir}/libasm-${PV}.so ${D}${PTEST_PATH}/libasm/libasm.so
  65. cp ${S}/libelf/*.h ${D}${PTEST_PATH}/libelf/
  66. cp ${S}/libdw/*.h ${D}${PTEST_PATH}/libdw/
  67. cp ${S}/libdwfl/*.h ${D}${PTEST_PATH}/libdwfl/
  68. cp ${S}/libdwelf/*.h ${D}${PTEST_PATH}/libdwelf/
  69. cp ${S}/libasm/*.h ${D}${PTEST_PATH}/libasm/
  70. cp -r ${S}/tests/ ${D}${PTEST_PATH}
  71. cp -r ${B}/tests/* ${D}${PTEST_PATH}/tests
  72. cp -r ${B}/config.h ${D}${PTEST_PATH}
  73. cp -r ${B}/backends ${D}${PTEST_PATH}
  74. sed -i '/^Makefile:/c Makefile:' ${D}${PTEST_PATH}/tests/Makefile
  75. find ${D}${PTEST_PATH} -type f -name *.[hoc] | xargs -i rm {}
  76. fi
  77. }
  78. EXTRA_OEMAKE_class-native = ""
  79. EXTRA_OEMAKE_class-nativesdk = ""
  80. BBCLASSEXTEND = "native nativesdk"
  81. # Package utilities separately
  82. PACKAGES =+ "${PN}-binutils libelf libasm libdw"
  83. # shared libraries are licensed GPLv2 or GPLv3+, binaries GPLv3+
  84. # according to NEWS file:
  85. # "The license is now GPLv2/LGPLv3+ for the libraries and GPLv3+ for stand-alone
  86. # programs. There is now also a formal CONTRIBUTING document describing how to
  87. # submit patches."
  88. LICENSE_${PN}-binutils = "GPLv3+"
  89. LICENSE_${PN} = "GPLv3+"
  90. LICENSE_libelf = "GPLv2 | LGPLv3+"
  91. LICENSE_libasm = "GPLv2 | LGPLv3+"
  92. LICENSE_libdw = "GPLv2 | LGPLv3+"
  93. FILES_${PN}-binutils = "\
  94. ${bindir}/eu-addr2line \
  95. ${bindir}/eu-ld \
  96. ${bindir}/eu-nm \
  97. ${bindir}/eu-readelf \
  98. ${bindir}/eu-size \
  99. ${bindir}/eu-strip"
  100. FILES_libelf = "${libdir}/libelf-${PV}.so ${libdir}/libelf.so.*"
  101. FILES_libasm = "${libdir}/libasm-${PV}.so ${libdir}/libasm.so.*"
  102. FILES_libdw = "${libdir}/libdw-${PV}.so ${libdir}/libdw.so.* ${libdir}/elfutils/lib*"
  103. # Some packages have the version preceeding the .so instead properly
  104. # versioned .so.<version>, so we need to reorder and repackage.
  105. #FILES_${PN} += "${libdir}/*-${PV}.so ${base_libdir}/*-${PV}.so"
  106. #FILES_SOLIBSDEV = "${libdir}/libasm.so ${libdir}/libdw.so ${libdir}/libelf.so"
  107. # The package contains symlinks that trip up insane
  108. INSANE_SKIP_${MLPREFIX}libdw = "dev-so"
  109. # The nlist binary in the tests uses explicitly minimal compiler flags
  110. INSANE_SKIP_${PN}-ptest += "ldflags"
  111. # avoid stripping some generated binaries otherwise some of the tests such as test-nlist,
  112. # run-strip-reloc.sh, run-strip-strmerge.sh and so on will fail
  113. INHIBIT_PACKAGE_STRIP_FILES = "\
  114. ${PKGD}${PTEST_PATH}/tests/test-nlist \
  115. ${PKGD}${PTEST_PATH}/tests/elfstrmerge \
  116. ${PKGD}${PTEST_PATH}/tests/backtrace-child \
  117. ${PKGD}${PTEST_PATH}/tests/backtrace-data \
  118. ${PKGD}${PTEST_PATH}/tests/backtrace-dwarf \
  119. ${PKGD}${PTEST_PATH}/tests/deleted \
  120. ${PKGD}${PTEST_PATH}/src/strip \
  121. ${PKGD}${PTEST_PATH}/src/addr2line \
  122. ${PKGD}${PTEST_PATH}/src/elfcmp \
  123. ${PKGD}${PTEST_PATH}/src/objdump \
  124. ${PKGD}${PTEST_PATH}/src/readelf \
  125. ${PKGD}${PTEST_PATH}/src/nm \
  126. ${PKGD}${PTEST_PATH}/src/elflint \
  127. ${PKGD}${PTEST_PATH}/src/elfclassify \
  128. ${PKGD}${PTEST_PATH}/src/stack \
  129. ${PKGD}${PTEST_PATH}/src/unstrip \
  130. ${PKGD}${PTEST_PATH}/libelf/libelf.so \
  131. ${PKGD}${PTEST_PATH}/libdw/libdw.so \
  132. ${PKGD}${PTEST_PATH}/libasm/libasm.so \
  133. ${PKGD}${PTEST_PATH}/backends/libebl_i386.so \
  134. ${PKGD}${PTEST_PATH}/backends/libebl_x86_64.so \
  135. "
  136. PRIVATE_LIBS_${PN}-ptest = "libdw.so.1 libelf.so.1 libasm.so.1"