summaryrefslogtreecommitdiff
path: root/sys-devel/binutils
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2020-02-05 18:44:56 +0000
committerV3n3RiX <venerix@redcorelinux.org>2020-02-05 18:44:56 +0000
commit29aabba0ea759c6a2864ff5631735b67ee38e5e0 (patch)
treeab466b4dfa7abecb401b2f8039d08af4689306bb /sys-devel/binutils
parentd42200bec37eef2a7478d88988ff00addd0a9202 (diff)
gentoo resync : 05.02.2020
Diffstat (limited to 'sys-devel/binutils')
-rw-r--r--sys-devel/binutils/Manifest12
-rw-r--r--sys-devel/binutils/binutils-2.30-r4.ebuild2
-rw-r--r--sys-devel/binutils/binutils-2.31.1-r6.ebuild2
-rw-r--r--sys-devel/binutils/binutils-2.32-r1.ebuild2
-rw-r--r--sys-devel/binutils/binutils-2.33.1-r1.ebuild4
-rw-r--r--sys-devel/binutils/binutils-2.34.ebuild440
-rw-r--r--sys-devel/binutils/files/binutils-2.33-gcc-10.patch39
7 files changed, 494 insertions, 7 deletions
diff --git a/sys-devel/binutils/Manifest b/sys-devel/binutils/Manifest
index 921e36ee8eb2..6d1a93769080 100644
--- a/sys-devel/binutils/Manifest
+++ b/sys-devel/binutils/Manifest
@@ -1,4 +1,5 @@
AUX binutils-2.29.1-nogoldtest.patch 730 BLAKE2B f4f5926511866e58566abc224d2bae1336eb2cbfb63ae6d2a8a3b1f455f24d31fe0ecaee616eb6075712b8d90c40495a639c413c7229c9dfa741a5d284ff2911 SHA512 dd94d947fd25a770990ebc711fba6f680c90677e726f7cdc5435dd121f57e28e3a19343805e514045513bb011094f3a1fe2c4178d1be73e5d38a24abcc2b88e5
+AUX binutils-2.33-gcc-10.patch 815 BLAKE2B 84cf88e34afea70ea3728e2a78f0ba004e24934f57ff53d42694c3fe6f1afd6fb091b70ca114ff539ae6274699f0e3584decbf1355d1d1cd720bb4aca31bcb33 SHA512 8c0cd37738d2d172aadf1df875d028538d9edca35b681d7faa7dc3ab64e2c214d9c33862795a51c0cba9a61aaea9c5bbf5f9f9fb4a01762aa266f32c97eaafbd
AUX binutils-configure-LANG.patch 2082 BLAKE2B 5db7ce0626dee8f3d84547eaccc5a2808bbb55657dd22c890782446fc9fe3e84683277d8da675067d9fd494d99dd292883174e133e440ce6a90d22a9f1aa9142 SHA512 1caf25d5e332d7de313b6be73e753fdde7b02235af564a9c06517f5874127998eeed731388617b75f54be6fec21835b78a54ce6c7162a33e25411fe3c78efee7
DIST binutils-2.30-patches-5.tar.xz 590864 BLAKE2B 71de4d08f92ab1898ad576a21763f955067cbbed543250888e0c5d51f4ef77d0d829049e9a835691cf2de03965fbcc9bcfa092eb304c03f9b885e7a3dadab286 SHA512 029b3be6ae9b8620f8580a35701bd4517b4e0232ff3cf9983b3808475c7443cbf500b6cace2c052df0bd1e47202838f4d2453238db28709a947117071d9ae804
DIST binutils-2.30.tar.xz 20286700 BLAKE2B 2dd5436a15a601011a1950e6082ec00082f5916fb82ce95ceab424fd8dc19f6daa7ac32a149f222ccdcc603354165cc206fde070eaa44fe2cc5e57486efc7868 SHA512 e747ea20d8d79fcd21b9d9f6695059caa7189d60f19256da398e34b789fea9a133c32b192e9693b5828d27683739b0198431bf8b3e39fb3b04884cf89d9aa839
@@ -10,12 +11,15 @@ DIST binutils-2.32.tar.xz 20774880 BLAKE2B d1bdbd9c8487c091665c197974ce4bdf520b7
DIST binutils-2.33.1-patches-1.tar.xz 17944 BLAKE2B 811ad416fe9c059f645856a3123ed32303afe1d0f166a15cb6de0673b5494fdcc4c165da4a68eb7ab73f007618e3a97a5578c4b47de21e57fe501d6a21b6d595 SHA512 63b439637206d21e46d2b79383b38da2b28365a0fdea1f5ac3b665cd05e0b55cd1d7763c05567a5f7ae2c645d2ae639a27e465d535b928d9f8f0e6b94f31e1f7
DIST binutils-2.33.1-patches-2.tar.xz 18636 BLAKE2B 0e0757329b6a83aeff4f4c450c95e73fd48fcc89f83e63f294568632bee0972552cf2f57494352c5d9a7c16a51cdbc4108b38fa6028d4388c8e76046b3da9212 SHA512 d982f68d1f5fdb384309a2a1b7426bf840a90e7a85b37229b4223b62c36cab9dd9ec0c08382c85c68adf996dec21133df3180a2fc649363adae8645f8282f71d
DIST binutils-2.33.1.tar.xz 21490848 BLAKE2B c336a8412938dc8c224f40a763a8bea9937cca0462a8fb80e62f14aabe590107fc061a3f4b9327e1f4652cb026384d36a91b4766d4d469d2d0680932874b638c SHA512 b7a6767c6c7ca6b5cafa7080e6820b7bb3a53b7148348c438d99905defbdf0d30c9744a484ee01c9441a8153901808513366b15ba9533e20c9673c262ade36ac
+DIST binutils-2.34-patches-1.tar.xz 20388 BLAKE2B 8828505f62259a307de445357320827e7f6bc416a7f4c72140add505f62eef3928c7daec13be158b52c2a7a1d989f539025e4be6ec27ef80ede81477a42c5042 SHA512 951dffcc30ad5706dc48e71995217655c5d96472446ab66a357f19486b57d1868143a9809887eab7ba8c42c33124f8b37d3bab6618388ea8a08b4399d348a645
+DIST binutils-2.34.tar.xz 21637796 BLAKE2B 07dd23916a7d27f71c3f160c8c16abe2bd4fce294c738c665a012a3be6a87dbe8160d0c38740524f9025e01d438e99b2a94bcf9f9f79ee214f5dd033de8aad3d SHA512 2c7976939dcf5e8c5b7374cccd39bfe803b1bec73c6abfa0eb17c24e1942574c6bdb874c66a092a82adc443182eacd8a5a8001c19a76101f0c7ba40c27de0bbd
DIST binutils-9999-patches-5.tar.xz 17492 BLAKE2B 4d5072d26d714dbc2a65899102c35791887b3c1298eb40a72088f5f964f500fa82581ac27a47f075812610e1757ba1ca5ac7d055dccc0d819ec06a86ca98f395 SHA512 c8a843cf04b72f010eef405cc2d029e49fb1f4582686f1e0409579d544b02d249c31f7cb9cd59747bc94727e29ddaba89951043b392017c6963ca14f3a0202b1
-EBUILD binutils-2.30-r4.ebuild 12023 BLAKE2B c65a3859d19e6cf1be2a717138a1d8ecc6b98cb73c9d24f99d9dc42c6b38993e1af0f611a164c1907a678fed425d968a13ee815469b9a83f4a6aebc1221fbe2b SHA512 dc4acf3c61b4a926216e4254e4b55256fa6be4323722c01c112e6a29358b6f21ff53d3195c2bcccf96106a1f369aad1d808af25789e6cc0de297256105233eef
-EBUILD binutils-2.31.1-r6.ebuild 12417 BLAKE2B 494abb53efdf8de5c577a19400b57787dd9d26dbe8212c83dc9c25787af8ba48b631d92fbc8ca50b203910b4e0f46c72c8c8af5bdd37d522f6d45756028a62fc SHA512 214987a371d304f66f9408956247d04a7bff1391d01cfc632ee6408e57433e60d483d5609f3ed27896b0aa4b0c186b2b40d70801945444c0c1fc810d9bbda512
-EBUILD binutils-2.32-r1.ebuild 12622 BLAKE2B f8a47a3a2ffd6e0e07cf57e6cc149c4fc8fa40215457c596ebd79789167199ac2b1386e40d1592527d17277d2010e1434eaaf3ae16d1fb981e54961edd4d1bac SHA512 e8d8aba2842c583d838a856bfff0c5888208bcf425771efa73cb4b97b073e5342b3c28fda488a8e85e53ecde9bc28ce03c3f60dd79c24ec633f9afc1ac078cc2
+EBUILD binutils-2.30-r4.ebuild 12024 BLAKE2B dacb9222a02c09cfb4bff4b42355607bde71e4df198d3baa5576eee111d17d091069dc4399f8604a2d4d31474cc38cb8d06730589522e13c3af06d84be2323ca SHA512 e8bb28b50c680256084a47fe51d7c3acc22c47fed03d12fc78991a1ef70e8de01fae58925191fb27c0f55fb65ad1a72508821a5b1832d44eaed0e85d54576624
+EBUILD binutils-2.31.1-r6.ebuild 12418 BLAKE2B ce937eddee86ffbd0e01f75789aaccef39e14f75b99e3143c00927ef004301f9cdd68c3cbc3c8b1adeb537e4ad7914334e5221ba3cab2943c5ad22004807d7ab SHA512 0f29fa3f90e34974bbb4c4208485f43076795086c81e37d5aac2f928583603185951ceb091e091b79071b12567fff5c5d7da4594d1b2f8970bdc55a7ea49263c
+EBUILD binutils-2.32-r1.ebuild 12623 BLAKE2B ffe5cc15b1833fa8b979af268be2806ff9c57965cff4ad5623e107bdff96c68b9824284887c2d46e09a8ad2f1daa696c6180a7dd29837293db447edd8ac6938b SHA512 29253585f12bddbd1879abfc648b0fe9da87e77f780bd3bdc90ce4372671934955f68c63130ca99af1679c7462a9a1321aca6a7d51eb9b9ff8ea9808117ceca1
EBUILD binutils-2.32-r2.ebuild 12323 BLAKE2B 07f6f4d751047269334bed629b91207253fc1f38dfd1a9950ce8f42e8f83e658d351fa84f0170e42535e50825b3a4a84bc4e24a5e504ab6a85fc2f7b7860bd9c SHA512 119823211d2c243f68d468e7558c6d39cd77dd2f42fc1ddebb989da9dd37cb241f6e1d2188d0366fedb3e15a6a4905584c139f6dee1b1840dbabf294fb55d0d1
-EBUILD binutils-2.33.1-r1.ebuild 12097 BLAKE2B 709354c141329a0d2327d04b21aec229c76f8076f68c9dade227a6598416450e17b626b4415a3333bc37baf9267c62b52d36eb337f7623789b1da938d332b380 SHA512 91a19fff42adf037922a679dfb834beaee7282b7e6356978a0f82efbff186bcc4450eb85df0092b1e609d46d8267860341953b66086136f692f1f11703fb3546
+EBUILD binutils-2.33.1-r1.ebuild 12149 BLAKE2B 863cb56f487fa99a24e7ba166b4eb95d21f683812208a5a01adf1e390a31615467483eda5608fae1e9b38b25e973ff3bd3ffd54c7dc8602a7ee4c2371929de2d SHA512 8aee4092344db995619cad4014540692597108ab6162b520aa0cb48812cbd16dea13762c1428c49c49d5cbb810b0e09174a5bf2f50630f5feb0a4404aa6bbba5
EBUILD binutils-2.33.1.ebuild 12100 BLAKE2B d84533854129ce059dca2a3ff12df371ad005398f718ae352c5c4b2073c5abb923a7a4454f10c7f96856ea00833c8a49d84528cefca0fe81b470868ef974ae7b SHA512 028d77b61b611aec549beb803f05103c324623199541b2959e3a3eaa72163af0ab32660cb82c5159d2d430e4687afce8c40d5b092cf2a3057ad5742c801c4d2a
+EBUILD binutils-2.34.ebuild 12271 BLAKE2B dd5e915447c6dd9e4c78daf21dc90cb19758966624be23ec53b72fa1565a1ed2d3e6ac2be38f7f5b545687602d86ba4250cd5590d96c5e3b0578b7ea5da4bc54 SHA512 c16af465885ef4735119b51cc507e2c04f5ab27973626ed70f4717b3872355baf7263ae4d3786833e6fe7b3e5df07f2f1d4c8205fdaa232f93fad6a65948e369
EBUILD binutils-9999.ebuild 12121 BLAKE2B b9c04c1954d42a58b2316f054928ee2c5aa64204d385a78cba2955fdc53319428eca1827a982ecf519d53c2287d95688e44c420d63cd6590cc6a67d9490ef102 SHA512 4113e5af0372e2bad7a4b7702c91e14654a68ee2c8678b53d7fb9a9ddfd000d35d1465d5a3f9becbe08863c6470bf36982d3b4d9e4c346853c7daab5c280a9ec
MISC metadata.xml 650 BLAKE2B 5f0547bb9a41a09f28afc7feb1d6f2da32205924d860a88f64a7970a5e24749b961531c023a8647720e119ffbf2bdcab9384f10726a3371a8ec750b808233eaf SHA512 9057a779adcdf1da85c7e26fdd134303e4fe53ba015dda84761f5e4894833ba50f1411c1e96102319479fb1becf6c02e23984737b3660a7c24101d0cf0d404b2
diff --git a/sys-devel/binutils/binutils-2.30-r4.ebuild b/sys-devel/binutils/binutils-2.30-r4.ebuild
index a33cb8814d06..41d6cf9c5551 100644
--- a/sys-devel/binutils/binutils-2.30-r4.ebuild
+++ b/sys-devel/binutils/binutils-2.30-r4.ebuild
@@ -35,7 +35,7 @@ case ${PV} in
;;
esac
SLOT="${BVER}"
-KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86"
+KEYWORDS="~alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86"
#
# The Gentoo patchset
diff --git a/sys-devel/binutils/binutils-2.31.1-r6.ebuild b/sys-devel/binutils/binutils-2.31.1-r6.ebuild
index 1fc6a19d0b0e..e6f688c9aeb9 100644
--- a/sys-devel/binutils/binutils-2.31.1-r6.ebuild
+++ b/sys-devel/binutils/binutils-2.31.1-r6.ebuild
@@ -45,7 +45,7 @@ case ${PV} in
*)
SRC_URI="mirror://gnu/binutils/binutils-${PV}.tar.xz"
SLOT=$(get_version_component_range 1-2)
- KEYWORDS="alpha amd64 arm arm64 ~hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86"
+ KEYWORDS="~alpha amd64 arm arm64 ~hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86"
;;
esac
diff --git a/sys-devel/binutils/binutils-2.32-r1.ebuild b/sys-devel/binutils/binutils-2.32-r1.ebuild
index 26b1cf7470f7..4c6683f69e28 100644
--- a/sys-devel/binutils/binutils-2.32-r1.ebuild
+++ b/sys-devel/binutils/binutils-2.32-r1.ebuild
@@ -45,7 +45,7 @@ case ${PV} in
*)
SRC_URI="mirror://gnu/binutils/binutils-${PV}.tar.xz"
SLOT=$(get_version_component_range 1-2)
- KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 ~riscv s390 sh sparc x86"
+ KEYWORDS="~alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 ~riscv s390 sh sparc x86"
;;
esac
diff --git a/sys-devel/binutils/binutils-2.33.1-r1.ebuild b/sys-devel/binutils/binutils-2.33.1-r1.ebuild
index b961ec55af15..c76f4471a2f4 100644
--- a/sys-devel/binutils/binutils-2.33.1-r1.ebuild
+++ b/sys-devel/binutils/binutils-2.33.1-r1.ebuild
@@ -83,6 +83,10 @@ DEPEND="${RDEPEND}
RESTRICT="!test? ( test )"
+PATCHES=(
+ "${FILESDIR}"/${PN}-2.33-gcc-10.patch
+)
+
MY_BUILDDIR=${WORKDIR}/build
src_unpack() {
diff --git a/sys-devel/binutils/binutils-2.34.ebuild b/sys-devel/binutils/binutils-2.34.ebuild
new file mode 100644
index 000000000000..d2f3d447c2b8
--- /dev/null
+++ b/sys-devel/binutils/binutils-2.34.ebuild
@@ -0,0 +1,440 @@
+# 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
+
+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"
+REQUIRED_USE="default-gold? ( gold )"
+
+# Variables that can be set here:
+# 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=1
+PATCH_DEV=slyfox
+
+case ${PV} in
+ 9999)
+ EGIT_REPO_URI="https://sourceware.org/git/binutils-gdb.git"
+ inherit git-r3
+ S=${WORKDIR}/binutils
+ 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 ~sh ~sparc ~x86"
+ ;;
+esac
+
+#
+# The Gentoo patchset
+#
+PATCH_BINUTILS_VER=${PATCH_BINUTILS_VER:-${PV}}
+PATCH_DEV=${PATCH_DEV:-slyfox}
+
+[[ -z ${PATCH_VER} ]] || SRC_URI="${SRC_URI}
+ https://dev.gentoo.org/~${PATCH_DEV}/distfiles/binutils-${PATCH_BINUTILS_VER}-patches-${PATCH_VER}.tar.xz"
+
+#
+# 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}
+ doc? ( sys-apps/texinfo )
+ test? ( dev-util/dejagnu )
+ nls? ( sys-devel/gettext )
+ sys-devel/flex
+ virtual/yacc
+"
+
+RESTRICT="!test? ( test )"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-2.33-gcc-10.patch
+)
+
+MY_BUILDDIR=${WORKDIR}/build
+
+src_unpack() {
+ case ${PV} in
+ *9999)
+ git-r3_src_unpack
+ ;;
+ *)
+ ;;
+ esac
+ default
+ mkdir -p "${MY_BUILDDIR}"
+}
+
+src_prepare() {
+ if [[ ! -z ${PATCH_VER} ]] ; then
+ # Use upstream patch to enable development mode
+ rm -v "${WORKDIR}/patch"/0000-Gentoo-Git-is-development.patch || die
+
+ einfo "Applying binutils-${PATCH_BINUTILS_VER} patchset ${PATCH_VER}"
+ eapply "${WORKDIR}/patch"/*.patch
+ 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
+ --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}
diff --git a/sys-devel/binutils/files/binutils-2.33-gcc-10.patch b/sys-devel/binutils/files/binutils-2.33-gcc-10.patch
new file mode 100644
index 000000000000..9e1a999be9ef
--- /dev/null
+++ b/sys-devel/binutils/files/binutils-2.33-gcc-10.patch
@@ -0,0 +1,39 @@
+binutils: drop redundant 'program_name' definition
+
+https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commitdiff;h=0b398d69acde3377dfbbeb8a4cfe87ae8c8562fa
+--- a/binutils/coffdump.c
++++ b/binutils/coffdump.c
+@@ -456,8 +456,6 @@ coff_dump (struct coff_ofile *ptr)
+ dump_coff_section (ptr->sections + i);
+ }
+
+-char * program_name;
+-
+ static void
+ show_usage (FILE *file, int status)
+ {
+--- a/binutils/srconv.c
++++ b/binutils/srconv.c
+@@ -1687,8 +1687,6 @@ prescan (struct coff_ofile *otree)
+ }
+ }
+
+-char *program_name;
+-
+ ATTRIBUTE_NORETURN static void
+ show_usage (FILE *ffile, int status)
+ {
+--- a/binutils/sysdump.c
++++ b/binutils/sysdump.c
+@@ -633,8 +633,6 @@ module (void)
+ }
+ }
+
+-char *program_name;
+-
+ ATTRIBUTE_NORETURN static void
+ show_usage (FILE *ffile, int status)
+ {
+--
+2.25.0
+