skia: enable LASX explicitly to LASX binary compatible objects

Fix skia build on LA64 for the second time (:

Enable LASX intrinsics explicitly when building with LASX binary
compatibility.

In function ‘__lasx_xvsub_h’,
inlined from ‘S32_alpha_D32_filter_DX’ at .../workdir/UnpackedTarball/skia/src/opts/SkBitmapProcState_opts.h:323:43:
/usr/lib/gcc/loongarch64-aosc-linux-gnu/14.2.0/include/lasxintrin.h:539:42: error: built-in function ‘__builtin_lasx_xvsub_h’ is not enabled
539 | return (__m256i)__builtin_lasx_xvsub_h ((v16i16)_1, (v16i16)_2);

cf. https://buildit.aosc.io/logs/62784-libreoffice-25.2.0.3-loongarch64-loong13-2025-02-07-22:04:10.txt

Link: https://skia-review.googlesource.com/c/skia/+/873776
Fixes: I232b4656a87a4c3d87d669769c6483e01425c0e6
Tested-by: Bingwu Zhang <xtex@aosc.io>
Change-Id: I9fbf0f24f28f71a76c10ee31e9a9da00ff350481
Signed-off-by: Bingwu Zhang <xtex@aosc.io>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181256
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Bingwu Zhang
2025-03-01 12:29:54 +01:00
committed by Noel Grandin
parent ec5cd2a82d
commit be1b310125
3 changed files with 31 additions and 1 deletions
+1
View File
@@ -100,6 +100,7 @@ export CPPU_ENV_FOR_BUILD=@CPPU_ENV_FOR_BUILD@
export CPPUNIT_CFLAGS=$(gb_SPACE)@CPPUNIT_CFLAGS@
export CPPUNIT_LIBS=$(gb_SPACE)@CPPUNIT_LIBS@
export CPUNAME=@CPUNAME@
ENABLE_LASX=@ENABLE_LASX@
export CROSS_COMPILING=@CROSS_COMPILING@
export CURL=@CURL@
export CURL_CFLAGS=$(gb_SPACE)@CURL_CFLAGS@
+16
View File
@@ -5703,6 +5703,22 @@ emscripten*)
;;
esac
dnl ===================================================================
dnl Target-specific options
dnl ===================================================================
ENABLE_LASX="TRUE"
if test "$CPUNAME" == LOONGARCH64; then
AC_ARG_ENABLE(lasx,
AS_HELP_STRING([--enable-lasx],
[build with LASX vectorization])
)
if test "$enable_lasx" != yes; then
ENABLE_LASX=""
fi
fi
AC_SUBST(ENABLE_LASX)
dnl ===================================================================
dnl .NET support
dnl ===================================================================
+14 -1
View File
@@ -1315,8 +1315,21 @@ $(eval $(call gb_Library_add_generated_exception_objects,skia,\
UnpackedTarball/skia/src/core/SkSwizzler_opts_lasx \
UnpackedTarball/skia/src/core/SkBlitRow_opts_lasx \
UnpackedTarball/skia/src/core/SkBitmapProcState_opts_lasx, \
$(LO_SKIA_AVOID_INLINE_COPIES) \
$(LO_SKIA_AVOID_INLINE_COPIES) -mlasx \
))
# Always allow LASX builtin functions duraing linking
# because the above SkOpts_lasx, etc, LASX binary compatibility
# object requires LASX intrinsics to be available
$(eval $(call gb_Library_add_ldflags,skia,\
-mlasx \
))
# Apply --enable-lasx to compiling
ifeq ($(ENABLE_LASX),TRUE)
$(eval $(call gb_Library_add_cxxflags,skia, \
-mlasx \
))
endif
endif
# Skcms code is used by png writer, which is used by SkiaHelper::dump(). Building