flag-o-matic.eclass: whitelist -mstackrealign for 'strip-flags'
authorSergei Trofimovich <slyfox@gentoo.org>
Wed, 13 Feb 2019 21:01:27 +0000 (21:01 +0000)
committerSergei Trofimovich <slyfox@gentoo.org>
Wed, 13 Feb 2019 21:03:30 +0000 (21:03 +0000)
Allow '-mstackrealign' in ebuilds like glibc to force stack realignment.
That will allow running ancient (or foreign) binaries that don't
maintain 16-byte stack alignment. See bug #677852 for example.

Reported-by: Michael Huss
Closes: https://bugs.gentoo.org/677852
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
eclass/flag-o-matic.eclass

index 582339096573936decbfe2e21610f33e0eb76413..933104190ae38bcc9c96041929d96bf07dfb5a9d 100644 (file)
@@ -69,6 +69,13 @@ setup-allowed-flags() {
                # gcc 4.9
                -mno-avx512cd -mno-avx512er -mno-avx512f -mno-avx512pf -mno-sha
        )
+
+       # Allow some safe individual flags. Should come along with the bug reference.
+       ALLOWED_FLAGS+=(
+               # Allow explicit stack realignment to run non-conformant
+               # binaries: bug #677852
+               -mstackrealign
+       )
 }
 
 # inverted filters for hardened compiler.  This is trying to unpick