diff options
author | 2013-12-28 08:52:36 +0000 | |
---|---|---|
committer | 2013-12-28 08:52:36 +0000 | |
commit | 85b9733d7b5017322b2e953961b277b7009cdbf6 (patch) | |
tree | 0263c0c7861c5fbac5dcc1d4f7ea01060426546a /eclass | |
parent | Add tc_version_is_between() helper. (diff) | |
download | historical-85b9733d7b5017322b2e953961b277b7009cdbf6.tar.gz historical-85b9733d7b5017322b2e953961b277b7009cdbf6.tar.bz2 historical-85b9733d7b5017322b2e953961b277b7009cdbf6.zip |
Use version ranges instead of case statements in gcc_do_filter_flags().
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/ChangeLog | 5 | ||||
-rw-r--r-- | eclass/toolchain.eclass | 103 |
2 files changed, 51 insertions, 57 deletions
diff --git a/eclass/ChangeLog b/eclass/ChangeLog index 6e6fa707342f..0a0b59404ecc 100644 --- a/eclass/ChangeLog +++ b/eclass/ChangeLog @@ -1,6 +1,9 @@ # ChangeLog for eclass directory # Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1096 2013/12/28 08:11:41 dirtyepic Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1097 2013/12/28 08:52:36 dirtyepic Exp $ + + 28 Dec 2013; Ryan Hill <dirtyepic@gentoo.org> toolchain.eclass: + Use version ranges instead of case statements in gcc_do_filter_flags(). 28 Dec 2013; Ryan Hill <dirtyepic@gentoo.org> toolchain.eclass: Add tc_version_is_between() helper. diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass index 0e15a0f0a1c0..506e89a34491 100644 --- a/eclass/toolchain.eclass +++ b/eclass/toolchain.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain.eclass,v 1.613 2013/12/28 08:11:41 dirtyepic Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/toolchain.eclass,v 1.614 2013/12/28 08:52:36 dirtyepic Exp $ # Maintainer: Toolchain Ninjas <toolchain@gentoo.org> @@ -1195,7 +1195,6 @@ toolchain_src_configure() { gcc_do_filter_flags() { strip-flags - replace-flags -O? -O2 # dont want to funk ourselves @@ -1203,66 +1202,58 @@ gcc_do_filter_flags() { filter-flags '-frecord-gcc-switches' # 490738 - case ${GCC_BRANCH_VER} in - 3.2|3.3) - replace-cpu-flags k8 athlon64 opteron x86-64 - replace-cpu-flags pentium-m pentium3m pentium3 - replace-cpu-flags G3 750 - replace-cpu-flags G4 7400 - replace-cpu-flags G5 7400 + if tc_version_is_between 3.2 3.4 ; then + # XXX: this is so outdated it's barely useful, but it don't hurt... + replace-cpu-flags k8 athlon64 opteron x86-64 + replace-cpu-flags pentium-m pentium3m pentium3 + replace-cpu-flags G3 750 + replace-cpu-flags G4 7400 + replace-cpu-flags G5 7400 - case $(tc-arch) in - amd64) - replace-cpu-flags core2 nocona - filter-flags '-mtune=*' - ;; - x86) - replace-cpu-flags core2 prescott - filter-flags '-mtune=*' - ;; - esac + case $(tc-arch) in + amd64) + replace-cpu-flags core2 nocona + filter-flags '-mtune=*' + ;; + x86) + replace-cpu-flags core2 prescott + filter-flags '-mtune=*' + ;; + esac - # XXX: should add a sed or something to query all supported flags - # from the gcc source and trim everything else ... - filter-flags -f{no-,}unit-at-a-time -f{no-,}web -mno-tls-direct-seg-refs - filter-flags -f{no-,}stack-protector{,-all} - filter-flags -fvisibility-inlines-hidden -fvisibility=hidden - ;; - 3.4|4.*) - case $(tc-arch) in - amd64|x86) - filter-flags '-mcpu=*' - ;; - alpha) - # https://bugs.gentoo.org/454426 - append-ldflags -Wl,--no-relax - ;; - sparc) - # temporary workaround for random ICEs reproduced by multiple users - # https://bugs.gentoo.org/457062 - [[ ${GCC_BRANCH_VER} == 4.6 || ${GCC_BRANCH_VER} == 4.7 ]] && \ - MAKEOPTS+=" -j1" - ;; - *-macos) - # http://gcc.gnu.org/PR25127 - [[ ${GCC_BRANCH_VER} == 4.0 || ${GCC_BRANCH_VER} == 4.1 ]] && \ - filter-flags '-mcpu=*' '-march=*' '-mtune=*' - ;; - esac - ;; - esac + # XXX: should add a sed or something to query all supported flags + # from the gcc source and trim everything else ... + filter-flags -f{no-,}unit-at-a-time -f{no-,}web -mno-tls-direct-seg-refs + filter-flags -f{no-,}stack-protector{,-all} + filter-flags -fvisibility-inlines-hidden -fvisibility=hidden + fi - case ${GCC_BRANCH_VER} in - 4.6) - case $(tc-arch) in - amd64|x86) + if tc_version_is_at_least 3.4 ; then + case $(tc-arch) in + amd64|x86) + filter-flags '-mcpu=*' + if tc_version_is_between 4.6 4.7 ; then # https://bugs.gentoo.org/411333 # https://bugs.gentoo.org/466454 replace-cpu-flags c3-2 pentium2 pentium3 pentium3m pentium-m i686 - ;; - esac - ;; - esac + fi + ;; + alpha) + # https://bugs.gentoo.org/454426 + append-ldflags -Wl,--no-relax + ;; + sparc) + # temporary workaround for random ICEs reproduced by multiple users + # https://bugs.gentoo.org/457062 + tc_version_is_between 4.6 4.8 && MAKEOPTS+=" -j1" + ;; + *-macos) + # http://gcc.gnu.org/PR25127 + tc_version_is_between 4.0 4.2 && \ + filter-flags '-mcpu=*' '-march=*' '-mtune=*' + ;; + esac + fi strip-unsupported-flags |