blob: e7740c7fb46f734fdf2943ff7cff2a57e8c44298 [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"
Brad Bishop64c979e2019-11-04 13:55:29 -05006DEPENDS = "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:
Brad Bishopa34c0302019-09-23 22:34:48 -04009# http://ftp.de.debian.org/debian/pool/main/e/elfutils/elfutils_0.176-1.debian.tar.xz
Brad Bishop19323692019-04-05 15:28:33 -040010SRC_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 \
Brad Bishopa34c0302019-09-23 22:34:48 -040031 file://debian/mips_cfi.patch \
32 file://debian/0001-fix-compile-failure-with-debian-patches.patch \
Brad Bishopc342db32019-05-15 21:57:59 -040033 file://0001-skip-the-test-when-gcc-not-deployed.patch \
Brad Bishopa34c0302019-09-23 22:34:48 -040034 file://0001-ppc_initreg.c-Incliude-asm-ptrace.h-for-pt_regs-defi.patch \
Brad Bishopc342db32019-05-15 21:57:59 -040035 file://run-ptest \
36 file://ptest.patch \
Brad Bishop19323692019-04-05 15:28:33 -040037 "
Brad Bishop96ff1982019-08-19 13:50:42 -040038SRC_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 Bishopa34c0302019-09-23 22:34:48 -040044SRC_URI[md5sum] = "0b583722f911e1632544718d502aab87"
45SRC_URI[sha256sum] = "fa489deccbcae7d8c920f60d85906124c1989c591196d90e0fd668e3dc05042e"
Brad Bishop19323692019-04-05 15:28:33 -040046
Brad Bishopc342db32019-05-15 21:57:59 -040047inherit autotools gettext ptest
Brad Bishop19323692019-04-05 15:28:33 -040048
Brad Bishop64c979e2019-11-04 13:55:29 -050049EXTRA_OECONF = "--program-prefix=eu-"
50
51DEPENDS_BZIP2 = "bzip2-replacement-native"
52DEPENDS_BZIP2_class-target = "bzip2"
53
54PACKAGECONFIG ??= ""
55PACKAGECONFIG[bzip2] = "--with-bzlib,--without-bzlib,${DEPENDS_BZIP2}"
56PACKAGECONFIG[xz] = "--with-lzma,--without-lzma,xz"
57
Brad Bishop15ae2502019-06-18 21:44:24 -040058RDEPENDS_${PN}-ptest += "libasm libelf bash make coreutils ${PN}-binutils"
Brad Bishopc342db32019-05-15 21:57:59 -040059
60EXTRA_OECONF_append_class-target += "--disable-tests-rpath"
Brad Bishop19323692019-04-05 15:28:33 -040061
62do_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 Bishopc342db32019-05-15 21:57:59 -040068do_compile_ptest() {
69 cd ${B}/tests
70 oe_runmake buildtest-TESTS oecheck
71}
72
73do_install_ptest() {
74 if [ ${PTEST_ENABLED} = "1" ]; then
Brad Bishop15ae2502019-06-18 21:44:24 -040075 # 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 Bishopc342db32019-05-15 21:57:59 -040087 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 Bishop19323692019-04-05 15:28:33 -040096EXTRA_OEMAKE_class-native = ""
97EXTRA_OEMAKE_class-nativesdk = ""
98
Brad Bishop19323692019-04-05 15:28:33 -040099BBCLASSEXTEND = "native nativesdk"
100
101# Package utilities separately
102PACKAGES =+ "${PN}-binutils libelf libasm libdw"
Brad Bishopc342db32019-05-15 21:57:59 -0400103
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."
109LICENSE_${PN}-binutils = "GPLv3+"
110LICENSE_${PN} = "GPLv3+"
111LICENSE_libelf = "GPLv2 | LGPLv3+"
112LICENSE_libasm = "GPLv2 | LGPLv3+"
113LICENSE_libdw = "GPLv2 | LGPLv3+"
114
Brad Bishop19323692019-04-05 15:28:33 -0400115FILES_${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
123FILES_libelf = "${libdir}/libelf-${PV}.so ${libdir}/libelf.so.*"
124FILES_libasm = "${libdir}/libasm-${PV}.so ${libdir}/libasm.so.*"
125FILES_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
132INSANE_SKIP_${MLPREFIX}libdw = "dev-so"
Brad Bishop15ae2502019-06-18 21:44:24 -0400133
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
136INHIBIT_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 Bishop08902b02019-08-20 09:16:51 -0400155PRIVATE_LIBS_${PN}-ptest = "libdw.so.1 libelf.so.1"