summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorRyan Hill <rhill@gentoo.org>2014-06-01 23:00:45 +0000
committerRyan Hill <rhill@gentoo.org>2014-06-01 23:00:45 +0000
commit3207e284f26142970582ec606d178be43bfd17ac (patch)
tree0d5d095c3f175f3267b1e17ecc0a303126b4f702 /eclass
parentrespect GAMES variables wrt #494202, install icon and desktop file wrt #494224 (diff)
downloadgentoo-2-3207e284f26142970582ec606d178be43bfd17ac.tar.gz
gentoo-2-3207e284f26142970582ec606d178be43bfd17ac.tar.bz2
gentoo-2-3207e284f26142970582ec606d178be43bfd17ac.zip
If we keep the flag list sorted by version there's no need for this function
to be recursive. This shaves a couple seconds off the worst-case runtime.
Diffstat (limited to 'eclass')
-rw-r--r--eclass/ChangeLog6
-rw-r--r--eclass/toolchain.eclass15
2 files changed, 12 insertions, 9 deletions
diff --git a/eclass/ChangeLog b/eclass/ChangeLog
index 03d4812a6f92..72f78b336aa4 100644
--- a/eclass/ChangeLog
+++ b/eclass/ChangeLog
@@ -1,6 +1,10 @@
# ChangeLog for eclass directory
# Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1279 2014/06/01 22:07:59 mgorny Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1280 2014/06/01 23:00:45 rhill Exp $
+
+ 01 Jun 2014; Ryan Hill <rhill@gentoo.org> toolchain.eclass:
+ If we keep the flag list sorted by version there's no need for this function
+ to be recursive. This shaves a couple seconds off the worst-case runtime.
01 Jun 2014; Michał Górny <mgorny@gentoo.org> git-r3.eclass,
+tests/git-r3:subrepos.sh:
diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index 7c013532fd8d..4f48202d62ee 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain.eclass,v 1.631 2014/06/01 17:29:42 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain.eclass,v 1.632 2014/06/01 23:00:45 rhill Exp $
# Maintainer: Toolchain Ninjas <toolchain@gentoo.org>
@@ -1233,8 +1233,8 @@ downgrade_arch_flags() {
[[ ${mytune} == x86-64 ]] && filter-flags '-mtune=*'
[[ ${bver} < 3.4 ]] && filter-flags '-mtune=*'
+ # "added" "arch" "replacement"
local archlist=(
- # "added" "arch" "replacement"
4.9 bdver4 bdver3
4.9 bonnell atom
4.9 broadwell core-avx2
@@ -1271,10 +1271,10 @@ downgrade_arch_flags() {
3.4 pentium4m pentium4
)
- myarch=$(get-flag march)
- mytune=$(get-flag mtune)
-
for ((i = 0; i < ${#archlist[@]}; i += 3)) ; do
+ myarch=$(get-flag march)
+ mytune=$(get-flag mtune)
+
ver=${archlist[i]}
arch=${archlist[i + 1]}
rep=${archlist[i + 2]}
@@ -1285,15 +1285,14 @@ downgrade_arch_flags() {
einfo "Replacing ${myarch} (added in gcc ${ver}) with ${rep}..."
[[ ${myarch} == ${arch} ]] && replace-cpu-flags ${myarch} ${rep}
[[ ${mytune} == ${arch} ]] && replace-cpu-flags ${mytune} ${rep}
- downgrade_arch_flags ${1:-${GCC_BRANCH_VER}}
- break
+ continue
else
break
fi
done
+ # we only check -mno* here since -m* get removed by strip-flags later on
local isalist=(
- # we only check -mno* here since -m* get removed by strip-flags later on
4.9 -mno-sha
4.9 -mno-avx512pf
4.9 -mno-avx512f