Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/
Date: Sat, 22 Jan 2022 22:19:10
Message-Id: 1642889930.b15178943cb7a5a2ec58ae75ec6854860f73a8c9.sam@gentoo
1 commit: b15178943cb7a5a2ec58ae75ec6854860f73a8c9
2 Author: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
3 AuthorDate: Fri Jun 1 00:00:00 2018 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Sat Jan 22 22:18:50 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b1517894
7
8 flag-o-matic.eclass: strip-flags: Fix logic to properly support "=" in patterns.
9
10 Signed-off-by: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache.Org>
11 Signed-off-by: Sam James <sam <AT> gentoo.org>
12
13 eclass/flag-o-matic.eclass | 23 +++++++++++------------
14 1 file changed, 11 insertions(+), 12 deletions(-)
15
16 diff --git a/eclass/flag-o-matic.eclass b/eclass/flag-o-matic.eclass
17 index 32119cb9a526..f8181a17e911 100644
18 --- a/eclass/flag-o-matic.eclass
19 +++ b/eclass/flag-o-matic.eclass
20 @@ -1,4 +1,4 @@
21 -# Copyright 1999-2021 Gentoo Authors
22 +# Copyright 1999-2022 Gentoo Authors
23 # Distributed under the terms of the GNU General Public License v2
24
25 # @ECLASS: flag-o-matic.eclass
26 @@ -48,7 +48,7 @@ setup-allowed-flags() {
27 # Note: shell globs and character lists are allowed
28 _setup-allowed-flags() {
29 ALLOWED_FLAGS=(
30 - -pipe -O '-O[12sg]' -mcpu -march -mtune
31 + -pipe -O '-O[12sg]' '-mcpu=*' '-march=*' '-mtune=*'
32 '-fstack-protector*'
33 '-fsanitize*' '-fno-sanitize*'
34 '-fstack-check*' -fno-stack-check
35 @@ -70,7 +70,7 @@ _setup-allowed-flags() {
36 '-[DUILR]*' '-Wl,*'
37
38 # Linker choice flag
39 - '-fuse-ld'
40 + '-fuse-ld=*'
41 )
42
43 # allow a bunch of flags that negate features / control ABI
44 @@ -80,19 +80,19 @@ _setup-allowed-flags() {
45 -fno-omit-frame-pointer '-fno-builtin*'
46 )
47 ALLOWED_FLAGS+=(
48 - -mregparm -mno-app-regs -mapp-regs -mno-mmx -mno-sse
49 + '-mregparm=*' -mno-app-regs -mapp-regs -mno-mmx -mno-sse
50 -mno-sse2 -mno-sse3 -mno-ssse3 -mno-sse4 -mno-sse4.1 -mno-sse4.2
51 -mno-avx -mno-aes -mno-pclmul -mno-sse4a -mno-3dnow -mno-popcnt
52 -mno-abm -mips1 -mips2 -mips3 -mips4 -mips32 -mips64 -mips16 -mplt
53 - -msoft-float -mno-soft-float -mhard-float -mno-hard-float -mfpu
54 - -mieee -mieee-with-inexact -mschedule -mfloat-gprs -mspe -mno-spe
55 + -msoft-float -mno-soft-float -mhard-float -mno-hard-float '-mfpu=*'
56 + -mieee -mieee-with-inexact '-mschedule=*' -mfloat-gprs -mspe -mno-spe
57 -mtls-direct-seg-refs -mno-tls-direct-seg-refs -mflat -mno-flat
58 - -mno-faster-structs -mfaster-structs -m32 -m64 -mx32 -mabi
59 - -mlittle-endian -mbig-endian -EL -EB -fPIC -mlive-g0 -mcmodel
60 - -mstack-bias -mno-stack-bias -msecure-plt '-m*-toc' -mfloat-abi
61 + -mno-faster-structs -mfaster-structs -m32 -m64 -mx32 '-mabi=*'
62 + -mlittle-endian -mbig-endian -EL -EB -fPIC -mlive-g0 '-mcmodel=*'
63 + -mstack-bias -mno-stack-bias -msecure-plt '-m*-toc' '-mfloat-abi=*'
64 -mfix-r4000 -mno-fix-r4000 -mfix-r4400 -mno-fix-r4400
65 -mfix-rm7000 -mno-fix-rm7000 -mfix-r10000 -mno-fix-r10000
66 - -mr10k-cache-barrier -mthumb -marm
67 + '-mr10k-cache-barrier=*' -mthumb -marm
68
69 # gcc 4.5
70 -mno-fma4 -mno-movbe -mno-xop -mno-lwp
71 @@ -452,9 +452,8 @@ strip-flags() {
72 local new=()
73
74 for x in ${!var} ; do
75 - local flag=${x%%=*}
76 for y in "${ALLOWED_FLAGS[@]}" ; do
77 - if [[ -z ${flag%%${y}} ]] ; then
78 + if [[ ${x} == ${y} ]] ; then
79 new+=( "${x}" )
80 break
81 fi