Gentoo Archives: gentoo-dev

From: Ulrich Mueller <ulm@g.o>
To: mpagano@g.o
Cc: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] [PATCH] Transitional changes to the kernel-2 eclass to support future CPU OPT
Date: Thu, 29 Apr 2021 12:59:17
Message-Id: uim45b61w@gentoo.org
In Reply to: [gentoo-dev] [PATCH] Transitional changes to the kernel-2 eclass to support future CPU OPT by mpagano@gentoo.org
1 >>>>> On Thu, 29 Apr 2021, mpagano wrote:
2
3 > --- a/eclass/kernel-2.eclass
4 > +++ b/eclass/kernel-2.eclass
5 > @@ -1241,8 +1241,32 @@ unipatch() {
6 > local GCC_MAJOR_VER=$(gcc-major-version)
7 > local GCC_MINOR_VER=$(gcc-minor-version)
8 >
9 > - # optimization patch for gcc < 8.X and kernel > 4.13
10 > - if kernel_is ge 4 13 ; then
11 > + # this section should be the target state to handle the cpu opt
12 > + # patch for kernels > 4.19.189, 5.4.115, 5.10.33 and 5.11.17,
13 > + # 5.12.0 and gcc >= 9 The patch now handles the
14 > + # gcc version enabled on the system through the Kconfig file as
15 > + # 'depends'. The legacy section can hopefully be retired in the future
16 > + # Note the patch for 4.19-5.8 version are the same and the patch for
17 > + # 5.8+ version is the same
18 > + # eventually we can remove everything except the gcc ver <9 check
19 > + # based on stablization, time, kernel removals or a combo of all three
20 > + if ((kernel_is eq 4 19 && kernel_is gt 4 19 189) ||
21 > + (kernel_is eq 5 4 && kernel_is gt 5 4 115) ||
22 > + (kernel_is eq 5 10 && kernel_is gt 5 10 33) ||
23 > + (kernel_is eq 5 11 && kernel_is gt 5 11 17) ||
24 > + (kernel_is eq 5 12 && kernel_is gt 5 12 0)); then
25
26 Looks like the outermost pair of parentheses ( ) isn't needed here.
27
28 Also, when writing nested parentheses without a space, bash may
29 sometimes (but not always!) interpret them as an arithmetic expression.
30 This can cause unexpected results:
31
32 $ ((true) && (true)); echo $?
33 0
34 $ ( (true && true) ); echo $?
35 0
36 $ ((true && true)); echo $?
37 1
38 $ true=42
39 $ ((true && true)); echo $?
40 0
41
42 > [...]

Attachments

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

Replies