pdfium: fix build on windows aarch64 - no __popcnt

see https://docs.microsoft.com/en-us/cpp/intrinsics/arm64-intrinsics

Change-Id: I291f727c1aa6e00d02d2339fcb338159ae49d0c5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137568
Tested-by: Jenkins
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
This commit is contained in:
Christian Lohmaier 2022-07-28 15:44:27 +02:00
parent eaa0954fbf
commit 67ed7f8e2d
2 changed files with 14 additions and 0 deletions

View file

@ -14,6 +14,8 @@ pdfium_patches += build.patch.1
# Avoids Windows 8 build dependency.
pdfium_patches += windows7.patch.1
pdfium_patches += c++20-comparison.patch
# __popcnt not available on arm64
pdfium_patches += pdfium_arm64.patch.1
# Use CoreGraphics.h instead of Carbon.h
pdfium_patches += cg-instead-of-carbon.patch.1
# Android NDK 19 - that is known to work well - does not have 2 defines

12
external/pdfium/pdfium_arm64.patch.1 vendored Normal file
View file

@ -0,0 +1,12 @@
diff -ur pdfium.org/third_party/libopenjpeg/ht_dec.c pdfium/third_party/libopenjpeg/ht_dec.c
--- pdfium.org/third_party/libopenjpeg/ht_dec.c 2022-07-28 15:19:17.366247900 +0200
+++ pdfium/third_party/libopenjpeg/ht_dec.c 2022-07-28 15:23:25.641843900 +0200
@@ -69,7 +69,7 @@
static INLINE
OPJ_UINT32 population_count(OPJ_UINT32 val)
{
-#ifdef OPJ_COMPILER_MSVC
+#if defined(OPJ_COMPILER_MSVC) && !defined(_ARM64_)
return (OPJ_UINT32)__popcnt(val);
#elif (defined OPJ_COMPILER_GNUC)
return (OPJ_UINT32)__builtin_popcount(val);