commit:     83e5cbb7ba3a7d3973cca29465fac8b777f96cc3
Author:     Eli Schwartz <eschwartz93 <AT> gmail <DOT> com>
AuthorDate: Mon Mar  4 03:31:51 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Mar  4 04:14:11 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=83e5cbb7

sci-mathematics/z3: mark as LTO-unsafe, strict-aliasing unsafe

The strict-aliasing violation happens only in a test program. However,
that does mean we cannot test that z3 works when built with LTO...

Closes: https://bugs.gentoo.org/879327
Signed-off-by: Eli Schwartz <eschwartz93 <AT> gmail.com>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 sci-mathematics/z3/z3-4.12.5.ebuild | 14 +++++++++++++-
 sci-mathematics/z3/z3-4.12.6.ebuild | 14 +++++++++++++-
 2 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/sci-mathematics/z3/z3-4.12.5.ebuild 
b/sci-mathematics/z3/z3-4.12.5.ebuild
index 646bf2695514..64ffaff192f5 100644
--- a/sci-mathematics/z3/z3-4.12.5.ebuild
+++ b/sci-mathematics/z3/z3-4.12.5.ebuild
@@ -5,7 +5,7 @@ EAPI=8
 
 PYTHON_COMPAT=( python3_{10..12} )
 
-inherit cmake-multilib java-pkg-opt-2 python-single-r1
+inherit cmake-multilib flag-o-matic java-pkg-opt-2 python-single-r1
 
 DESCRIPTION="An efficient theorem prover"
 HOMEPAGE="https://github.com/Z3Prover/z3/";
@@ -37,6 +37,18 @@ src_prepare() {
        java-pkg-opt-2_src_prepare
 }
 
+src_configure() {
+       # -Werror=strict-aliasing
+       # https://bugs.gentoo.org/879327
+       # https://github.com/Z3Prover/z3/issues/7143
+       #
+       # Do not trust it with LTO either.
+       append-flags -fno-strict-aliasing
+       filter-lto
+
+       cmake-multilib_src_configure
+}
+
 multilib_src_configure() {
        local mycmakeargs=(
                -DCMAKE_INSTALL_DOCDIR="${EPREFIX}/usr/share/doc/${PF}"

diff --git a/sci-mathematics/z3/z3-4.12.6.ebuild 
b/sci-mathematics/z3/z3-4.12.6.ebuild
index 951e88b0875b..f7df502b3d41 100644
--- a/sci-mathematics/z3/z3-4.12.6.ebuild
+++ b/sci-mathematics/z3/z3-4.12.6.ebuild
@@ -5,7 +5,7 @@ EAPI=8
 
 PYTHON_COMPAT=( python3_{10..12} )
 
-inherit cmake-multilib java-pkg-opt-2 python-single-r1
+inherit cmake-multilib flag-o-matic java-pkg-opt-2 python-single-r1
 
 DESCRIPTION="An efficient theorem prover"
 HOMEPAGE="https://github.com/Z3Prover/z3/";
@@ -37,6 +37,18 @@ src_prepare() {
        java-pkg-opt-2_src_prepare
 }
 
+src_configure() {
+       # -Werror=strict-aliasing
+       # https://bugs.gentoo.org/879327
+       # https://github.com/Z3Prover/z3/issues/7143
+       #
+       # Do not trust it with LTO either.
+       append-flags -fno-strict-aliasing
+       filter-lto
+
+       cmake-multilib_src_configure
+}
+
 multilib_src_configure() {
        local mycmakeargs=(
                -DCMAKE_INSTALL_DOCDIR="${EPREFIX}/usr/share/doc/${PF}"

Reply via email to