Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 1 | require binutils.inc |
| 2 | require binutils-${PV}.inc |
| 3 | |
| 4 | DEPENDS += "flex bison 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 | EXTRA_OECONF_class-native = "--enable-targets=all \ |
| 18 | --enable-64-bit-bfd \ |
| 19 | --enable-install-libiberty \ |
| 20 | --enable-install-libbfd \ |
| 21 | --disable-gdb \ |
| 22 | --disable-gdbserver \ |
| 23 | --disable-libdecnumber \ |
| 24 | --disable-readline \ |
| 25 | --disable-sim \ |
| 26 | --disable-werror" |
| 27 | |
Andrew Geissler | 90fd73c | 2021-03-05 15:25:55 -0600 | [diff] [blame] | 28 | PACKAGECONFIG ??= "" |
| 29 | PACKAGECONFIG[debuginfod] = "--with-debuginfod, --without-debuginfod, elfutils" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 30 | # gcc9.0 end up mis-compiling libbfd.so with O2 which then crashes on target |
| 31 | # So remove -O2 and use -Os as workaround |
| 32 | SELECTED_OPTIMIZATION_remove_mipsarch = "-O2" |
| 33 | SELECTED_OPTIMIZATION_append_mipsarch = " -Os" |
| 34 | |
| 35 | do_install_class-native () { |
| 36 | autotools_do_install |
| 37 | |
| 38 | # Install the libiberty header |
| 39 | install -d ${D}${includedir} |
| 40 | install -m 644 ${S}/include/ansidecl.h ${D}${includedir} |
| 41 | install -m 644 ${S}/include/libiberty.h ${D}${includedir} |
| 42 | |
| 43 | # We only want libiberty, libbfd and libopcodes |
| 44 | rm -rf ${D}${bindir} |
| 45 | rm -rf ${D}${prefix}/${TARGET_SYS} |
| 46 | rm -rf ${D}${prefix}/lib/ldscripts |
| 47 | rm -rf ${D}${prefix}/share/info |
| 48 | rm -rf ${D}${prefix}/share/locale |
| 49 | rm -rf ${D}${prefix}/share/man |
| 50 | rmdir ${D}${prefix}/share || : |
| 51 | rmdir ${D}/${libdir}/gcc-lib || : |
| 52 | rmdir ${D}/${libdir}64/gcc-lib || : |
| 53 | rmdir ${D}/${libdir} || : |
| 54 | rmdir ${D}/${libdir}64 || : |
| 55 | } |
| 56 | |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 57 | # libctf races with libbfd |
| 58 | PARALLEL_MAKEINST_class-target = "" |
| 59 | PARALLEL_MAKEINST_class-nativesdk = "" |
| 60 | |
| 61 | # Split out libbfd-*.so and libopcodes-*.so so including perf doesn't include |
| 62 | # extra stuff |
| 63 | PACKAGE_BEFORE_PN += "libbfd libopcodes" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 64 | FILES_libbfd = "${libdir}/libbfd-*.so.* ${libdir}/libbfd-*.so" |
Andrew Geissler | d1e8949 | 2021-02-12 15:35:20 -0600 | [diff] [blame] | 65 | FILES_libopcodes = "${libdir}/libopcodes-*.so.* ${libdir}/libopcodes-*.so" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 66 | |
| 67 | SRC_URI_append_class-nativesdk = " file://0003-binutils-nativesdk-Search-for-alternative-ld.so.conf.patch " |
| 68 | |
| 69 | USE_ALTERNATIVES_FOR_class-nativesdk = "" |
| 70 | FILES_${PN}_append_class-nativesdk = " ${bindir}" |
| 71 | |
| 72 | BBCLASSEXTEND = "native nativesdk" |
| 73 | |