Support gcc9 cpu optimzation patch.

Any better thoughts on handling this in a 
cleaner, easily maintainable manner ?

Signed-off-by: Mike Pagano <[email protected]>
---
 eclass/kernel-2.eclass | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)

diff --git a/eclass/kernel-2.eclass b/eclass/kernel-2.eclass
index 1b2b5d3e8..0b5a53aa2 100644
--- a/eclass/kernel-2.eclass
+++ b/eclass/kernel-2.eclass
@@ -1234,14 +1234,29 @@ unipatch() {
      if [[ ${GCC_MAJOR_VER} -lt 8 ]] && [[ ${GCC_MAJOR_VER} -gt 4 ]]; then
        if kernel_is ge 4 13 ; then
          UNIPATCH_DROP+=" 5011_enable-cpu-optimizations-for-gcc8.patch"
+         UNIPATCH_DROP+=" 5012_enable-cpu-optimizations-for-gcc9.patch"
        fi
-     # optimization patch for gcc >= 8 and kernel ge 4.13
-     elif [[ "${GCC_MAJOR_VER}" -ge 8 ]]; then
+     # optimization patch for gcc = 8 and kernel ge 4.13
+     elif [[ "${GCC_MAJOR_VER}" -eq 8 ]]; then
        if kernel_is ge 4 13; then
          # support old kernels for a period. For now, remove as all gcc 
versions required are masked
          UNIPATCH_DROP+=" 
5010_enable-additional-cpu-optimizations-for-gcc.patch"
          UNIPATCH_DROP+=" 
5010_enable-additional-cpu-optimizations-for-gcc-4.9.patch"
+         UNIPATCH_DROP+=" 5012_enable-cpu-optimizations-for-gcc9.patch"
        fi
+     # optimization patch for gcc = 9 and kernel ge 4.13
+     elif [[ "${GCC_MAJOR_VER}" -eq 9 ]]; then
+       if kernel_is ge 4 13; then
+         # support old kernels for a period. For now, remove as all gcc 
versions required are masked
+         UNIPATCH_DROP+=" 
5010_enable-additional-cpu-optimizations-for-gcc.patch"
+         UNIPATCH_DROP+=" 
5010_enable-additional-cpu-optimizations-for-gcc-4.9.patch"
+         UNIPATCH_DROP+=" 5011_enable-cpu-optimizations-for-gcc8.patch"
+       fi
+     else
+       UNIPATCH_DROP+=" 5010_enable-additional-cpu-optimizations-for-gcc.patch"
+       UNIPATCH_DROP+=" 
5010_enable-additional-cpu-optimizations-for-gcc-4.9.patch"
+       UNIPATCH_DROP+=" 5011_enable-cpu-optimizations-for-gcc8.patch"
+       UNIPATCH_DROP+=" 5012_enable-cpu-optimizations-for-gcc9.patch"
      fi
    fi
  done
-- 
2.21.0

-- 
Mike Pagano
Gentoo Developer - Kernel Project
Gentoo Sources - Member
E-Mail     : [email protected]
GnuPG FP   : EEE2 601D 0763 B60F 848C  9E14 3C33 C650 B576 E4E3
Public Key : http://pgp.mit.edu:11371/pks/lookup?search=0xB576E4E3&op=index

Reply via email to