Gentoo Archives: gentoo-commits

From: Mike Pagano <mpagano@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/
Date: Mon, 18 Feb 2019 23:16:44
Message-Id: 1550531792.9b7fecc18d011e82dab89fc145f6a1a2f570dc28.mpagano@gentoo
1 commit: 9b7fecc18d011e82dab89fc145f6a1a2f570dc28
2 Author: Mike Pagano <mpagano <AT> gentoo <DOT> org>
3 AuthorDate: Mon Feb 18 23:15:37 2019 +0000
4 Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org>
5 CommitDate: Mon Feb 18 23:16:32 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9b7fecc1
7
8 eclass: Update cpu optimization support in kernel-2.eclass
9
10 This patch clean's up the logic when applying or dropping
11 the cpu optimization patch. This patch will also support
12 the applying of the gcc v8 patch which will eventually be
13 in genpatches and applied also via the 'experiemental' use
14 flag after this support is enabled.
15
16 Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org>
17
18 eclass/kernel-2.eclass | 23 ++++++++++++++---------
19 1 file changed, 14 insertions(+), 9 deletions(-)
20
21 diff --git a/eclass/kernel-2.eclass b/eclass/kernel-2.eclass
22 index edbb4a8584d..dd6ad88746c 100644
23 --- a/eclass/kernel-2.eclass
24 +++ b/eclass/kernel-2.eclass
25 @@ -1227,16 +1227,21 @@ unipatch() {
26 UNIPATCH_LIST_GENPATCHES+=" ${DISTDIR}/${tarball}"
27 debug-print "genpatches tarball: $tarball"
28
29 - # check gcc version < 4.9.X uses patch 5000 and = 4.9.X uses patch 5010
30 - if [[ $(gcc-major-version) -eq 4 ]] && [[ $(gcc-minor-version) -ne 9 ]]; then
31 - # drop 5000_enable-additional-cpu-optimizations-for-gcc-4.9.patch
32 - if [[ $UNIPATCH_DROP != *"5010_enable-additional-cpu-optimizations-for-gcc-4.9.patch"* ]]; then
33 - UNIPATCH_DROP+=" 5010_enable-additional-cpu-optimizations-for-gcc-4.9.patch"
34 + local GCC_MAJOR_VER=$(gcc-major-version)
35 + local GCC_MINOR_VER=$(gcc-minor-version)
36 +
37 + # support old kernels for a period. For now, remove as all gcc versions required are masked
38 + UNIPATCH_DROP+=" 5010_enable-additional-cpu-optimizations-for-gcc.patch"
39 +
40 + # optimization patch for gcc < 8.X and kernel > 4.13
41 + if [[ ${GCC_MAJOR_VER} -lt 8 ]] && [[ ${GCC_MAJOR_VER} -gt 4 ]]; then
42 + if kernel_is ge 4 13 ; then
43 + UNIPATCH_DROP+=" 5011_enable-cpu-optimizations-for-gcc8.patch"
44 fi
45 - else
46 - if [[ $UNIPATCH_DROP != *"5000_enable-additional-cpu-optimizations-for-gcc.patch"* ]]; then
47 - #drop 5000_enable-additional-cpu-optimizations-for-gcc.patch
48 - UNIPATCH_DROP+=" 5000_enable-additional-cpu-optimizations-for-gcc.patch"
49 + # optimization patch for gcc >= 8 and kernel ge 3.15
50 + elif [[ "${GCC_MAJOR_VER}" -ge 8 ]]; then
51 + if kernel_is ge 3 15; then
52 + UNIPATCH_DROP+=" 5010_enable-additional-cpu-optimizations-for-gcc-4.9.patch"
53 fi
54 fi
55 fi