From 5045476744fea049f9029ff50df6345240981f54 Mon Sep 17 00:00:00 2001 From: Wan-Teh Chang Date: Sun, 11 Aug 2024 13:14:18 -0700 Subject: [PATCH] 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 --- libyuv.gni | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libyuv.gni b/libyuv.gni index b83f96d21..07182d14b 100644 --- a/libyuv.gni +++ b/libyuv.gni @@ -19,7 +19,12 @@ declare_args() { current_cpu == "arm64" || (current_cpu == "arm" && (arm_use_neon || arm_optionally_use_neon)) 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 = (current_cpu == "mips64el" || current_cpu == "mipsel") && mips_use_msa libyuv_use_mmi =