commit:     0757e1e630fba6b5f064002bdc18e173d47fdc5f
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 26 09:58:42 2023 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Mon Jun 26 10:10:10 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0757e1e6

dev-util/mingw64-toolchain: pass -mno-avx for mingw cross

AVX issues with mingw-gcc aren't exactly new, e.g.
https://bugs.winehq.org/show_bug.cgi?id=45289
Been known to cause issues with dxvk too, albeit unsure
if that's still relevant as issues are scattered/lost.

Newly, >=wine-8.10 is likely to crash doing anything
at all 32bit if used -march=native (w/ avx) and 32bit
(e.g. `WINEARCH=win32 winecfg`).

Adding this to every packages using mingw as a precaution,
not believed there is much to gain from keeping AVX given
the fragility here. May revisit eventually with a newer GCC.

Not known to have caused issues with this package in particular
(unlike wine/dxvk), so skipping a slow rebuild revbump.

Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p1-r2.ebuild | 7 +++++++
 dev-util/mingw64-toolchain/mingw64-toolchain-11.0.0.ebuild       | 7 +++++++
 2 files changed, 14 insertions(+)

diff --git a/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p1-r2.ebuild 
b/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p1-r2.ebuild
index 82af5181e021..cb802c55f8b1 100644
--- a/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p1-r2.ebuild
+++ b/dev-util/mingw64-toolchain/mingw64-toolchain-10.0.0_p1-r2.ebuild
@@ -193,6 +193,13 @@ src_compile() {
                                filter-flags '-fstack-protector*' #870136
                                filter-flags '-fuse-ld=*'
                                filter-flags '-mfunction-return=thunk*' #878849
+
+                               # -mavx with mingw-gcc has a history of obscure 
issues and
+                               # disabling is seen as safer, e.g. 
`WINEARCH=win32 winecfg`
+                               # crashes with -march=skylake >=wine-8.10, 
similar issues with
+                               # znver4: 
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110273
+                               append-flags -mno-avx
+
                                strip-unsupported-flags
                                mwt-build "${@:2}"
                        )

diff --git a/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.0.ebuild 
b/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.0.ebuild
index d4fe6b516d10..803cd398d9be 100644
--- a/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.0.ebuild
+++ b/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.0.ebuild
@@ -201,6 +201,13 @@ src_compile() {
                                CHOST=${CTARGET}
                                filter-flags '-fuse-ld=*'
                                filter-flags '-mfunction-return=thunk*' #878849
+
+                               # -mavx with mingw-gcc has a history of obscure 
issues and
+                               # disabling is seen as safer, e.g. 
`WINEARCH=win32 winecfg`
+                               # crashes with -march=skylake >=wine-8.10, 
similar issues with
+                               # znver4: 
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110273
+                               append-flags -mno-avx
+
                                strip-unsupported-flags
                                mwt-build "${@:2}"
                        )

Reply via email to