binutils_2.37.bb 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. require binutils.inc
  2. require binutils-${PV}.inc
  3. DEPENDS += "flex bison zlib"
  4. EXTRA_OECONF += "--with-sysroot=/ \
  5. --enable-install-libbfd \
  6. --enable-install-libiberty \
  7. --enable-shared \
  8. --with-system-zlib \
  9. "
  10. EXTRA_OEMAKE_append_libc-musl = "\
  11. gt_cv_func_gnugettext1_libc=yes \
  12. gt_cv_func_gnugettext2_libc=yes \
  13. "
  14. EXTRA_OECONF_class-native = "--enable-targets=all \
  15. --enable-64-bit-bfd \
  16. --enable-install-libiberty \
  17. --enable-install-libbfd \
  18. --disable-gdb \
  19. --disable-gdbserver \
  20. --disable-libdecnumber \
  21. --disable-readline \
  22. --disable-sim \
  23. --disable-werror"
  24. PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'debuginfod', d)}"
  25. PACKAGECONFIG[debuginfod] = "--with-debuginfod, --without-debuginfod, elfutils"
  26. # gcc9.0 end up mis-compiling libbfd.so with O2 which then crashes on target
  27. # So remove -O2 and use -Os as workaround
  28. SELECTED_OPTIMIZATION_remove_mipsarch = "-O2"
  29. SELECTED_OPTIMIZATION_append_mipsarch = " -Os"
  30. do_install_class-native () {
  31. autotools_do_install
  32. # Install the libiberty header
  33. install -d ${D}${includedir}
  34. install -m 644 ${S}/include/ansidecl.h ${D}${includedir}
  35. install -m 644 ${S}/include/libiberty.h ${D}${includedir}
  36. # We only want libiberty, libbfd and libopcodes
  37. rm -rf ${D}${bindir}
  38. rm -rf ${D}${prefix}/${TARGET_SYS}
  39. rm -rf ${D}${prefix}/lib/ldscripts
  40. rm -rf ${D}${prefix}/share/info
  41. rm -rf ${D}${prefix}/share/locale
  42. rm -rf ${D}${prefix}/share/man
  43. rmdir ${D}${prefix}/share || :
  44. rmdir ${D}/${libdir}/gcc-lib || :
  45. rmdir ${D}/${libdir}64/gcc-lib || :
  46. rmdir ${D}/${libdir} || :
  47. rmdir ${D}/${libdir}64 || :
  48. }
  49. # libctf races with libbfd
  50. PARALLEL_MAKEINST_class-target = ""
  51. PARALLEL_MAKEINST_class-nativesdk = ""
  52. # Split out libbfd-*.so and libopcodes-*.so so including perf doesn't include
  53. # extra stuff
  54. PACKAGE_BEFORE_PN += "libbfd libopcodes"
  55. FILES_libbfd = "${libdir}/libbfd-*.so.* ${libdir}/libbfd-*.so"
  56. FILES_libopcodes = "${libdir}/libopcodes-*.so.* ${libdir}/libopcodes-*.so"
  57. SRC_URI_append_class-nativesdk = " file://0003-binutils-nativesdk-Search-for-alternative-ld.so.conf.patch "
  58. USE_ALTERNATIVES_FOR_class-nativesdk = ""
  59. FILES_${PN}_append_class-nativesdk = " ${bindir}"
  60. BBCLASSEXTEND = "native nativesdk"