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.inc19
1 files changed, 11 insertions, 8 deletions
diff --git a/meta/recipes-devtools/binutils/binutils.inc b/meta/recipes-devtools/binutils/binutils.inc
index 75d190f802..0fb6cae407 100644
--- a/meta/recipes-devtools/binutils/binutils.inc
+++ b/meta/recipes-devtools/binutils/binutils.inc
@@ -38,6 +38,9 @@ FILES_${PN}-dev = " \
# Rather than duplicating multiple entries for these, make one
# list and reuse it.
+LDGOLD_ALTS ?= "ld.gold dwp"
+LDGOLD_ALTS_riscv64 = ""
+
USE_ALTERNATIVES_FOR = " \
addr2line \
ar \
@@ -47,7 +50,7 @@ USE_ALTERNATIVES_FOR = " \
gprof \
ld \
ld.bfd \
- ld.gold dwp \
+ ${LDGOLD_ALTS} \
nm \
objcopy \
objdump \
@@ -59,9 +62,9 @@ USE_ALTERNATIVES_FOR = " \
"
python do_package_prepend() {
- make_alts = d.getVar("USE_ALTERNATIVES_FOR", True) or ""
- prefix = d.getVar("TARGET_PREFIX", True)
- bindir = d.getVar("bindir", True)
+ make_alts = d.getVar("USE_ALTERNATIVES_FOR") or ""
+ prefix = d.getVar("TARGET_PREFIX")
+ bindir = d.getVar("bindir")
for alt in make_alts.split():
d.setVarFlag('ALTERNATIVE_TARGET', alt, bindir + "/" + prefix + alt)
d.setVarFlag('ALTERNATIVE_LINK_NAME', alt, bindir + "/" + alt)
@@ -78,7 +81,7 @@ EXTRA_OECONF = "--program-prefix=${TARGET_PREFIX} \
LDGOLD_class-native = ""
LDGOLD_class-crosssdk = ""
-LDGOLD ?= "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', '--enable-gold=default --enable-threads', '--enable-gold --enable-ld=default', d)}"
+LDGOLD ?= "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', '--enable-gold=default --enable-threads', '--enable-gold --enable-ld=default --enable-threads', d)}"
# This is necessary due to a bug in the binutils Makefiles
# EXTRA_OEMAKE = "configure-build-libiberty all"
@@ -128,12 +131,12 @@ do_install () {
# We don't really need these, so we'll remove them...
rm -rf ${D}${libdir}/ldscripts
+ bindir_rel=${@os.path.relpath('${bindir}', '${prefix}/${TARGET_SYS}/bin')}
+
# Fix the /usr/${TARGET_SYS}/bin/* links
for l in ${D}${prefix}/${TARGET_SYS}/bin/*; do
rm -f $l
- ln -sf `echo ${prefix}/${TARGET_SYS}/bin \
- | tr -s / \
- | sed -e 's,^/,,' -e 's,[^/]*,..,g'`${bindir}/${TARGET_PREFIX}`basename $l` $l
+ ln -sf $bindir_rel/${TARGET_PREFIX}`basename $l` $l
done
# Install the libiberty header