• [gentoo-dev] [PATCH 1/8] flag-o-matic.eclass: strip-flags: Fix logic to

    From Sam James@21:1/5 to All on Tue Jan 18 19:30:02 2022
    From: Arfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org>

    Signed-off-by: Arfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org> Signed-off-by: Sam James <sam@gentoo.org>
    ---
    eclass/flag-o-matic.eclass | 23 +++++++++++------------
    1 file changed, 11 insertions(+), 12 deletions(-)

    diff --git a/eclass/flag-o-matic.eclass b/eclass/flag-o-matic.eclass
    index 32119cb9a526f..f8181a17e911a 100644
    --- a/eclass/flag-o-matic.eclass
    +++ b/eclass/flag-o-matic.eclass
    @@ -1,4 +1,4 @@
    -# Copyright 1999-2021 Gentoo Authors
    +# Copyright 1999-2022 Gentoo Authors
    # Distributed under the terms of the GNU General Public License v2

    # @ECLASS: flag-o-matic.eclass
    @@ -48,7 +48,7 @@ setup-allowed-flags() {
    # Note: shell globs and character lists are allowed
    _setup-allowed-flags() {
    ALLOWED_FLAGS=(
    - -pipe -O '-O[12sg]' -mcpu -march -mtune
    + -pipe -O '-O[12sg]' '-mcpu=*' '-march=*' '-mtune=*'
    '-fstack-protector*'
    '-fsanitize*' '-fno-sanitize*'
    '-fstack-check*' -fno-stack-check
    @@ -70,7 +70,7 @@ _setup-allowed-flags() {
    '-[DUILR]*' '-Wl,*'

    # Linker choice flag
    - '-fuse-ld'
    + '-fuse-ld=*'
    )

    # allow a bunch of flags that negate features / co
  • From Sam James@21:1/5 to All on Tue Jan 18 19:30:02 2022
    Needed for shadow stack bits on ARM64.

    Closes: https://bugs.gentoo.org/800533
    Thanks-to: Jannik Glückert <jannik.glueckert@gmail.com>
    Signed-off-by: Sam James <sam@gentoo.org>
    ---
    eclass/flag-o-matic.eclass | 3 +++
    1 file changed, 3 insertions(+)

    diff --git a/eclass/flag-o-matic.eclass b/eclass/flag-o-matic.eclass
    index a2e37b89b6f08..7ac4f4a7791d1 100644
    --- a/eclass/flag-o-matic.eclass
    +++ b/eclass/flag-o-matic.eclass
    @@ -109,6 +109,9 @@ _setup-allowed-flags() {
    -mfix-rm7000 -mno-fix-rm7000 -mfix-r10000 -mno-fix-r10000
    '-mr10k-cache-barrier=*' -mthumb -marm

    + # needed for arm64 (and in particular SCS)
    + -ffixed-x18
    +
    # gcc 4.5
    -mno-fma4 -mno-movbe -mno-xop -mno-lwp
    # gcc 4.6
    --
    2.34.1

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Sam James@21:1/5 to All on Tue Jan 18 19:30:03 2022
    Closes: https://bugs.gentoo.org/646076
    Signed-off-by: Sam James <sam@gentoo.org>
    ---
    eclass/flag-o-matic.eclass | 5 +++++
    1 file changed, 5 insertions(+)

    diff --git a/eclass/flag-o-matic.eclass b/eclass/flag-o-matic.eclass
    index 37577209281a1..d6590a2e52dfd 100644
    --- a/eclass/flag-o-matic.eclass
    +++ b/eclass/flag-o-matic.eclass
    @@ -55,6 +55,11 @@ _setup-allowed-flags() {
    '-fstack-check*' -fno-stack-check
    -fbounds-check -fbounds-checking
    -fno-PIE -fno-pie -nopie -no-pie
    + # Spectre mitigations, bug #646076
    + '-mindirect-branch=*'
    + -mindirect-branch-register
    + '-mfunction-return=*'
    + -mretpoline

    # Misc
    -fno-unit-at-a-time -fno-strict-overflow
    --
    2.34.1

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Sam James@21:1/5 to All on Tue Jan 18 19:30:04 2022
    Both of these options are useful for automated reports and should
    be harmless.

    Closes: https://bugs.gentoo.org/830534
    Reported-by: Agostino Sarubbo <ago@gentoo.org>
    Signed-off-by: Sam James <sam@gentoo.org>
    ---
    eclass/flag-o-matic.eclass | 2 ++
    1 file changed, 2 insertions(+)

    diff --git a/eclass/flag-o-matic.eclass b/eclass/flag-o-matic.eclass
    index f8181a17e911a..38ad14d8f5fe8 100644
    --- a/eclass/flag-o-matic.eclass
    +++ b/eclass/flag-o-matic.eclass
    @@ -62,6 +62,8 @@ _setup-allowed-flags() {
    -gstabs -gstabs+
    -gz

    + # Cosmetic/output related, see e.g. bug #830534
    + -fno-diagnostics-color '-fmessage-length=*'
    -fno-ident -fpermissive -frecord-gcc-switches
    '-fdiagnostics*' '-fplugin*'
    '-W*' -w
    --
    2.34.1

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Sam James@21:1/5 to All on Tue Jan 18 19:30:04 2022
    In Clang, -frecord-gcc-switches does the same as this anyway.

    Signed-off-by: Sam James <sam@gentoo.org>
    ---
    eclass/flag-o-matic.eclass | 1 +
    1 file changed, 1 insertion(+)

    diff --git a/eclass/flag-o-matic.eclass b/eclass/flag-o-matic.eclass
    index 062bd04e2e0bd..50caa401bacfb 100644
    --- a/eclass/flag-o-matic.eclass
    +++ b/eclass/flag-o-matic.eclass
    @@ -80,6 +80,7 @@ _setup-allowed-flags() {
    # Cosmetic/output related, see e.g. bug #830534
    -fno-diagnostics-color '-fmessage-length=*'
    -fno-ident -fpermissive -frecord-gcc-switches
    + -frecord-command-line
    '-fdiagnostics*' '-fplugin*'
    '-W*' -w

    --
    2.34.1

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Sam James@21:1/5 to All on Tue Jan 18 19:30:04 2022
    We already allow -ggdb for GDB and this is the analogue for LLDB.

    Bug: https://bugs.gentoo.org/800533
    Reported-by: Jannik Glückert <jannik.glueckert@gmail.com>
    Signed-off-by: Sam James <sam@gentoo.org>
    ---
    eclass/flag-o-matic.eclass | 1 +
    1 file changed, 1 insertion(+)

    diff --git a/eclass/flag-o-matic.eclass b/eclass/flag-o-matic.eclass
    index d6590a2e52dfd..a2e37b89b6f08 100644
    --- a/eclass/flag-o-matic.eclass
    +++ b/eclass/flag-o-matic.eclass
    @@ -73,6 +73,7 @@ _setup-allowed-flags() {
    -gdwarf '-gdwarf-*'
    -gstabs -gstabs+
    -gz
    + -glldb

    # Cosmetic/output related, see e.g. bug #830534
    -fno-diagnostics-color '-fmessage-length=*'
    --
    2.34.1

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)