summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/binutils/binutils.inc
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/binutils/binutils.inc')
-rw-r--r--meta/recipes-devtools/binutils/binutils.inc65
1 files changed, 36 insertions, 29 deletions
diff --git a/meta/recipes-devtools/binutils/binutils.inc b/meta/recipes-devtools/binutils/binutils.inc
index 81891963c8..00b1301258 100644
--- a/meta/recipes-devtools/binutils/binutils.inc
+++ b/meta/recipes-devtools/binutils/binutils.inc
@@ -9,23 +9,23 @@ object information), and other tools and related libraries."
9HOMEPAGE = "http://www.gnu.org/software/binutils/" 9HOMEPAGE = "http://www.gnu.org/software/binutils/"
10BUGTRACKER = "http://sourceware.org/bugzilla/" 10BUGTRACKER = "http://sourceware.org/bugzilla/"
11SECTION = "devel" 11SECTION = "devel"
12LICENSE = "GPLv3" 12LICENSE = "GPL-3.0-only"
13 13
14DEPENDS = "flex-native bison-native zlib-native gnu-config-native autoconf-native" 14DEPENDS = "flex-native bison-native zlib-native gnu-config-native autoconf-native"
15 15
16inherit autotools gettext multilib_header texinfo 16inherit autotools gettext multilib_header pkgconfig texinfo
17 17
18FILES_${PN} = " \ 18FILES:${PN} = " \
19 ${bindir}/${TARGET_PREFIX}* \ 19 ${bindir}/${TARGET_PREFIX}* \
20 ${libdir}/lib*.so.* \ 20 ${libdir}/lib*.so.* \
21 ${libdir}/bfd-plugins/lib*.so \ 21 ${libdir}/bfd-plugins/lib*${SOLIBSDEV} \
22 ${libdir}/lib*-${PV}*.so \ 22 ${libdir}/lib*-${PV}*.so \
23 ${prefix}/${TARGET_SYS}/bin/* \ 23 ${prefix}/${TARGET_SYS}/bin/* \
24 ${bindir}/embedspu" 24 ${bindir}/embedspu"
25 25
26RPROVIDES_${PN} += "${PN}-symlinks" 26RPROVIDES:${PN} += "${PN}-symlinks"
27 27
28FILES_${PN}-dev = " \ 28FILES:${PN}-dev = " \
29 ${includedir} \ 29 ${includedir} \
30 ${libdir}/*.la \ 30 ${libdir}/*.la \
31 ${libdir}/libbfd.so \ 31 ${libdir}/libbfd.so \
@@ -33,13 +33,28 @@ FILES_${PN}-dev = " \
33 ${libdir}/libctf-nobfd.so \ 33 ${libdir}/libctf-nobfd.so \
34 ${libdir}/libopcodes.so" 34 ${libdir}/libopcodes.so"
35 35
36FILES:${PN}-staticdev += "${libdir}/gprofng/*.a"
37
36# Rather than duplicating multiple entries for these, make one 38# Rather than duplicating multiple entries for these, make one
37# list and reuse it. 39# list and reuse it.
38 40
39LDGOLD_ALTS ?= "ld.gold dwp" 41GPROFNGS = " \
40LDGOLD_ALTS_riscv64 = "" 42 gprofng-archive \
41LDGOLD_ALTS_riscv32 = "" 43 gprofng-collect-app \
42LDGOLD_ALTS_libc-glibc_mipsarch = "" 44 gprofng-display-html \
45 gprofng-display-src \
46 gprofng-display-text \
47 gprofng \
48"
49
50# it disables gprofng for clang and musl in the bb file
51GPROFNGS:toolchain-clang = ""
52GPROFNGS:libc-musl = ""
53
54GPROFNG_ALTS ?= ""
55GPROFNG_ALTS:x86 = "${GPROFNGS}"
56GPROFNG_ALTS:x86-64 = "${GPROFNGS}"
57GPROFNG_ALTS:aarch64 = "${GPROFNGS}"
43 58
44USE_ALTERNATIVES_FOR = " \ 59USE_ALTERNATIVES_FOR = " \
45 addr2line \ 60 addr2line \
@@ -48,9 +63,9 @@ USE_ALTERNATIVES_FOR = " \
48 c++filt \ 63 c++filt \
49 elfedit \ 64 elfedit \
50 gprof \ 65 gprof \
66 ${GPROFNG_ALTS} \
51 ld \ 67 ld \
52 ld.bfd \ 68 ld.bfd \
53 ${LDGOLD_ALTS} \
54 nm \ 69 nm \
55 objcopy \ 70 objcopy \
56 objdump \ 71 objdump \
@@ -61,7 +76,7 @@ USE_ALTERNATIVES_FOR = " \
61 strip \ 76 strip \
62" 77"
63 78
64python do_package_prepend() { 79python do_package:prepend() {
65 make_alts = d.getVar("USE_ALTERNATIVES_FOR") or "" 80 make_alts = d.getVar("USE_ALTERNATIVES_FOR") or ""
66 prefix = d.getVar("TARGET_PREFIX") 81 prefix = d.getVar("TARGET_PREFIX")
67 bindir = d.getVar("bindir") 82 bindir = d.getVar("bindir")
@@ -76,24 +91,19 @@ EXTRA_OECONF = "--program-prefix=${TARGET_PREFIX} \
76 --disable-werror \ 91 --disable-werror \
77 --enable-deterministic-archives \ 92 --enable-deterministic-archives \
78 --enable-plugins \ 93 --enable-plugins \
94 --enable-new-dtags \
79 --disable-gdb \ 95 --disable-gdb \
80 --disable-gdbserver \ 96 --disable-gdbserver \
81 --disable-libdecnumber \ 97 --disable-libdecnumber \
82 --disable-readline \ 98 --disable-readline \
83 --disable-sim \ 99 --disable-sim \
84 ${LDGOLD} \ 100 --disable-gold \
85 ${EXTRA_TARGETS} \ 101 ${EXTRA_TARGETS} \
86 ${@bb.utils.contains('DISTRO_FEATURES', 'multiarch', '--enable-64-bit-bfd', '', d)}" 102 ${@bb.utils.contains('DISTRO_FEATURES', 'multiarch', '--enable-64-bit-bfd', '', d)}"
87 103
88EXTRA_TARGETS = "" 104EXTRA_TARGETS = ""
89EXTRA_TARGETS_x86-64 = " --enable-targets=x86_64-pe,x86_64-pep " 105EXTRA_TARGETS:x86-64 = " --enable-targets=x86_64-pe,x86_64-pep "
90EXTRA_TARGETS_class-native = "" 106EXTRA_TARGETS:class-native = ""
91
92LDGOLD_class-native = ""
93LDGOLD_class-crosssdk = ""
94LDGOLD_libc-glibc_mipsarch = ""
95LDGOLD ?= "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', '--enable-gold=default --enable-threads', '--enable-gold --enable-ld=default --enable-threads', d)}"
96
97 107
98# This is necessary due to a bug in the binutils Makefiles 108# This is necessary due to a bug in the binutils Makefiles
99# EXTRA_OEMAKE = "configure-build-libiberty all" 109# EXTRA_OEMAKE = "configure-build-libiberty all"
@@ -168,19 +178,16 @@ do_install () {
168 for alt in ${USE_ALTERNATIVES_FOR}; do 178 for alt in ${USE_ALTERNATIVES_FOR}; do
169 rm -f ${D}${bindir}/$alt 179 rm -f ${D}${bindir}/$alt
170 done 180 done
181 # remove old pre 2.44 release gprofng binary names
182 for f in gp-archive gp-collect-app gp-display-html gp-display-src gp-display-text; do
183 rm -f ${D}${bindir}/$f
184 done
171 185
172 oe_multilib_header bfd.h 186 oe_multilib_header bfd.h
173 # bfd_stdint.h encodes the compiler name in the header
174 sed -i ${D}${includedir}/bfd_stdint.h -e "s,${TARGET_PREFIX},,"
175} 187}
176 188
177inherit update-alternatives 189inherit update-alternatives
178 190
179ALTERNATIVE_PRIORITY = "100" 191ALTERNATIVE_PRIORITY = "100"
180 192
181ALTERNATIVE_${PN}_class-target = "${USE_ALTERNATIVES_FOR}" 193ALTERNATIVE:${PN}:class-target = "${USE_ALTERNATIVES_FOR}"
182
183python () {
184 if bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', True, False, d) and bb.utils.contains_any('TARGET_ARCH', 'riscv32 riscv64', True, False, d):
185 bb.fatal("Gold linker does not _yet_ support RISC-V architecture please remove ld-is-gold from DISTRO_FEATURES")
186}