commit:     5037161d1847e7b51fac52e304fb120682455d8b
Author:     Peter Levine <plevine457 <AT> gmail <DOT> com>
AuthorDate: Tue Jun 18 01:38:20 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Jun 18 02:08:52 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5037161d

dev-cpp/gtest: fix test failure on x86

Testing on x86 architecture causes a unittest to fail due to
a floating-point precision discrepancy.  Like Debian, we add
-ffloat-store until upstream addresses the issue.

Closes: https://bugs.gentoo.org/905007
Closes: https://github.com/gentoo/gentoo/pull/37191
Suggested-by: Sam James <sam <AT> gentoo.org>
Signed-off-by: Peter Levine <plevine457 <AT> gmail.com>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-cpp/gtest/gtest-1.14.0-r1.ebuild | 7 ++++++-
 dev-cpp/gtest/gtest-9999.ebuild      | 7 ++++++-
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/dev-cpp/gtest/gtest-1.14.0-r1.ebuild 
b/dev-cpp/gtest/gtest-1.14.0-r1.ebuild
index aed50c96f6e4..ecb89314e216 100644
--- a/dev-cpp/gtest/gtest-1.14.0-r1.ebuild
+++ b/dev-cpp/gtest/gtest-1.14.0-r1.ebuild
@@ -51,7 +51,12 @@ multilib_src_configure() {
                -Dgmock_build_tests=$(usex test)
                -Dgtest_build_tests=$(usex test)
        )
-       use test && mycmakeargs+=( -DPython3_EXECUTABLE="${PYTHON}" )
+       if use test; then
+               if use x86 || use x86-linux; then
+                       append-cxxflags -ffloat-store # bug #905007
+               fi
+               mycmakeargs+=( -DPython3_EXECUTABLE="${PYTHON}" )
+       fi
 
        cmake_src_configure
 }

diff --git a/dev-cpp/gtest/gtest-9999.ebuild b/dev-cpp/gtest/gtest-9999.ebuild
index aed50c96f6e4..ecb89314e216 100644
--- a/dev-cpp/gtest/gtest-9999.ebuild
+++ b/dev-cpp/gtest/gtest-9999.ebuild
@@ -51,7 +51,12 @@ multilib_src_configure() {
                -Dgmock_build_tests=$(usex test)
                -Dgtest_build_tests=$(usex test)
        )
-       use test && mycmakeargs+=( -DPython3_EXECUTABLE="${PYTHON}" )
+       if use test; then
+               if use x86 || use x86-linux; then
+                       append-cxxflags -ffloat-store # bug #905007
+               fi
+               mycmakeargs+=( -DPython3_EXECUTABLE="${PYTHON}" )
+       fi
 
        cmake_src_configure
 }

Reply via email to