Skip to content

Commit

Permalink
devel/electron17: fix build on arm64
Browse files Browse the repository at this point in the history
  • Loading branch information
tagattie committed Jun 27, 2022
1 parent bd3644f commit d52b25c
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions devel/electron17/files/patch-third__party_skia_src_core_SkCpu.cpp
@@ -0,0 +1,26 @@
--- third_party/skia/src/core/SkCpu.cpp.orig 2022-05-11 07:06:58 UTC
+++ third_party/skia/src/core/SkCpu.cpp
@@ -73,6 +73,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>

0 comments on commit d52b25c

Please sign in to comment.