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.inc59
1 files changed, 40 insertions, 19 deletions
diff --git a/meta/recipes-devtools/binutils/binutils.inc b/meta/recipes-devtools/binutils/binutils.inc
index 81891963c8..e176b5cff1 100644
--- a/meta/recipes-devtools/binutils/binutils.inc
+++ b/meta/recipes-devtools/binutils/binutils.inc
@@ -9,13 +9,13 @@ 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*.so \
@@ -23,9 +23,9 @@ FILES_${PN} = " \
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,34 @@ 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
41GPROFNGS = " \
42 gp-archive \
43 gp-collect-app \
44 gp-display-html \
45 gp-display-src \
46 gp-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}"
58
39LDGOLD_ALTS ?= "ld.gold dwp" 59LDGOLD_ALTS ?= "ld.gold dwp"
40LDGOLD_ALTS_riscv64 = "" 60LDGOLD_ALTS:riscv64 = ""
41LDGOLD_ALTS_riscv32 = "" 61LDGOLD_ALTS:riscv32 = ""
42LDGOLD_ALTS_libc-glibc_mipsarch = "" 62LDGOLD_ALTS:loongarch64 = ""
63LDGOLD_ALTS:libc-glibc:mipsarch = ""
43 64
44USE_ALTERNATIVES_FOR = " \ 65USE_ALTERNATIVES_FOR = " \
45 addr2line \ 66 addr2line \
@@ -48,6 +69,7 @@ USE_ALTERNATIVES_FOR = " \
48 c++filt \ 69 c++filt \
49 elfedit \ 70 elfedit \
50 gprof \ 71 gprof \
72 ${GPROFNG_ALTS} \
51 ld \ 73 ld \
52 ld.bfd \ 74 ld.bfd \
53 ${LDGOLD_ALTS} \ 75 ${LDGOLD_ALTS} \
@@ -61,7 +83,7 @@ USE_ALTERNATIVES_FOR = " \
61 strip \ 83 strip \
62" 84"
63 85
64python do_package_prepend() { 86python do_package:prepend() {
65 make_alts = d.getVar("USE_ALTERNATIVES_FOR") or "" 87 make_alts = d.getVar("USE_ALTERNATIVES_FOR") or ""
66 prefix = d.getVar("TARGET_PREFIX") 88 prefix = d.getVar("TARGET_PREFIX")
67 bindir = d.getVar("bindir") 89 bindir = d.getVar("bindir")
@@ -76,6 +98,7 @@ EXTRA_OECONF = "--program-prefix=${TARGET_PREFIX} \
76 --disable-werror \ 98 --disable-werror \
77 --enable-deterministic-archives \ 99 --enable-deterministic-archives \
78 --enable-plugins \ 100 --enable-plugins \
101 --enable-new-dtags \
79 --disable-gdb \ 102 --disable-gdb \
80 --disable-gdbserver \ 103 --disable-gdbserver \
81 --disable-libdecnumber \ 104 --disable-libdecnumber \
@@ -86,12 +109,12 @@ EXTRA_OECONF = "--program-prefix=${TARGET_PREFIX} \
86 ${@bb.utils.contains('DISTRO_FEATURES', 'multiarch', '--enable-64-bit-bfd', '', d)}" 109 ${@bb.utils.contains('DISTRO_FEATURES', 'multiarch', '--enable-64-bit-bfd', '', d)}"
87 110
88EXTRA_TARGETS = "" 111EXTRA_TARGETS = ""
89EXTRA_TARGETS_x86-64 = " --enable-targets=x86_64-pe,x86_64-pep " 112EXTRA_TARGETS:x86-64 = " --enable-targets=x86_64-pe,x86_64-pep "
90EXTRA_TARGETS_class-native = "" 113EXTRA_TARGETS:class-native = ""
91 114
92LDGOLD_class-native = "" 115LDGOLD:class-native = ""
93LDGOLD_class-crosssdk = "" 116LDGOLD:class-crosssdk = ""
94LDGOLD_libc-glibc_mipsarch = "" 117LDGOLD: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)}" 118LDGOLD ?= "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', '--enable-gold=default --enable-threads', '--enable-gold --enable-ld=default --enable-threads', d)}"
96 119
97 120
@@ -170,17 +193,15 @@ do_install () {
170 done 193 done
171 194
172 oe_multilib_header bfd.h 195 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} 196}
176 197
177inherit update-alternatives 198inherit update-alternatives
178 199
179ALTERNATIVE_PRIORITY = "100" 200ALTERNATIVE_PRIORITY = "100"
180 201
181ALTERNATIVE_${PN}_class-target = "${USE_ALTERNATIVES_FOR}" 202ALTERNATIVE:${PN}:class-target = "${USE_ALTERNATIVES_FOR}"
182 203
183python () { 204python () {
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): 205 if bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', True, False, d) and bb.utils.contains_any('TARGET_ARCH', 'riscv32 riscv64 loongarch64', True, False, d):
185 bb.fatal("Gold linker does not _yet_ support RISC-V architecture please remove ld-is-gold from DISTRO_FEATURES") 206 bb.fatal("Gold linker does not _yet_ support RISC-V and LoongArch architecture please remove ld-is-gold from DISTRO_FEATURES")
186} 207}