Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame^] | 1 | require binutils.inc |
| 2 | require binutils-${PV}.inc |
| 3 | |
| 4 | DEPENDS += "zlib" |
| 5 | |
| 6 | EXTRA_OECONF += "--with-sysroot=/ \ |
| 7 | --enable-install-libbfd \ |
| 8 | --enable-install-libiberty \ |
| 9 | --enable-shared \ |
| 10 | --with-system-zlib \ |
| 11 | " |
| 12 | |
| 13 | EXTRA_OEMAKE:append:libc-musl = "\ |
| 14 | gt_cv_func_gnugettext1_libc=yes \ |
| 15 | gt_cv_func_gnugettext2_libc=yes \ |
| 16 | " |
| 17 | # libcollector/collector.c:547:15: error: no member named '__fprintf_chk' in 'struct CollectorUtilFuncs' |
| 18 | EXTRA_OECONF:append:toolchain-clang = " --disable-gprofng" |
| 19 | # | ../../../gprofng/libcollector/../src/collector_module.h:78:13: error: duplicate member 'pwrite' |
| 20 | # | ../../../gprofng/libcollector/dispatcher.c:578:8: error: 'struct sigevent' has no member named '_sigev_un' |
| 21 | EXTRA_OECONF:append:libc-musl = " --disable-gprofng" |
| 22 | |
| 23 | EXTRA_OECONF:class-native = "--enable-targets=all \ |
| 24 | --enable-64-bit-bfd \ |
| 25 | --enable-install-libiberty \ |
| 26 | --enable-install-libbfd \ |
| 27 | --disable-gdb \ |
| 28 | --disable-gdbserver \ |
| 29 | --disable-libdecnumber \ |
| 30 | --disable-readline \ |
| 31 | --disable-sim \ |
| 32 | --disable-werror" |
| 33 | |
| 34 | PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'debuginfod', d)}" |
| 35 | PACKAGECONFIG[debuginfod] = "--with-debuginfod, --without-debuginfod, elfutils" |
| 36 | |
| 37 | do_install:class-native () { |
| 38 | autotools_do_install |
| 39 | |
| 40 | # Install the libiberty header |
| 41 | install -d ${D}${includedir} |
| 42 | install -m 644 ${S}/include/ansidecl.h ${D}${includedir} |
| 43 | install -m 644 ${S}/include/libiberty.h ${D}${includedir} |
| 44 | |
| 45 | # We only want libiberty, libbfd and libopcodes |
| 46 | rm -rf ${D}${bindir} |
| 47 | rm -rf ${D}${prefix}/${TARGET_SYS} |
| 48 | rm -rf ${D}${prefix}/lib/ldscripts |
| 49 | rm -rf ${D}${prefix}/share/info |
| 50 | rm -rf ${D}${prefix}/share/locale |
| 51 | rm -rf ${D}${prefix}/share/man |
| 52 | rmdir ${D}${prefix}/share || : |
| 53 | rmdir ${D}/${libdir}/gcc-lib || : |
| 54 | rmdir ${D}/${libdir}64/gcc-lib || : |
| 55 | rmdir ${D}/${libdir} || : |
| 56 | rmdir ${D}/${libdir}64 || : |
| 57 | } |
| 58 | |
| 59 | # libctf races with libbfd |
| 60 | PARALLEL_MAKEINST:class-target = "" |
| 61 | PARALLEL_MAKEINST:class-nativesdk = "" |
| 62 | |
| 63 | # Split out libbfd-*.so and libopcodes-*.so so including perf doesn't include |
| 64 | # extra stuff |
| 65 | PACKAGE_BEFORE_PN += "libbfd libopcodes gprofng" |
| 66 | FILES:libbfd = "${libdir}/libbfd-*.so.* ${libdir}/libbfd-*.so" |
| 67 | FILES:libopcodes = "${libdir}/libopcodes-*.so.* ${libdir}/libopcodes-*.so" |
| 68 | FILES:gprofng = "${sysconfdir}/gprofng.rc ${libdir}/gprofng/libgp-*.so ${libdir}/gprofng/libgprofng.so.* ${bindir}/gp-* ${bindir}/gprofng" |
| 69 | FILES:${PN}-dev += "${libdir}/gprofng/libgprofng.so" |
| 70 | SRC_URI:append:class-nativesdk = " file://0003-binutils-nativesdk-Search-for-alternative-ld.so.conf.patch " |
| 71 | |
| 72 | USE_ALTERNATIVES_FOR:class-nativesdk = "" |
| 73 | FILES:${PN}:append:class-nativesdk = " ${bindir}" |
| 74 | |
| 75 | BBCLASSEXTEND = "native nativesdk" |