diff options
Diffstat (limited to 'meta/recipes-devtools/binutils/binutils.inc')
| -rw-r--r-- | meta/recipes-devtools/binutils/binutils.inc | 97 |
1 files changed, 61 insertions, 36 deletions
diff --git a/meta/recipes-devtools/binutils/binutils.inc b/meta/recipes-devtools/binutils/binutils.inc index 1e592962ee..7efe13fdf6 100644 --- a/meta/recipes-devtools/binutils/binutils.inc +++ b/meta/recipes-devtools/binutils/binutils.inc @@ -1,4 +1,4 @@ -SUMMARY = "A GNU collection of binary utilities" +SUMMARY = "GNU binary utilities" DESCRIPTION = "The GNU Binutils are a collection of binary tools. \ The main ones are ld (GNU Linker), and as (GNU Assembler). This \ package also includes addition tools such as addr2line (Converts \ @@ -11,16 +11,23 @@ BUGTRACKER = "http://sourceware.org/bugzilla/" SECTION = "devel" LICENSE = "GPLv3" -DEPENDS = "flex-native bison-native zlib-native" +DEPENDS = "flex-native bison-native zlib-native gnu-config-native autoconf-native" -inherit autotools gettext multilib_header +# +# we need chrpath > 0.14 and some distros like centos 7 still have older chrpath +# +DEPENDS_append_class-target = " chrpath-replacement-native" +EXTRANATIVEPATH_append_class-target = " chrpath-native" -PACKAGES += "${PN}-symlinks" +inherit autotools gettext multilib_header texinfo FILES_${PN} = " \ ${bindir}/${TARGET_PREFIX}* \ ${libdir}/lib*-*.so \ - ${prefix}/${TARGET_SYS}/bin/*" + ${prefix}/${TARGET_SYS}/bin/* \ + ${bindir}/embedspu" + +RPROVIDES_${PN} += "${PN}-symlinks" FILES_${PN}-dev = " \ ${includedir} \ @@ -28,33 +35,51 @@ FILES_${PN}-dev = " \ ${libdir}/libbfd.so \ ${libdir}/libopcodes.so" -FILES_${PN}-symlinks = " \ - ${bindir}/addr2line \ - ${bindir}/as \ - ${bindir}/c++filt \ - ${bindir}/embedspu \ - ${bindir}/gprof \ - ${bindir}/ld \ - ${bindir}/ld.bfd \ - ${bindir}/ld.gold \ - ${bindir}/nm \ - ${bindir}/objcopy \ - ${bindir}/objdump \ - ${bindir}/ranlib \ - ${bindir}/readelf \ - ${bindir}/elfedit \ - ${bindir}/size \ - ${bindir}/strip" - -FILES_${PN}-dbg += "${prefix}/${TARGET_SYS}/bin/.debug" +# Rather than duplicating multiple entries for these, make one +# list and reuse it. + +USE_ALTERNATIVES_FOR = " \ + addr2line \ + ar \ + as \ + c++filt \ + elfedit \ + gprof \ + ld \ + ld.bfd \ + ld.gold dwp \ + nm \ + objcopy \ + objdump \ + ranlib \ + readelf \ + size \ + strings \ + strip \ +" + +python do_package_prepend() { + 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) +} B = "${S}/build.${HOST_SYS}.${TARGET_SYS}" EXTRA_OECONF = "--program-prefix=${TARGET_PREFIX} \ --disable-werror \ - --enable-plugins \ - ${@base_contains('DISTRO_FEATURES', 'ld-is-gold', '--enable-gold=default --enable-threads', '', d)} \ - ${@base_contains('DISTRO_FEATURES', 'multiarch', '--enable-64-bit-bfd', '', d)}" + --enable-deterministic-archives \ + --enable-plugins \ + ${LDGOLD} \ + ${@bb.utils.contains('DISTRO_FEATURES', 'multiarch', '--enable-64-bit-bfd', '', d)}" + +LDGOLD_class-native = "" +LDGOLD_class-crosssdk = "" +LDGOLD_sdkmingw32 = "" +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" @@ -90,10 +115,14 @@ do_configure () { # mkdir -p ${B}/build-${BUILD_SYS} for i in ${CONFIG_SITE}; do - cat $i >> ${B}/build-${BUILD_SYS}/config.cache + cat $i >> ${B}/build-${BUILD_SYS}/config.cache || true done } +do_compile_append_class-target() { + chrpath -d ${B}/binutils/elfedit + chrpath -d ${B}/binutils/readelf +} do_install () { autotools_do_install @@ -120,7 +149,9 @@ do_install () { ln -sf $p `echo $p | sed -e s,${TARGET_PREFIX},,` done - rm -f ${D}${bindir}/ar ${D}${bindir}/strings + for alt in ${USE_ALTERNATIVES_FOR}; do + rm -f ${D}${bindir}/$alt + done oe_multilib_header bfd.h } @@ -129,10 +160,4 @@ inherit update-alternatives ALTERNATIVE_PRIORITY = "100" -ALTERNATIVE_${PN}-symlinks = "ar strings" - -ALTERNATIVE_LINK_NAME[ar] = "${bindir}/ar" -ALTERNATIVE_TARGET[ar] = "${bindir}/${TARGET_PREFIX}ar" - -ALTERNATIVE_LINK_NAME[strings] = "${bindir}/strings" -ALTERNATIVE_TARGET[strings] = "${bindir}/${TARGET_PREFIX}strings" +ALTERNATIVE_${PN}_class-target = "${USE_ALTERNATIVES_FOR}" |
