summaryrefslogtreecommitdiff
path: root/eclass/kernel-2.eclass
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2019-02-20 15:11:50 +0000
committerV3n3RiX <venerix@redcorelinux.org>2019-02-20 15:11:50 +0000
commit16449a80e28af2209916cc66d19c9a44ca2b90d9 (patch)
treeb4cfe2332c7a6c5da27b6985bf05db4508df1a92 /eclass/kernel-2.eclass
parent79599515788b85b18aa655e7b7f8cc05c1bbddd8 (diff)
gentoo resync : 20.02.2019
Diffstat (limited to 'eclass/kernel-2.eclass')
-rw-r--r--eclass/kernel-2.eclass23
1 files changed, 14 insertions, 9 deletions
diff --git a/eclass/kernel-2.eclass b/eclass/kernel-2.eclass
index edbb4a8584d4..ece1edfb36c6 100644
--- a/eclass/kernel-2.eclass
+++ b/eclass/kernel-2.eclass
@@ -1227,16 +1227,21 @@ unipatch() {
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
- if [[ $UNIPATCH_DROP != *"5010_enable-additional-cpu-optimizations-for-gcc-4.9.patch"* ]]; then
- UNIPATCH_DROP+=" 5010_enable-additional-cpu-optimizations-for-gcc-4.9.patch"
+ local GCC_MAJOR_VER=$(gcc-major-version)
+ local GCC_MINOR_VER=$(gcc-minor-version)
+
+ # 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"
+
+ # optimization patch for gcc < 8.X and kernel > 4.13
+ 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"
fi
- else
- if [[ $UNIPATCH_DROP != *"5000_enable-additional-cpu-optimizations-for-gcc.patch"* ]]; then
- #drop 5000_enable-additional-cpu-optimizations-for-gcc.patch
- UNIPATCH_DROP+=" 5000_enable-additional-cpu-optimizations-for-gcc.patch"
+ # optimization patch for gcc >= 8 and kernel ge 4.13
+ elif [[ "${GCC_MAJOR_VER}" -ge 8 ]]; then
+ if kernel_is ge 4 13; then
+ UNIPATCH_DROP+=" 5010_enable-additional-cpu-optimizations-for-gcc-4.9.patch"
fi
fi
fi