commit:     2baeb8c8987f9214080ce2a8c94c0e93ee7af217
Author:     Luca Barbato <lu_zero <AT> gentoo <DOT> org>
AuthorDate: Fri Jul  5 09:31:57 2024 +0000
Commit:     Luca Barbato <lu_zero <AT> gentoo <DOT> org>
CommitDate: Fri Jul  5 20:49:09 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2baeb8c8

flag-o-matic.eclass: allow -mstrict-align and -mvector-strict-align

It is needed to make sure vector unaligned load/store aren't inserted
when the riscv cpu does not allow them.

See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115789

Signed-off-by: Luca Barbato <lu_zero <AT> gentoo.org>

 eclass/flag-o-matic.eclass | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/eclass/flag-o-matic.eclass b/eclass/flag-o-matic.eclass
index ecac452aa0ef..c6b1ad80e12e 100644
--- a/eclass/flag-o-matic.eclass
+++ b/eclass/flag-o-matic.eclass
@@ -129,6 +129,10 @@ _setup-allowed-flags() {
                # needed for arm64 (and in particular SCS)
                -ffixed-x18
 
+               # needed for riscv (to prevent unaligned vector access)
+               # See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115789
+               -mstrict-align -mvector-strict-align
+
                # gcc 4.5
                -mno-fma4 -mno-movbe -mno-xop -mno-lwp
                # gcc 4.6

Reply via email to