blob: d98457e3f9f278cfabe2398ff61e150a93fdefbf [file] [log] [blame]
Brad Bishop19323692019-04-05 15:28:33 -04001SUMMARY = "Utilities and libraries for handling compiled object files"
2HOMEPAGE = "https://sourceware.org/elfutils"
3SECTION = "base"
Brad Bishopc342db32019-05-15 21:57:59 -04004LICENSE = "GPLv2 & LGPLv3+ & GPLv3+"
Brad Bishop19323692019-04-05 15:28:33 -04005LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
6DEPENDS = "libtool bzip2 zlib virtual/libintl"
Brad Bishop96ff1982019-08-19 13:50:42 -04007DEPENDS_append_libc-musl = " argp-standalone fts musl-obstack "
Brad Bishop19323692019-04-05 15:28:33 -04008# The Debian patches below are from:
9# http://ftp.de.debian.org/debian/pool/main/e/elfutils/elfutils_0.175-1.debian.tar.xz
10SRC_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 Bishopc342db32019-05-15 21:57:59 -040030 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 Bishop19323692019-04-05 15:28:33 -040034 "
Brad Bishop96ff1982019-08-19 13:50:42 -040035SRC_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 Bishop19323692019-04-05 15:28:33 -040041SRC_URI[md5sum] = "077e4f49320cad82bf17a997068b1db9"
42SRC_URI[sha256sum] = "eb5747c371b0af0f71e86215a5ebb88728533c3a104a43d4231963f308cd1023"
43
Brad Bishopc342db32019-05-15 21:57:59 -040044inherit autotools gettext ptest
Brad Bishop19323692019-04-05 15:28:33 -040045
46EXTRA_OECONF = "--program-prefix=eu- --without-lzma"
47EXTRA_OECONF_append_class-native = " --without-bzlib"
Brad Bishop15ae2502019-06-18 21:44:24 -040048RDEPENDS_${PN}-ptest += "libasm libelf bash make coreutils ${PN}-binutils"
Brad Bishopc342db32019-05-15 21:57:59 -040049
50EXTRA_OECONF_append_class-target += "--disable-tests-rpath"
Brad Bishop19323692019-04-05 15:28:33 -040051
52do_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 Bishopc342db32019-05-15 21:57:59 -040058do_compile_ptest() {
59 cd ${B}/tests
60 oe_runmake buildtest-TESTS oecheck
61}
62
63do_install_ptest() {
64 if [ ${PTEST_ENABLED} = "1" ]; then
Brad Bishop15ae2502019-06-18 21:44:24 -040065 # 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 Bishopc342db32019-05-15 21:57:59 -040077 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 Bishop19323692019-04-05 15:28:33 -040086EXTRA_OEMAKE_class-native = ""
87EXTRA_OEMAKE_class-nativesdk = ""
88
Brad Bishop19323692019-04-05 15:28:33 -040089BBCLASSEXTEND = "native nativesdk"
90
91# Package utilities separately
92PACKAGES =+ "${PN}-binutils libelf libasm libdw"
Brad Bishopc342db32019-05-15 21:57:59 -040093
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."
99LICENSE_${PN}-binutils = "GPLv3+"
100LICENSE_${PN} = "GPLv3+"
101LICENSE_libelf = "GPLv2 | LGPLv3+"
102LICENSE_libasm = "GPLv2 | LGPLv3+"
103LICENSE_libdw = "GPLv2 | LGPLv3+"
104
Brad Bishop19323692019-04-05 15:28:33 -0400105FILES_${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
113FILES_libelf = "${libdir}/libelf-${PV}.so ${libdir}/libelf.so.*"
114FILES_libasm = "${libdir}/libasm-${PV}.so ${libdir}/libasm.so.*"
115FILES_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
122INSANE_SKIP_${MLPREFIX}libdw = "dev-so"
Brad Bishop15ae2502019-06-18 21:44:24 -0400123
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
126INHIBIT_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 Bishop08902b02019-08-20 09:16:51 -0400145PRIVATE_LIBS_${PN}-ptest = "libdw.so.1 libelf.so.1"