1 |
From: Mike Pagano <mpagano@g.o> |
2 |
|
3 |
The CPU OPT patch now contains gcc ver checks within |
4 |
the patch itself. This transitional change is to start support |
5 |
just that patch while trying not to break the older versions. |
6 |
|
7 |
The target state will *only* need the gcc version check. |
8 |
We should be able to slowly remove the legacy code as we |
9 |
stabilize kernels and remove old ones from the tree. |
10 |
|
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 67ad4acc1..f676e8421 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 path 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" |
62 |
-- |
63 |
2.26.3 |