Gentoo Archives: gentoo-dev

From: Mike <mpagano@g.o>
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] [PATCH 1/1] kernel-2.eclass: Update cpu optimization support
Date: Sat, 16 Feb 2019 19:40:44
Message-Id: f01b0b78-b7e2-d97e-7cf2-6de2c92415d2@gentoo.org
1 This patch clean's up the logic for applying or dropping
2 the cpu optimization patch. This patch will also support
3 the applying of the cpu optimization patch that supports
4 gcc v8. That patch will eventually be in genpatches and
5 also applied via the 'experimental' use flag sometime after
6 this patch is comitted.
7
8 Signed-off-by: Mike Pagano <mpagano@g.o>
9 ---
10 eclass/kernel-2.eclass | 23 ++++++++++++++---------
11 1 file changed, 14 insertions(+), 9 deletions(-)
12
13 diff --git a/eclass/kernel-2.eclass b/eclass/kernel-2.eclass
14 index edbb4a858..423397caf 100644
15 --- a/eclass/kernel-2.eclass
16 +++ b/eclass/kernel-2.eclass
17 @@ -1227,16 +1227,21 @@ unipatch() {
18 UNIPATCH_LIST_GENPATCHES+=" ${DISTDIR}/${tarball}"
19 debug-print "genpatches tarball: $tarball"
20
21 - # check gcc version < 4.9.X uses patch 5000 and = 4.9.X uses patch 5010
22 - if [[ $(gcc-major-version) -eq 4 ]] && [[ $(gcc-minor-version) -ne 9 ]]; then
23 - # drop 5000_enable-additional-cpu-optimizations-for-gcc-4.9.patch
24 - if [[ $UNIPATCH_DROP != *"5010_enable-additional-cpu-optimizations-for-gcc-4.9.patch"* ]]; then
25 - UNIPATCH_DROP+=" 5010_enable-additional-cpu-optimizations-for-gcc-4.9.patch"
26 + local GCC_MAJOR_VER=$(gcc-major-version)
27 + local GCC_MINOR_VER=$(gcc-minor-version)
28 +
29 + # support old kernels for a period. For now, remove as all gcc versions required are masked
30 + UNIPATCH_DROP+=" 5010_enable-additional-cpu-optimizations-for-gcc.patch"
31 +
32 + # optimization patch for gcc < 8.X and kernel > 4.13
33 + if [[ ${GCC_MAJOR_VER} -lt 8 ]] && [[ ${GCC_MAJOR_VER} -gt 4 ]]; then
34 + if kernel_is ge 4 13 ; then
35 + UNIPATCH_DROP+=" 5011_enable-cpu-optimizations-for-gcc8.patch"
36 fi
37 - else
38 - if [[ $UNIPATCH_DROP != *"5000_enable-additional-cpu-optimizations-for-gcc.patch"* ]]; then
39 - #drop 5000_enable-additional-cpu-optimizations-for-gcc.patch
40 - UNIPATCH_DROP+=" 5000_enable-additional-cpu-optimizations-for-gcc.patch"
41 + # optimization patch for gcc >= 8 and kernel >= 3.15
42 + elif [[ "${GCC_MAJOR_VER}" -ge 8 ]]; then
43 + if kernel_is ge 3 15; then
44 + UNIPATCH_DROP+=" 5010_enable-additional-cpu-optimizations-for-gcc-4.9.patch"
45 fi
46 fi
47 fi
48 --
49 2.20.1

Attachments

File name MIME type
signature.asc application/pgp-signature