diff options
author | Mike Pagano <mpagano@gentoo.org> | 2019-02-18 18:15:37 -0500 |
---|---|---|
committer | Mike Pagano <mpagano@gentoo.org> | 2019-02-18 18:16:32 -0500 |
commit | 9b7fecc18d011e82dab89fc145f6a1a2f570dc28 (patch) | |
tree | bccc587ac535fc5888a20c87d58b793e37c5b69e /eclass | |
parent | app-admin/sysstat: Add live ebuild (diff) | |
download | gentoo-9b7fecc18d011e82dab89fc145f6a1a2f570dc28.tar.gz gentoo-9b7fecc18d011e82dab89fc145f6a1a2f570dc28.tar.bz2 gentoo-9b7fecc18d011e82dab89fc145f6a1a2f570dc28.zip |
eclass: Update cpu optimization support in kernel-2.eclass
This patch clean's up the logic when applying or dropping
the cpu optimization patch. This patch will also support
the applying of the gcc v8 patch which will eventually be
in genpatches and applied also via the 'experiemental' use
flag after this support is enabled.
Signed-off-by: Mike Pagano <mpagano@gentoo.org>
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/kernel-2.eclass | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/eclass/kernel-2.eclass b/eclass/kernel-2.eclass index edbb4a8584d4..dd6ad88746cc 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 3.15 + elif [[ "${GCC_MAJOR_VER}" -ge 8 ]]; then + if kernel_is ge 3 15; then + UNIPATCH_DROP+=" 5010_enable-additional-cpu-optimizations-for-gcc-4.9.patch" fi fi fi |