From: Mike Pagano Date: Fri, 13 Feb 2015 01:30:50 +0000 (+0000) Subject: Handle cpu optimization patch for different gcc versions X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=069db5bca57777079036a0fb19fdc4d042f69d80;p=gentoo.git Handle cpu optimization patch for different gcc versions --- diff --git a/eclass/kernel-2.eclass b/eclass/kernel-2.eclass index 4b850146e33e..82c15791407c 100644 --- a/eclass/kernel-2.eclass +++ b/eclass/kernel-2.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/kernel-2.eclass,v 1.297 2014/11/28 17:40:20 mpagano Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/kernel-2.eclass,v 1.298 2015/02/13 01:30:50 mpagano Exp $ # Description: kernel.eclass rewrite for a clean base regarding the 2.6 # series of kernel with back-compatibility for 2.4 @@ -157,6 +157,16 @@ handle_genpatches() { if use experimental ; then UNIPATCH_LIST_GENPATCHES+=" ${DISTDIR}/${tarball}" debug-print "genpatches tarball: $tarball" + + # check gcc version < 4.9.X uses patch 5000 and = 4.9.X uses patch 5010 + if [[ $(gcc-major-version) -eq 4 ]] && [[ $(gcc-minor-version) -ne 9 ]]; then + # drop 5000_enable-additional-cpu-optimizations-for-gcc-4.9.patch + UNIPATCH_EXCLUDE+=" 5010_enable-additional-cpu-optimizations-for-gcc-4.9.patch" + else + #drop 5000_enable-additional-cpu-optimizations-for-gcc.patch + UNIPATCH_EXCLUDE+=" 5000_enable-additional-cpu-optimizations-for-gcc.patch" + fi + fi else UNIPATCH_LIST_GENPATCHES+=" ${DISTDIR}/${tarball}"