blob: 5b8049f531e929344509513d3e788aeed49b434a [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"
7DEPENDS_append_libc-musl = " argp-standalone fts "
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
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 \
34 file://musl.patch \
Brad Bishop19323692019-04-05 15:28:33 -040035 "
Brad Bishopc342db32019-05-15 21:57:59 -040036SRC_URI_append_libc-musl = " file://0008-build-Provide-alternatives-for-glibc-assumptions-hel.patch \
37 file://0001-fix-err-variable-and-function-conflicts.patch \
38"
Brad Bishop19323692019-04-05 15:28:33 -040039
40SRC_URI[md5sum] = "077e4f49320cad82bf17a997068b1db9"
41SRC_URI[sha256sum] = "eb5747c371b0af0f71e86215a5ebb88728533c3a104a43d4231963f308cd1023"
42
Brad Bishopc342db32019-05-15 21:57:59 -040043inherit autotools gettext ptest
Brad Bishop19323692019-04-05 15:28:33 -040044
45EXTRA_OECONF = "--program-prefix=eu- --without-lzma"
46EXTRA_OECONF_append_class-native = " --without-bzlib"
Brad Bishop15ae2502019-06-18 21:44:24 -040047RDEPENDS_${PN}-ptest += "libasm libelf bash make coreutils ${PN}-binutils"
Brad Bishopc342db32019-05-15 21:57:59 -040048
49EXTRA_OECONF_append_class-target += "--disable-tests-rpath"
Brad Bishop19323692019-04-05 15:28:33 -040050
51do_install_append() {
52 if [ "${TARGET_ARCH}" != "x86_64" ] && [ -z `echo "${TARGET_ARCH}"|grep 'i.86'` ];then
53 rm -f ${D}${bindir}/eu-objdump
54 fi
55}
56
Brad Bishopc342db32019-05-15 21:57:59 -040057do_compile_ptest() {
58 cd ${B}/tests
59 oe_runmake buildtest-TESTS oecheck
60}
61
62do_install_ptest() {
63 if [ ${PTEST_ENABLED} = "1" ]; then
Brad Bishop15ae2502019-06-18 21:44:24 -040064 # copy the files which needed by the cases
65 TEST_FILES="strip strip.o addr2line elfcmp objdump readelf size.o nm.o nm elflint"
66 install -d -m 755 ${D}${PTEST_PATH}/src
67 install -d -m 755 ${D}${PTEST_PATH}/libelf
68 install -d -m 755 ${D}${PTEST_PATH}/libdw
69 for test_file in ${TEST_FILES}; do
70 if [ -f ${B}/src/${test_file} ]; then
71 cp -r ${B}/src/${test_file} ${D}${PTEST_PATH}/src
72 fi
73 done
74 cp ${D}${libdir}/libelf-${PV}.so ${D}${PTEST_PATH}/libelf/libelf.so
75 cp ${D}${libdir}/libdw-${PV}.so ${D}${PTEST_PATH}/libdw/libdw.so
Brad Bishopc342db32019-05-15 21:57:59 -040076 cp -r ${S}/tests/ ${D}${PTEST_PATH}
77 cp -r ${B}/tests/* ${D}${PTEST_PATH}/tests
78 cp -r ${B}/config.h ${D}${PTEST_PATH}
79 cp -r ${B}/backends ${D}${PTEST_PATH}
80 sed -i '/^Makefile:/c Makefile:' ${D}${PTEST_PATH}/tests/Makefile
81 find ${D}${PTEST_PATH} -type f -name *.[hoc] | xargs -i rm {}
82 fi
83}
84
Brad Bishop19323692019-04-05 15:28:33 -040085EXTRA_OEMAKE_class-native = ""
86EXTRA_OEMAKE_class-nativesdk = ""
87
88ALLOW_EMPTY_${PN}_libc-musl = "1"
89
90BBCLASSEXTEND = "native nativesdk"
91
92# Package utilities separately
93PACKAGES =+ "${PN}-binutils libelf libasm libdw"
Brad Bishopc342db32019-05-15 21:57:59 -040094
95# shared libraries are licensed GPLv2 or GPLv3+, binaries GPLv3+
96# according to NEWS file:
97# "The license is now GPLv2/LGPLv3+ for the libraries and GPLv3+ for stand-alone
98# programs. There is now also a formal CONTRIBUTING document describing how to
99# submit patches."
100LICENSE_${PN}-binutils = "GPLv3+"
101LICENSE_${PN} = "GPLv3+"
102LICENSE_libelf = "GPLv2 | LGPLv3+"
103LICENSE_libasm = "GPLv2 | LGPLv3+"
104LICENSE_libdw = "GPLv2 | LGPLv3+"
105
Brad Bishop19323692019-04-05 15:28:33 -0400106FILES_${PN}-binutils = "\
107 ${bindir}/eu-addr2line \
108 ${bindir}/eu-ld \
109 ${bindir}/eu-nm \
110 ${bindir}/eu-readelf \
111 ${bindir}/eu-size \
112 ${bindir}/eu-strip"
113
114FILES_libelf = "${libdir}/libelf-${PV}.so ${libdir}/libelf.so.*"
115FILES_libasm = "${libdir}/libasm-${PV}.so ${libdir}/libasm.so.*"
116FILES_libdw = "${libdir}/libdw-${PV}.so ${libdir}/libdw.so.* ${libdir}/elfutils/lib*"
117# Some packages have the version preceeding the .so instead properly
118# versioned .so.<version>, so we need to reorder and repackage.
119#FILES_${PN} += "${libdir}/*-${PV}.so ${base_libdir}/*-${PV}.so"
120#FILES_SOLIBSDEV = "${libdir}/libasm.so ${libdir}/libdw.so ${libdir}/libelf.so"
121
122# The package contains symlinks that trip up insane
123INSANE_SKIP_${MLPREFIX}libdw = "dev-so"
Brad Bishop15ae2502019-06-18 21:44:24 -0400124
125# avoid stripping some generated binaries otherwise some of the tests such as test-nlist,
126# run-strip-reloc.sh, run-strip-strmerge.sh and so on will fail
127INHIBIT_PACKAGE_STRIP_FILES = "\
128 ${PKGD}${PTEST_PATH}/tests/test-nlist \
129 ${PKGD}${PTEST_PATH}/tests/elfstrmerge \
130 ${PKGD}${PTEST_PATH}/tests/backtrace-child \
131 ${PKGD}${PTEST_PATH}/tests/backtrace-data \
132 ${PKGD}${PTEST_PATH}/tests/deleted \
133 ${PKGD}${PTEST_PATH}/src/strip \
134 ${PKGD}${PTEST_PATH}/src/addr2line \
135 ${PKGD}${PTEST_PATH}/src/elfcmp \
136 ${PKGD}${PTEST_PATH}/src/objdump \
137 ${PKGD}${PTEST_PATH}/src/readelf \
138 ${PKGD}${PTEST_PATH}/src/nm \
139 ${PKGD}${PTEST_PATH}/src/elflint \
140 ${PKGD}${PTEST_PATH}/libelf/libelf.so \
141 ${PKGD}${PTEST_PATH}/libdw/libdw.so \
142 ${PKGD}${PTEST_PATH}/backends/libebl_i386.so \
143 ${PKGD}${PTEST_PATH}/backends/libebl_x86_64.so \
144"
145
146EXCLUDE_PACKAGES_FROM_SHLIBS = "${PN}-ptest"