Restrict libyuv_use_sme to is_linux

When libyuv is used in Chrome, there are linker errors or other build
errors on the following platforms:
- Android: undefined symbol: __getauxval
- Fuchsia: undefined symbol: __aarch64_sme_accessible
- macOS: undefined symbol: __arm_tpidr2_save
- Windows: Incorrect size for TransposeWxH_SME prologue: 52 bytes of
  instructions in range, but .seh directives corresponding to 40 bytes

Restrict libyuv_use_sme to is_linux (which excludes Android and
ChromeOS) to work around these errors.

Bug: libyuv:359006069
Change-Id: Ia3ffd6e4ce4859ae7f811836cb1d8d61f6943b6f
Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/5779858
Reviewed-by: Frank Barchard <fbarchard@chromium.org>
This commit is contained in:
Wan-Teh Chang 2024-08-11 13:14:18 -07:00 committed by Frank Barchard
parent 1fad3ab1fa
commit 5045476744

View File

@ -19,7 +19,12 @@ declare_args() {
current_cpu == "arm64" || current_cpu == "arm64" ||
(current_cpu == "arm" && (arm_use_neon || arm_optionally_use_neon)) (current_cpu == "arm" && (arm_use_neon || arm_optionally_use_neon))
libyuv_use_sve = current_cpu == "arm64" libyuv_use_sve = current_cpu == "arm64"
libyuv_use_sme = current_cpu == "arm64"
# Restrict to is_linux to work around undefined symbol linker errors on
# Android, Fuchsia, macOS, and compilation errors on Windows.
# TODO: bug 359006069 - Remove the is_linux restriction after the linker and
# compilation errors are fixed.
libyuv_use_sme = current_cpu == "arm64" && is_linux
libyuv_use_msa = libyuv_use_msa =
(current_cpu == "mips64el" || current_cpu == "mipsel") && mips_use_msa (current_cpu == "mips64el" || current_cpu == "mipsel") && mips_use_msa
libyuv_use_mmi = libyuv_use_mmi =