Signed-off-by: David Seifert
---
eclass/toolchain.eclass | 110 +++-
1 file changed, 40 insertions(+), 70 deletions(-)
diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index 61718f0d9a0..741b6dfbbcc 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -4,7 +4,7 @@
# @ECLASS: toolchain.eclass
# @MAINTAINER:
# Toolchain Ninjas
-# @SUPPORTED_EAPIS: 5 6 7 8
+# @SUPPORTED_EAPIS: 7 8
# @BLURB: Common code for sys-devel/gcc ebuilds
DESCRIPTION="The GNU Compiler Collection"
@@ -31,7 +31,6 @@ fi
FEATURES=${FEATURES/multilib-strict/}
case ${EAPI} in
- 5|6) inherit eapi7-ver eutils ;;
7) inherit eutils ;;
8) ;;
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
@@ -129,16 +128,6 @@ LICENSE="GPL-3+ LGPL-3+ || ( GPL-3+ libgcc libstdc++
gcc-runtime-library-excepti
IUSE="test vanilla +nls"
RESTRICT="!test? ( test )"
-tc_supports_dostrip() {
- case ${EAPI} in
- 5|6) return 1 ;;
- 7|8) return 0 ;;
- *) die "Update apply_patches() for ${EAPI}." ;;
- esac
-}
-
-tc_supports_dostrip || RESTRICT+=" strip" # cross-compilers need controlled
stripping
-
TC_FEATURES=()
tc_has_feature() {
@@ -146,21 +135,21 @@ tc_has_feature() {
}
if [[ ${PN} != "kgcc64" && ${PN} != gcc-* ]] ; then
- IUSE+=" debug +cxx +nptl" TC_FEATURES+=(nptl)
+ IUSE+=" debug +cxx +nptl" TC_FEATURES+=( nptl )
[[ -n ${PIE_VER} ]] && IUSE+=" nopie"
[[ -n ${SPECS_VER} ]] && IUSE+=" nossp"
- IUSE+=" +fortran" TC_FEATURES+=(fortran)
+ IUSE+=" +fortran" TC_FEATURES+=( fortran )
IUSE+=" doc hardened multilib objc"
- tc_version_is_between 3 7 && IUSE+=" awt gcj" TC_FEATURES+=(gcj)
+ tc_version_is_between 3 7 && IUSE+=" awt gcj" TC_FEATURES+=( gcj )
IUSE+=" pgo"
- IUSE+=" objc-gc" TC_FEATURES+=(objc-gc)
+ IUSE+=" objc-gc" TC_FEATURES+=( objc-gc )
IUSE+=" libssp objc++"
IUSE+=" +openmp"
tc_version_is_at_least 4.3 && IUSE+=" fixed-point"
tc_version_is_at_least 4.7 && IUSE+=" go"
# sanitizer support appeared in gcc-4.8, but > S + SRC_URI essentials <<
@@ -447,25 +432,9 @@ toolchain_src_unpack() {
#>> src_prepare <<
-# 'epatch' is not available in EAPI=7. Abstract away patchset application
-# until we eventually get all gcc ebuilds on EAPI=7 or later.
-tc_apply_patches() {
- [[ ${#@} -lt 2 ]] && die "usage: tc_apply_patches
"
-
- einfo "$1"; shift
-
- case ${EAPI} in
- # Note: even for EAPI=6 we used 'epatch' semantics. To avoid
- # breaking existing ebuilds use 'eapply' only in EAPI=7 or
later.
- 5|6) epatch "$@" ;;
- 7|8) eapply "$@" ;;
- *) die "Update apply_patches() for ${EAPI}." ;;
- esac
-}
-
toolchain_src_prepare() {
export BRANDING_GCC_PKGVERSION="Gentoo ${GCC_PVR}"
- cd "${S}"
+ cd "${S}" || die
do_gcc_gentoo_patches
do_gcc_PIE_patches
@@ -475,11 +444,7 @@ toolchain_src_prepare() {
BRANDING_GCC_PKGVERSION="${BRANDING_GCC_PKGVERSION}, commit
${EGIT_VERSION}"
fi
- case ${EAPI} in
- 5) epatch_user;;
- 6|7|8) eapply_user ;;
- *) die "Update toolchain_src_prepare() for ${EAPI}." ;;
- esac
+ eapply_user
if ( tc_version_is_at_least 4.8.2 || _tc_use_if_iuse hardened ) \
&& ! use vanilla ; then
@@ -490,7 +455,7 @@ toolchain_src_prepare() {
# since we configure with just one --libdir, we can't use that
# (as gcc itself takes care of building multilibs). #435728
find "${S}" -name Makefile.in \
- -exec sed -i
'/^pkgconfigdir/s:=.*:=$(toolexeclibdir)/pkgconfig:' {} +
+ -exec sed -i
'/^pkgconfigdir/s:=.*:=$(toolexeclibdir)/pkgconfig:' {} + || die
setup_multilib_osdirnames
gcc_version_patch
@@ -532,10 +497,11 @@ toolchain_src_prepare() {
|| eerror "Please file a bug about this"
eend $?
done
- sed -i 's|A-Za-z0-9|[:alnum:]|g' "${S}"/gcc/*.awk #215828
+ sed -i 's|A-Za-z0-9|[:alnum:]|g' "${S}"/gcc/*.awk || die #215828
# Prevent new texinfo from breaking old versions (see #198182, #464008)
- tc_apply_patches "Remove texinfo (bug #198182, bug #464008)"
"${FILESDIR}"/gcc-configure-texinfo.patch
+ einfo "Remove texinfo (bug #198182, bug #464008)"
+ eapply "${FILESDIR}"/gcc-configure-texinfo.patch
# >=gcc-4
if [[ -x contrib/gcc_update ]] ; then
@@ -550,7 +516,8 @@ toolchain_src_prepare() {
do_gcc_gentoo_patches() {
if ! use vanilla ; then
if [[ -n ${PATCH_VER} ]] ; then
- tc_apply_patches "Applying Gentoo patches ..."
"${WORKDIR}"/patch/*.patch
+ einfo "Applying Gentoo patches ..."
+