summaryrefslogtreecommitdiff
path: root/sys-devel/binutils
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2020-11-25 22:39:15 +0000
committerV3n3RiX <venerix@redcorelinux.org>2020-11-25 22:39:15 +0000
commitd934827bf44b7cfcf6711964418148fa60877668 (patch)
tree0625f358789b5e015e49db139cc1dbc9be00428f /sys-devel/binutils
parent2e34d110f164bf74d55fced27fe0000201b3eec5 (diff)
gentoo resync : 25.11.2020
Diffstat (limited to 'sys-devel/binutils')
-rw-r--r--sys-devel/binutils/Manifest10
-rw-r--r--sys-devel/binutils/binutils-2.32-r1.ebuild9
-rw-r--r--sys-devel/binutils/binutils-2.32-r2.ebuild9
-rw-r--r--sys-devel/binutils/binutils-2.33.1-r1.ebuild9
-rw-r--r--sys-devel/binutils/binutils-2.34-r2.ebuild11
-rw-r--r--sys-devel/binutils/binutils-2.35.1-r1.ebuild437
6 files changed, 444 insertions, 41 deletions
diff --git a/sys-devel/binutils/Manifest b/sys-devel/binutils/Manifest
index 589df2a53e6a..dfd77b10615e 100644
--- a/sys-devel/binutils/Manifest
+++ b/sys-devel/binutils/Manifest
@@ -10,11 +10,13 @@ DIST binutils-2.33.1.tar.xz 21490848 BLAKE2B c336a8412938dc8c224f40a763a8bea9937
DIST binutils-2.34-patches-6.tar.xz 103028 BLAKE2B d0e866d0941d2b550c7d7f23530c6ee393fa13b4f2f27832f07790989476f11d1beddb5ad5a9be5c65c1d4dff9d4598d21adcb00c1d0490f69a99127f4527447 SHA512 e05ed8886acb5cb95a3e97c5bc0564215f7d44b604610f5c4545997fd9625d6de909c37063127e819926cd1548a48d3529dd3e82e98ee6a5dbaced028c57355d
DIST binutils-2.34.tar.xz 21637796 BLAKE2B 07dd23916a7d27f71c3f160c8c16abe2bd4fce294c738c665a012a3be6a87dbe8160d0c38740524f9025e01d438e99b2a94bcf9f9f79ee214f5dd033de8aad3d SHA512 2c7976939dcf5e8c5b7374cccd39bfe803b1bec73c6abfa0eb17c24e1942574c6bdb874c66a092a82adc443182eacd8a5a8001c19a76101f0c7ba40c27de0bbd
DIST binutils-2.35.1-patches-1.tar.xz 10088 BLAKE2B fa4b0c417b6452757f90243921c60b2406c9bf60d1aaa393654fb23ce52e32fb3e7ed90f6d59286786dd95398a10d008c75bfdca065d704025cc828ff65b225f SHA512 dccb4407f4f2a8b38488f9f42638c10777ee344239cf5d4fcc8f580df3e8ff15d03211dc51ef18d905c326a71771da4b38f47381d6d549422a8353b5da0e7b0b
+DIST binutils-2.35.1-patches-2.tar.xz 72236 BLAKE2B 584cb3edbda28c69171ed64e941535f992150d86f25201cadd07b63daaa36bf76b07dc0aa8a4837da17d1672feb47a7b15f83efdeec5409e695965a10142147a SHA512 b704ebe82c4402f058f9c96991a89256a6b369d28f844bf020ed2c77766894d9a2ca0596cd609de7b389fa8cd52bfab674b6deb10ea2096e50aa57921be2083e
DIST binutils-2.35.1.tar.xz 22031720 BLAKE2B d3468da90b75e9b5fa7fbd64d3fdb0a4bc445e4cb7da5ae058f73a1e9d948b3e9438bc9f1b5b351db369b76a25960c9c1f58f828fd2c7646f555de45fa3c052b SHA512 94ff72708403413b70b247f3af4099ebaa882b6659249869f1ed9941a0f1912e313f08357d470f9fd2359e7f5e5b0eb86285e5eaf883fa8187789d6b1bd304eb
-EBUILD binutils-2.32-r1.ebuild 12638 BLAKE2B 3bb6831d91295ad0e1eba8f50de8d5ceea51f245b2798cf890b2e0d42628db175150d4372f918067e560d229c2173412662320c90b39d3ab99f69fb1c9c4e18e SHA512 e4c24268b2bb5780bdbaaee7d7b7a02fbf590afb95b11037e1b518fd5c98e94ac8b25e60d188609d98dc30180e030f44ec78e1ef7ce1162fe13658fbe057b340
-EBUILD binutils-2.32-r2.ebuild 12417 BLAKE2B 0db121dfdf5af96c1884684ab0d8a25d69c037d8b394a8d364f742ded9962f96c4e94f5073294c41eaefb0b9061b58b4f78f86ae04c73bd13797b3de5d3e3c4d SHA512 abbf2690b78b9c74c8db40db03a0de41afdf9006120b2d32014c53b064ff3872813c2a35d610e5dc5b50324613395ff8dbd6f9e0811fc09003efd830c748d459
-EBUILD binutils-2.33.1-r1.ebuild 12152 BLAKE2B 71c89261848ff7d8898c81cd013de9bd9fac9f3853732fb4636c6e420106b74d3f42970d2dc25c2053a71003d898377618fb2c6ef271f993302f3f5c1f4d3d54 SHA512 689498a68f0e802c1468ee3a4df6dfe8ede15dfa797d1983466d01e64f5da26c071f1396d52f25085e5df4075cb2969349f0533eb89a543da224c6c3ed47d4b9
-EBUILD binutils-2.34-r2.ebuild 12119 BLAKE2B 9ffb2d93bb543e023bdada09eb459b39a2f182816e0f2a0e28e376fe2984eddd1d3a1130fa8a1f2eb716f619c3ed04d6df3e440657246bf6510ff53f370b88f8 SHA512 75eb38babbda8ac3afeb82e7893e42d502aea41d9ac6b0874dacfe3cc3c12c9c50fe9f77d4bea0d7c3772906047bfd97846c2aa97e5be87fcf43e5771d2b72b7
+EBUILD binutils-2.32-r1.ebuild 12354 BLAKE2B 1771cb776e87efa9b0ad69a78df051db44b2078e323645ce185815987a540ffd4e82ed2ae5b3d92ffa3837f117ec7737188b9920f59b8b5e0f55cda03afbf888 SHA512 4233627432a43ab46dac5e10d90a07dc9e085455f3140fb0a731fdb1ef2bfd2245dae3c47e9ba32bdb7a8650f32e7a9f49b911999ee32a18d41c32be4c697fcd
+EBUILD binutils-2.32-r2.ebuild 12173 BLAKE2B fb2dd9286d25b3e9b6bfbebfd70965e72b0458b3d87830be8f8e2f14866818441118f809392c34f2ea535d2f54821c3460108ed71bbd9e78286cad1190a669c3 SHA512 cb442d2e13a2c33fd3e89cd948b5bfbb453d7f37ba18cd061c21c69fceb8cdcfb047d4b009d1ec5d6f3d90c37ad9fa30cdfaf2422ccc6c410720ee0989c11cae
+EBUILD binutils-2.33.1-r1.ebuild 11908 BLAKE2B 7d4a576a037a162d329977822aa08807115e7d6775df73a047bc1c82bdf1cfb3a7f51e31c21c2682553673dca8bbb5db0359a65f3f9722fe751b7871b2bcf91a SHA512 2837ab896d900e9dbb19e7d5584bede1fa19e50ba0dc432d02644ee4c8c791a1219b6fb35213b5e8f50d2d11d24ac1cb393cfd2db20346e7eafc23a8a0da82a7
+EBUILD binutils-2.34-r2.ebuild 11872 BLAKE2B efb68c0c189489561a6d90eb72016f0872f503eb5cd846091fa29361fa843b2e8e15f572c1244d7be244360d599c3c36cf1726642694e0e7d5dd0debf1aef488 SHA512 cbe9447d81fc67e89519042129f2dbab8c4274ad52a915e1c9065507ef335d87d57f361a5b81e81bd892089a83822a9e46b72f38db9668a17a1462337b976cc7
+EBUILD binutils-2.35.1-r1.ebuild 12468 BLAKE2B 43658cefb152986e42607766f8b263b53b66cea2fd6cb5f6933ad616e4a8a612f2fad907a10fe3aa675b6ffc8810d03f3a70253eae0a00b78a2734ee85ea7165 SHA512 2feeeea71ad8f112284067407fcae8c02850608f6ec246971e4ac6a0ac496397475c2122be830c8578fd3464dd3654858de76985d111c45678121bf0379aa0a0
EBUILD binutils-2.35.1.ebuild 12468 BLAKE2B 92daee225625599510aec7656338a8a91853c4541cfc75b0f72ed2814941ad3765f51bab88b694543e180b9e0f88799fcff680ea24140b511145ffd0d4f2ac5d SHA512 fa18f03f24cb6880ad1ef246fe382a33187d822b571c7183418a228721578f4cf9cd1807524c04594dd5ac342c8b7bfcbe0c82135d196e2ae025d40016b48f08
EBUILD binutils-9999.ebuild 12469 BLAKE2B f99ef61b216d5e1948898a1f79aa35a7e8dc439240b6ce9cca8cd88e9a11497e2a937930c3ef31b3d844c180f2352cb33d98c189d4ec8aa46d24e38a80b089f9 SHA512 6cf1f15697a42b4931e1bcf1180ed658ef975df3053b16c41acdebf2c200075b11583aa4a2d20fb84ff6b8d3c1c3744c37317117ba6235b024df080059fe17c9
MISC metadata.xml 650 BLAKE2B 5f0547bb9a41a09f28afc7feb1d6f2da32205924d860a88f64a7970a5e24749b961531c023a8647720e119ffbf2bdcab9384f10726a3371a8ec750b808233eaf SHA512 9057a779adcdf1da85c7e26fdd134303e4fe53ba015dda84761f5e4894833ba50f1411c1e96102319479fb1becf6c02e23984737b3660a7c24101d0cf0d404b2
diff --git a/sys-devel/binutils/binutils-2.32-r1.ebuild b/sys-devel/binutils/binutils-2.32-r1.ebuild
index 1ae297d7ea13..3daa17a457bc 100644
--- a/sys-devel/binutils/binutils-2.32-r1.ebuild
+++ b/sys-devel/binutils/binutils-2.32-r1.ebuild
@@ -33,15 +33,6 @@ case ${PV} in
EGIT_CHECKOUT_DIR=${S}
SLOT=${PV}
;;
- *.9999)
- EGIT_REPO_URI="https://sourceware.org/git/binutils-gdb.git"
- inherit git-r3
- S=${WORKDIR}/binutils
- EGIT_CHECKOUT_DIR=${S}
- EGIT_BRANCH=$(get_version_component_range 1-2)
- EGIT_BRANCH="binutils-${EGIT_BRANCH/./_}-branch"
- SLOT=$(get_version_component_range 1-2)
- ;;
*)
SRC_URI="mirror://gnu/binutils/binutils-${PV}.tar.xz"
SLOT=$(get_version_component_range 1-2)
diff --git a/sys-devel/binutils/binutils-2.32-r2.ebuild b/sys-devel/binutils/binutils-2.32-r2.ebuild
index ef860c0fe8c3..d4de5f2ce4b3 100644
--- a/sys-devel/binutils/binutils-2.32-r2.ebuild
+++ b/sys-devel/binutils/binutils-2.32-r2.ebuild
@@ -30,15 +30,6 @@ case ${PV} in
EGIT_CHECKOUT_DIR=${S}
SLOT=${PV}
;;
- *.9999)
- EGIT_REPO_URI="https://sourceware.org/git/binutils-gdb.git"
- inherit git-r3
- S=${WORKDIR}/binutils
- EGIT_CHECKOUT_DIR=${S}
- EGIT_BRANCH=$(ver_cut 1-2)
- EGIT_BRANCH="binutils-${EGIT_BRANCH/./_}-branch"
- SLOT=$(ver_cut 1-2)
- ;;
*)
SRC_URI="mirror://gnu/binutils/binutils-${PV}.tar.xz"
SLOT=$(ver_cut 1-2)
diff --git a/sys-devel/binutils/binutils-2.33.1-r1.ebuild b/sys-devel/binutils/binutils-2.33.1-r1.ebuild
index c0f31907a70b..fe16e589ba71 100644
--- a/sys-devel/binutils/binutils-2.33.1-r1.ebuild
+++ b/sys-devel/binutils/binutils-2.33.1-r1.ebuild
@@ -30,15 +30,6 @@ case ${PV} in
EGIT_CHECKOUT_DIR=${S}
SLOT=${PV}
;;
- *.9999)
- EGIT_REPO_URI="https://sourceware.org/git/binutils-gdb.git"
- inherit git-r3
- S=${WORKDIR}/binutils
- EGIT_CHECKOUT_DIR=${S}
- EGIT_BRANCH=$(ver_cut 1-2)
- EGIT_BRANCH="binutils-${EGIT_BRANCH/./_}-branch"
- SLOT=$(ver_cut 1-2)
- ;;
*)
SRC_URI="mirror://gnu/binutils/binutils-${PV}.tar.xz"
SLOT=$(ver_cut 1-2)
diff --git a/sys-devel/binutils/binutils-2.34-r2.ebuild b/sys-devel/binutils/binutils-2.34-r2.ebuild
index 672f3cc3c5a5..517ec9a28bee 100644
--- a/sys-devel/binutils/binutils-2.34-r2.ebuild
+++ b/sys-devel/binutils/binutils-2.34-r2.ebuild
@@ -30,19 +30,10 @@ case ${PV} in
EGIT_CHECKOUT_DIR=${S}
SLOT=${PV}
;;
- *.9999)
- EGIT_REPO_URI="https://sourceware.org/git/binutils-gdb.git"
- inherit git-r3
- S=${WORKDIR}/binutils
- EGIT_CHECKOUT_DIR=${S}
- EGIT_BRANCH=$(ver_cut 1-2)
- EGIT_BRANCH="binutils-${EGIT_BRANCH/./_}-branch"
- SLOT=$(ver_cut 1-2)
- ;;
*)
SRC_URI="mirror://gnu/binutils/binutils-${PV}.tar.xz"
SLOT=$(ver_cut 1-2)
- KEYWORDS="~alpha amd64 ~arm arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 sparc x86"
+ KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv s390 sparc x86"
;;
esac
diff --git a/sys-devel/binutils/binutils-2.35.1-r1.ebuild b/sys-devel/binutils/binutils-2.35.1-r1.ebuild
new file mode 100644
index 000000000000..57dc7a307c1c
--- /dev/null
+++ b/sys-devel/binutils/binutils-2.35.1-r1.ebuild
@@ -0,0 +1,437 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit eutils libtool flag-o-matic gnuconfig multilib toolchain-funcs
+
+DESCRIPTION="Tools necessary to build programs"
+HOMEPAGE="https://sourceware.org/binutils/"
+LICENSE="GPL-3+"
+IUSE="default-gold doc +gold multitarget +nls +plugins static-libs test vanilla"
+REQUIRED_USE="default-gold? ( gold )"
+
+# Variables that can be set here (ignored for live ebuilds)
+# PATCH_VER - the patchset version
+# Default: empty, no patching
+# PATCH_BINUTILS_VER - the binutils version in the patchset name
+# - Default: PV
+# PATCH_DEV - Use download URI https://dev.gentoo.org/~{PATCH_DEV}/distfiles/...
+# for the patchsets
+
+PATCH_VER=2
+PATCH_DEV=dilfridge
+
+if [[ ${PV} == 9999* ]]; then
+ inherit git-r3
+ SLOT=${PV}
+else
+ PATCH_BINUTILS_VER=${PATCH_BINUTILS_VER:-${PV}}
+ PATCH_DEV=${PATCH_DEV:-slyfox}
+ SRC_URI="mirror://gnu/binutils/binutils-${PV}.tar.xz"
+ [[ -z ${PATCH_VER} ]] || SRC_URI="${SRC_URI}
+ https://dev.gentoo.org/~${PATCH_DEV}/distfiles/binutils-${PATCH_BINUTILS_VER}-patches-${PATCH_VER}.tar.xz"
+ SLOT=$(ver_cut 1-2)
+ # live ebuild
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+fi
+
+#
+# The cross-compile logic
+#
+export CTARGET=${CTARGET:-${CHOST}}
+if [[ ${CTARGET} == ${CHOST} ]] ; then
+ if [[ ${CATEGORY} == cross-* ]] ; then
+ export CTARGET=${CATEGORY#cross-}
+ fi
+fi
+is_cross() { [[ ${CHOST} != ${CTARGET} ]] ; }
+
+#
+# The dependencies
+#
+RDEPEND="
+ >=sys-devel/binutils-config-3
+ sys-libs/zlib
+"
+DEPEND="${RDEPEND}"
+BDEPEND="
+ doc? ( sys-apps/texinfo )
+ test? ( dev-util/dejagnu )
+ nls? ( sys-devel/gettext )
+ sys-devel/flex
+ virtual/yacc
+"
+
+RESTRICT="!test? ( test )"
+
+MY_BUILDDIR=${WORKDIR}/build
+
+src_unpack() {
+ if [[ ${PV} == 9999* ]] ; then
+ EGIT_REPO_URI="https://anongit.gentoo.org/git/proj/toolchain/binutils-patches.git"
+ EGIT_CHECKOUT_DIR=${WORKDIR}/patches-git
+ git-r3_src_unpack
+ mv patches-git/9999 patch || die
+
+ EGIT_REPO_URI="https://sourceware.org/git/binutils-gdb.git"
+ S=${WORKDIR}/binutils
+ EGIT_CHECKOUT_DIR=${S}
+ git-r3_src_unpack
+ else
+ unpack ${P}.tar.xz
+
+ cd "${WORKDIR}" || die
+ unpack binutils-${PATCH_BINUTILS_VER}-patches-${PATCH_VER}.tar.xz
+ fi
+
+ cd "${WORKDIR}" || die
+ mkdir -p "${MY_BUILDDIR}" || die
+}
+
+src_prepare() {
+ local patchsetname
+ if [[ ${PV} == 9999* ]] ; then
+ patchsetname="from git master"
+ else
+ patchsetname="${PATCH_BINUTILS_VER}-${PATCH_VER}"
+ fi
+
+ if [[ ! -z ${PATCH_VER} ]] || [[ ${PV} == 9999* ]] ; then
+ if ! use vanilla; then
+ einfo "Applying binutils patchset ${patchsetname}"
+ eapply "${WORKDIR}/patch"
+ einfo "Done."
+ fi
+ fi
+
+ # This check should probably go somewhere else, like pkg_pretend.
+ if [[ ${CTARGET} == *-uclibc* ]] ; then
+ if grep -qs 'linux-gnu' "${S}"/ltconfig ; then
+ die "sorry, but this binutils doesn't yet support uClibc :("
+ fi
+ fi
+
+ # Make sure our explicit libdir paths don't get clobbered. #562460
+ sed -i \
+ -e 's:@bfdlibdir@:@libdir@:g' \
+ -e 's:@bfdincludedir@:@includedir@:g' \
+ {bfd,opcodes}/Makefile.in || die
+
+ # Fix locale issues if possible #122216
+ if [[ -e ${FILESDIR}/binutils-configure-LANG.patch ]] ; then
+ einfo "Fixing misc issues in configure files"
+ for f in $(find "${S}" -name configure -exec grep -l 'autoconf version 2.13' {} +) ; do
+ ebegin " Updating ${f/${S}\/}"
+ patch "${f}" "${FILESDIR}"/binutils-configure-LANG.patch >& "${T}"/configure-patch.log \
+ || eerror "Please file a bug about this"
+ eend $?
+ done
+ fi
+
+ # Fix conflicts with newer glibc #272594
+ if [[ -e libiberty/testsuite/test-demangle.c ]] ; then
+ sed -i 's:\<getline\>:get_line:g' libiberty/testsuite/test-demangle.c
+ fi
+
+ # Apply things from PATCHES and user dirs
+ default
+
+ # Run misc portage update scripts
+ gnuconfig_update
+ elibtoolize --portage --no-uclibc
+}
+
+toolchain-binutils_bugurl() {
+ printf "https://bugs.gentoo.org/"
+}
+toolchain-binutils_pkgversion() {
+ printf "Gentoo ${PV}"
+ [[ -n ${PATCH_VER} ]] && printf " p${PATCH_VER}"
+}
+
+src_configure() {
+ # Setup some paths
+ LIBPATH=/usr/$(get_libdir)/binutils/${CTARGET}/${PV}
+ INCPATH=${LIBPATH}/include
+ DATAPATH=/usr/share/binutils-data/${CTARGET}/${PV}
+ if is_cross ; then
+ TOOLPATH=/usr/${CHOST}/${CTARGET}
+ else
+ TOOLPATH=/usr/${CTARGET}
+ fi
+ BINPATH=${TOOLPATH}/binutils-bin/${PV}
+
+ # Make sure we filter $LINGUAS so that only ones that
+ # actually work make it through #42033
+ strip-linguas -u */po
+
+ # Keep things sane
+ strip-flags
+
+ local x
+ echo
+ for x in CATEGORY CBUILD CHOST CTARGET CFLAGS LDFLAGS ; do
+ einfo "$(printf '%10s' ${x}:) ${!x}"
+ done
+ echo
+
+ cd "${MY_BUILDDIR}"
+ local myconf=()
+
+ if use plugins ; then
+ myconf+=( --enable-plugins )
+ fi
+ # enable gold (installed as ld.gold) and ld's plugin architecture
+ if use gold ; then
+ myconf+=( --enable-gold )
+ if use default-gold; then
+ myconf+=( --enable-gold=default )
+ fi
+ fi
+
+ if use nls ; then
+ myconf+=( --without-included-gettext )
+ else
+ myconf+=( --disable-nls )
+ fi
+
+ myconf+=( --with-system-zlib )
+
+ # For bi-arch systems, enable a 64bit bfd. This matches
+ # the bi-arch logic in toolchain.eclass. #446946
+ # We used to do it for everyone, but it's slow on 32bit arches. #438522
+ case $(tc-arch) in
+ ppc|sparc|x86) myconf+=( --enable-64-bit-bfd ) ;;
+ esac
+
+ use multitarget && myconf+=( --enable-targets=all --enable-64-bit-bfd )
+
+ [[ -n ${CBUILD} ]] && myconf+=( --build=${CBUILD} )
+
+ is_cross && myconf+=(
+ --with-sysroot="${EPREFIX}"/usr/${CTARGET}
+ --enable-poison-system-directories
+ )
+
+ # glibc-2.3.6 lacks support for this ... so rather than force glibc-2.5+
+ # on everyone in alpha (for now), we'll just enable it when possible
+ has_version ">=${CATEGORY}/glibc-2.5" && myconf+=( --enable-secureplt )
+ has_version ">=sys-libs/glibc-2.5" && myconf+=( --enable-secureplt )
+
+ # mips can't do hash-style=gnu ...
+ if [[ $(tc-arch) != mips ]] ; then
+ myconf+=( --enable-default-hash-style=gnu )
+ fi
+
+ myconf+=(
+ --prefix="${EPREFIX}"/usr
+ --host=${CHOST}
+ --target=${CTARGET}
+ --datadir="${EPREFIX}"${DATAPATH}
+ --datarootdir="${EPREFIX}"${DATAPATH}
+ --infodir="${EPREFIX}"${DATAPATH}/info
+ --mandir="${EPREFIX}"${DATAPATH}/man
+ --bindir="${EPREFIX}"${BINPATH}
+ --libdir="${EPREFIX}"${LIBPATH}
+ --libexecdir="${EPREFIX}"${LIBPATH}
+ --includedir="${EPREFIX}"${INCPATH}
+ --enable-obsolete
+ --enable-shared
+ --enable-threads
+ # Newer versions (>=2.27) offer a configure flag now.
+ --enable-relro
+ # Newer versions (>=2.24) make this an explicit option. #497268
+ --enable-install-libiberty
+ # Available from 2.35 on
+ --enable-textrel-check=warning
+ --disable-werror
+ --with-bugurl="$(toolchain-binutils_bugurl)"
+ --with-pkgversion="$(toolchain-binutils_pkgversion)"
+ $(use_enable static-libs static)
+ ${EXTRA_ECONF}
+ # Disable modules that are in a combined binutils/gdb tree. #490566
+ --disable-{gdb,libdecnumber,readline,sim}
+ # Strip out broken static link flags.
+ # https://gcc.gnu.org/PR56750
+ --without-stage1-ldflags
+ # Change SONAME to avoid conflict across
+ # {native,cross}/binutils, binutils-libs. #666100
+ --with-extra-soversion-suffix=gentoo-${CATEGORY}-${PN}-$(usex multitarget mt st)
+ )
+ echo ./configure "${myconf[@]}"
+ "${S}"/configure "${myconf[@]}" || die
+
+ # Prevent makeinfo from running if doc is unset.
+ if ! use doc ; then
+ sed -i \
+ -e '/^MAKEINFO/s:=.*:= true:' \
+ Makefile || die
+ fi
+}
+
+src_compile() {
+ cd "${MY_BUILDDIR}"
+ # see Note [tooldir hack for ldscripts]
+ emake tooldir="${EPREFIX}${TOOLPATH}" all
+
+ # only build info pages if the user wants them
+ if use doc ; then
+ emake info
+ fi
+
+ # we nuke the manpages when we're left with junk
+ # (like when we bootstrap, no perl -> no manpages)
+ find . -name '*.1' -a -size 0 -delete
+}
+
+src_test() {
+ cd "${MY_BUILDDIR}"
+
+ # bug 637066
+ filter-flags -Wall -Wreturn-type
+
+ emake -k check
+}
+
+src_install() {
+ local x d
+
+ cd "${MY_BUILDDIR}"
+ # see Note [tooldir hack for ldscripts]
+ emake DESTDIR="${D}" tooldir="${EPREFIX}${LIBPATH}" install
+ rm -rf "${ED}"/${LIBPATH}/bin
+ use static-libs || find "${ED}" -name '*.la' -delete
+
+ # Newer versions of binutils get fancy with ${LIBPATH} #171905
+ cd "${ED}"/${LIBPATH}
+ for d in ../* ; do
+ [[ ${d} == ../${PV} ]] && continue
+ mv ${d}/* . || die
+ rmdir ${d} || die
+ done
+
+ # Now we collect everything intp the proper SLOT-ed dirs
+ # When something is built to cross-compile, it installs into
+ # /usr/$CHOST/ by default ... we have to 'fix' that :)
+ if is_cross ; then
+ cd "${ED}"/${BINPATH}
+ for x in * ; do
+ mv ${x} ${x/${CTARGET}-}
+ done
+
+ if [[ -d ${ED}/usr/${CHOST}/${CTARGET} ]] ; then
+ mv "${ED}"/usr/${CHOST}/${CTARGET}/include "${ED}"/${INCPATH}
+ mv "${ED}"/usr/${CHOST}/${CTARGET}/lib/* "${ED}"/${LIBPATH}/
+ rm -r "${ED}"/usr/${CHOST}/{include,lib}
+ fi
+ fi
+ insinto ${INCPATH}
+ local libiberty_headers=(
+ # Not all the libiberty headers. See libiberty/Makefile.in:install_to_libdir.
+ demangle.h
+ dyn-string.h
+ fibheap.h
+ hashtab.h
+ libiberty.h
+ objalloc.h
+ splay-tree.h
+ )
+ doins "${libiberty_headers[@]/#/${S}/include/}"
+ if [[ -d ${ED}/${LIBPATH}/lib ]] ; then
+ mv "${ED}"/${LIBPATH}/lib/* "${ED}"/${LIBPATH}/
+ rm -r "${ED}"/${LIBPATH}/lib
+ fi
+
+ # Generate an env.d entry for this binutils
+ insinto /etc/env.d/binutils
+ cat <<-EOF > "${T}"/env.d
+ TARGET="${CTARGET}"
+ VER="${PV}"
+ LIBPATH="${EPREFIX}${LIBPATH}"
+ EOF
+ newins "${T}"/env.d ${CTARGET}-${PV}
+
+ # Handle documentation
+ if ! is_cross ; then
+ cd "${S}"
+ dodoc README
+ docinto bfd
+ dodoc bfd/ChangeLog* bfd/README bfd/PORTING bfd/TODO
+ docinto binutils
+ dodoc binutils/ChangeLog binutils/NEWS binutils/README
+ docinto gas
+ dodoc gas/ChangeLog* gas/CONTRIBUTORS gas/NEWS gas/README*
+ docinto gprof
+ dodoc gprof/ChangeLog* gprof/TEST gprof/TODO gprof/bbconv.pl
+ docinto ld
+ dodoc ld/ChangeLog* ld/README ld/NEWS ld/TODO
+ docinto libiberty
+ dodoc libiberty/ChangeLog* libiberty/README
+ docinto opcodes
+ dodoc opcodes/ChangeLog*
+ fi
+
+ # Remove shared info pages
+ rm -f "${ED}"/${DATAPATH}/info/{dir,configure.info,standards.info}
+
+ # Trim all empty dirs
+ find "${ED}" -depth -type d -exec rmdir {} + 2>/dev/null
+}
+
+pkg_postinst() {
+ # Make sure this ${CTARGET} has a binutils version selected
+ [[ -e ${EROOT}/etc/env.d/binutils/config-${CTARGET} ]] && return 0
+ binutils-config ${CTARGET}-${PV}
+}
+
+pkg_postrm() {
+ local current_profile=$(binutils-config -c ${CTARGET})
+
+ # If no other versions exist, then uninstall for this
+ # target ... otherwise, switch to the newest version
+ # Note: only do this if this version is unmerged. We
+ # rerun binutils-config if this is a remerge, as
+ # we want the mtimes on the symlinks updated (if
+ # it is the same as the current selected profile)
+ if [[ ! -e ${EPREFIX}${BINPATH}/ld ]] && [[ ${current_profile} == ${CTARGET}-${PV} ]] ; then
+ local choice=$(binutils-config -l | grep ${CTARGET} | awk '{print $2}')
+ choice=${choice//$'\n'/ }
+ choice=${choice/* }
+ if [[ -z ${choice} ]] ; then
+ binutils-config -u ${CTARGET}
+ else
+ binutils-config ${choice}
+ fi
+ elif [[ $(CHOST=${CTARGET} binutils-config -c) == ${CTARGET}-${PV} ]] ; then
+ binutils-config ${CTARGET}-${PV}
+ fi
+}
+
+# Note [slotting support]
+# -----------------------
+# Gentoo's layout for binutils files is non-standard as Gentoo
+# supports slotted installation for binutils. Many tools
+# still expect binutils to reside in known locations.
+# binutils-config package restores symlinks into known locations,
+# like:
+# /usr/bin/${CTARGET}-<tool>
+# /usr/bin/${CHOST}/${CTARGET}/lib/ldscrips
+# /usr/include/
+#
+# Note [tooldir hack for ldscripts]
+# ---------------------------------
+# Build system does not allow ./configure to tweak every location
+# we need for slotting binutils hence all the shuffling in
+# src_install(). This note is about SCRIPTDIR define handling.
+#
+# SCRIPTDIR defines 'ldscripts/' directory location. SCRIPTDIR value
+# is set at build-time in ld/Makefile.am as: 'scriptdir = $(tooldir)/lib'
+# and hardcoded as -DSCRIPTDIR='"$(scriptdir)"' at compile time.
+# Thus we can't just move files around after compilation finished.
+#
+# Our goal is the following:
+# - at build-time set scriptdir to point to symlinked location:
+# ${TOOLPATH}: /usr/${CHOST} (or /usr/${CHOST}/${CTARGET} for cross-case)
+# - at install-time set scriptdir to point to slotted location:
+# ${LIBPATH}: /usr/$(get_libdir)/binutils/${CTARGET}/${PV}