1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-02 01:20:54 +00:00

editors/libreoffice: fix build on aarch64

workdir/UnpackedTarball/skia/src/core/SkCpu.cpp:83:27: error: use of undeclared identifier 'getauxval'

Reported by:	linimon
Approved by:	portmgr (tier-2 blanket)
This commit is contained in:
Mikael Urankar 2020-11-11 13:24:31 +00:00
parent 2f502ffa51
commit dce2e8a539
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=554892
2 changed files with 47 additions and 0 deletions

View File

@ -0,0 +1,12 @@
--- external/skia/UnpackedTarball_skia.mk.orig 2020-11-11 11:32:22 UTC
+++ external/skia/UnpackedTarball_skia.mk
@@ -38,7 +38,8 @@ skia_patches := \
windows-typeface-directwrite.patch.0 \
windows-raster-surface-no-copies.patch.1 \
fix-windows-dwrite.patch.1 \
- public-make-from-backend-texture.patch.1 \
+ public-make-from-backend-texture.patch.1 \
+ gfx-skia-skia-src-core-SkCpu.cpp.patch.0 \
$(eval $(call gb_UnpackedTarball_set_patchlevel,skia,1))

View File

@ -0,0 +1,35 @@
--- external/skia/gfx-skia-skia-src-core-SkCpu.cpp.patch.0.orig 2020-11-11 11:31:37 UTC
+++ external/skia/gfx-skia-skia-src-core-SkCpu.cpp.patch.0
@@ -0,0 +1,32 @@
+Regressed by https://svnweb.freebsd.org/changeset/base/324815
+
+gfx/skia/skia/src/core/SkCpu.cpp:81:27: error: use of undeclared identifier 'getauxval'
+ uint32_t hwcaps = getauxval(AT_HWCAP);
+ ^
+
+--- src/core/SkCpu.cpp.orig 2020-02-07 22:13:22 UTC
++++ src/core/SkCpu.cpp
+@@ -72,6 +72,23 @@
+ return features;
+ }
+
++#elif defined(SK_CPU_ARM64) && defined(__FreeBSD__)
++ #include <machine/armreg.h>
++ #ifndef ID_AA64ISAR0_CRC32_VAL
++ #define ID_AA64ISAR0_CRC32_VAL ID_AA64ISAR0_CRC32
++ #endif
++
++ static uint32_t read_cpu_features() {
++ uint32_t features = 0;
++ uint64_t id_aa64isar0;
++
++ id_aa64isar0 = READ_SPECIALREG(id_aa64isar0_el1);
++ if (ID_AA64ISAR0_CRC32_VAL(id_aa64isar0) == ID_AA64ISAR0_CRC32_BASE) {
++ features |= SkCpu::CRC32;
++ }
++ return features;
++ }
++
+ #elif defined(SK_CPU_ARM64) && __has_include(<sys/auxv.h>)
+ #include <sys/auxv.h>
+