commit:     1f96696e0926a6e2ff71c7455755e6a5563f0570
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Thu Mar 17 02:07:19 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Mar 17 02:08:39 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1f96696e

media-libs/libaom: workaround bugs in intrinsic-enabled/disabled builds

- For 32-bit multilib builds on amd64, force on SSE3 & SSSE3. It seems
  to check at runtime anyway (for some targets, inc. this one).

- For arm32-on-arm64 builds, go generic, because it gets confused by ARM64
  when NEON is disabled (I think?). Could try forcing arm at some point.

Closes: https://bugs.gentoo.org/816027
Closes: https://bugs.gentoo.org/835456
Signed-off-by: Sam James <sam <AT> gentoo.org>

 media-libs/libaom/libaom-3.3.0.ebuild | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/media-libs/libaom/libaom-3.3.0.ebuild 
b/media-libs/libaom/libaom-3.3.0.ebuild
index 4629f7dd2077..8f587c6b1c32 100644
--- a/media-libs/libaom/libaom-3.3.0.ebuild
+++ b/media-libs/libaom/libaom-3.3.0.ebuild
@@ -66,6 +66,26 @@ multilib_src_configure() {
                -DENABLE_AVX2=$(usex cpu_flags_x86_avx2 ON OFF)
        )
 
+       # For 32-bit multilib builds, force some intrinsics on to work around
+       # bug #816027. libaom seems to do runtime detection for some targets
+       # at least, so this isn't an issue.
+       if ! multilib_is_native_abi && use amd64 ; then
+               mycmakeargs+=(
+                       -DENABLE_SSE3=ON
+                       -DENABLE_SSSE3=ON
+               )
+       fi
+
+       # On ARM32-on-ARM64, things end up failing if NEON is off, bug #835456
+       # Just force generic, given it's a niche situation.
+       # TODO: could try forcing armv7 or similar?
+       if use arm && ! use cpu_flags_arm_neon && [[ $(uname -p) == "aarch64" 
]] ; then
+               ewarn "Forcing generic for arm32-on-arm64 build (bug #835456)"
+               mycmakeargs+=(
+                       -DAOM_TARGET_CPU=generic
+               )
+       fi
+
        cmake_src_configure
 }
 

Reply via email to