blob: 67240383f72cbd2febedb1cf3c3ccaef71b0d9f2 [file] [log] [blame]
Patrick Williams92b42cb2022-09-03 06:53:57 -05001require binutils.inc
2require binutils-${PV}.inc
3
4DEPENDS += "zlib"
5
6EXTRA_OECONF += "--with-sysroot=/ \
7 --enable-install-libbfd \
8 --enable-install-libiberty \
9 --enable-shared \
10 --with-system-zlib \
11 "
12
13EXTRA_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'
18EXTRA_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'
21EXTRA_OECONF:append:libc-musl = " --disable-gprofng"
22
23EXTRA_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
34PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'debuginfod', d)}"
35PACKAGECONFIG[debuginfod] = "--with-debuginfod, --without-debuginfod, elfutils"
36
37do_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
60PARALLEL_MAKEINST:class-target = ""
61PARALLEL_MAKEINST:class-nativesdk = ""
62
63# Split out libbfd-*.so and libopcodes-*.so so including perf doesn't include
64# extra stuff
65PACKAGE_BEFORE_PN += "libbfd libopcodes gprofng"
66FILES:libbfd = "${libdir}/libbfd-*.so.* ${libdir}/libbfd-*.so"
67FILES:libopcodes = "${libdir}/libopcodes-*.so.* ${libdir}/libopcodes-*.so"
68FILES:gprofng = "${sysconfdir}/gprofng.rc ${libdir}/gprofng/libgp-*.so ${libdir}/gprofng/libgprofng.so.* ${bindir}/gp-* ${bindir}/gprofng"
69FILES:${PN}-dev += "${libdir}/gprofng/libgprofng.so"
70SRC_URI:append:class-nativesdk = " file://0003-binutils-nativesdk-Search-for-alternative-ld.so.conf.patch "
71
72USE_ALTERNATIVES_FOR:class-nativesdk = ""
73FILES:${PN}:append:class-nativesdk = " ${bindir}"
74
75BBCLASSEXTEND = "native nativesdk"