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: Fri, 30 Apr 2021 18:20:39
Message-Id: 1619806791.330123f3a98e3ad9ca8e49d942ee813ede0d0211.mpagano@gentoo
1 commit: 330123f3a98e3ad9ca8e49d942ee813ede0d0211
2 Author: Mike Pagano <mpagano <AT> gentoo <DOT> org>
3 AuthorDate: Fri Apr 30 18:19:51 2021 +0000
4 Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org>
5 CommitDate: Fri Apr 30 18:19:51 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=330123f3
7
8 kernel-2.eclass: Simplify and streamline code for the CPU OPT patch
9
10 Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org>
11
12 eclass/kernel-2.eclass | 29 +++++++++++++++++++++++++++--
13 1 file changed, 27 insertions(+), 2 deletions(-)
14
15 diff --git a/eclass/kernel-2.eclass b/eclass/kernel-2.eclass
16 index 67ad4acc1fe..f1f23f6a0e4 100644
17 --- a/eclass/kernel-2.eclass
18 +++ b/eclass/kernel-2.eclass
19 @@ -1241,8 +1241,32 @@ unipatch() {
20 local GCC_MAJOR_VER=$(gcc-major-version)
21 local GCC_MINOR_VER=$(gcc-minor-version)
22
23 - # optimization patch for gcc < 8.X and kernel > 4.13
24 - if kernel_is ge 4 13 ; then
25 + # this section should be the target state to handle the cpu opt
26 + # patch for kernels > 4.19.189, 5.4.115, 5.10.33 and 5.11.17,
27 + # 5.12.0 and gcc >= 9 The patch now handles the
28 + # gcc version enabled on the system through the Kconfig file as
29 + # 'depends'. The legacy section can hopefully be retired in the future
30 + # Note the patch for 4.19-5.8 version are the same and the patch for
31 + # 5.8+ version is the same
32 + # eventually we can remove everything except the gcc ver <9 check
33 + # based on stablization, time, kernel removals or a combo of all three
34 + if ( kernel_is eq 4 19 && kernel_is gt 4 19 189 ) ||
35 + ( kernel_is eq 5 4 && kernel_is gt 5 4 115 ) ||
36 + ( kernel_is eq 5 10 && kernel_is gt 5 10 33 ) ||
37 + ( kernel_is eq 5 11 && kernel_is gt 5 11 17 ) ||
38 + ( kernel_is eq 5 12 && kernel_is gt 5 12 0 ); then
39 + UNIPATCH_DROP+=" 5010_enable-additional-cpu-optimizations-for-gcc.patch"
40 + UNIPATCH_DROP+=" 5010_enable-additional-cpu-optimizations-for-gcc-4.9.patch"
41 + UNIPATCH_DROP+=" 5011_enable-cpu-optimizations-for-gcc8.patch"
42 + UNIPATCH_DROP+=" 5012_enable-cpu-optimizations-for-gcc91.patch"
43 + UNIPATCH_DROP+=" 5013_enable-cpu-optimizations-for-gcc10.patch"
44 + if [[ ${GCC_MAJOR_VER} -lt 9 ]]; then
45 + UNIPATCH_DROP+=" 5010_enable-cpu-optimizations-universal.patch"
46 + fi
47 + # this legacy section should be targeted for removal
48 + # optimization patch for gcc < 8.X and kernel > 4.13 and < 4.19
49 + elif kernel_is ge 4 13; then
50 + UNIPATCH_DROP+=" 5010_enable-cpu-optimizations-universal.patch"
51 if [[ ${GCC_MAJOR_VER} -lt 8 ]] && [[ ${GCC_MAJOR_VER} -gt 4 ]]; then
52 UNIPATCH_DROP+=" 5011_enable-cpu-optimizations-for-gcc8.patch"
53 UNIPATCH_DROP+=" 5012_enable-cpu-optimizations-for-gcc91.patch"
54 @@ -1272,6 +1296,7 @@ unipatch() {
55 UNIPATCH_DROP+=" 5013_enable-cpu-optimizations-for-gcc10.patch"
56 fi
57 else
58 + UNIPATCH_DROP+=" 5010_enable-cpu-optimizations-universal.patch"
59 UNIPATCH_DROP+=" 5010_enable-additional-cpu-optimizations-for-gcc.patch"
60 UNIPATCH_DROP+=" 5010_enable-additional-cpu-optimizations-for-gcc-4.9.patch"
61 UNIPATCH_DROP+=" 5011_enable-cpu-optimizations-for-gcc8.patch"