aboutsummaryrefslogtreecommitdiff
path: root/www/chromium
diff options
context:
space:
mode:
authorMikael Urankar <mikael@FreeBSD.org>2020-06-10 18:23:24 +0000
committerMikael Urankar <mikael@FreeBSD.org>2020-06-10 18:23:24 +0000
commita2f5d86423fb3115c4e49ba9d2ddf2111fab0ffa (patch)
tree25edd02c14eb7f9c0db92bcab63a2b3e5d605c84 /www/chromium
parenta3eba1eef4ee7f9a6d8a037b7d01a2114078a586 (diff)
downloadports-a2f5d86423fb3115c4e49ba9d2ddf2111fab0ffa.tar.gz
ports-a2f5d86423fb3115c4e49ba9d2ddf2111fab0ffa.zip
www/chromium: fix build on aarch64
PR: 246982 Approved by: portmgr (tier-2 blanket)
Notes
Notes: svn path=/head/; revision=538423
Diffstat (limited to 'www/chromium')
-rw-r--r--www/chromium/files/patch-third__party_zlib_BUILD.gn20
-rw-r--r--www/chromium/files/patch-third_party_zlib_cpu__features.c55
2 files changed, 75 insertions, 0 deletions
diff --git a/www/chromium/files/patch-third__party_zlib_BUILD.gn b/www/chromium/files/patch-third__party_zlib_BUILD.gn
new file mode 100644
index 000000000000..8613c5f195da
--- /dev/null
+++ b/www/chromium/files/patch-third__party_zlib_BUILD.gn
@@ -0,0 +1,20 @@
+--- third_party/zlib/BUILD.gn.orig 2020-05-18 20:40:28 UTC
++++ third_party/zlib/BUILD.gn
+@@ -82,6 +82,8 @@ if (use_arm_neon_optimizations) {
+ defines = [ "CRC32_ARMV8_CRC32" ]
+ if (is_android) {
+ defines += [ "ARMV8_OS_ANDROID" ]
++ } else if (is_bsd) {
++ defines += [ "ARMV8_OS_FREEBSD" ]
+ } else if (is_linux || is_chromeos) {
+ defines += [ "ARMV8_OS_LINUX" ]
+ } else if (is_fuchsia) {
+@@ -350,7 +352,7 @@ static_library("minizip") {
+ ]
+ }
+
+- if (is_mac || is_ios || is_android || is_nacl) {
++ if (is_mac || is_ios || is_android || is_nacl || is_bsd) {
+ # Mac, Android and the BSDs don't have fopen64, ftello64, or fseeko64. We
+ # use fopen, ftell, and fseek instead on these systems.
+ defines = [ "USE_FILE32API" ]
diff --git a/www/chromium/files/patch-third_party_zlib_cpu__features.c b/www/chromium/files/patch-third_party_zlib_cpu__features.c
new file mode 100644
index 000000000000..0fae5fd16f9f
--- /dev/null
+++ b/www/chromium/files/patch-third_party_zlib_cpu__features.c
@@ -0,0 +1,55 @@
+--- third_party/zlib/cpu_features.c.orig 2020-05-18 20:40:28 UTC
++++ third_party/zlib/cpu_features.c
+@@ -24,11 +24,20 @@ int ZLIB_INTERNAL x86_cpu_enable_simd = 0;
+
+ #ifndef CPU_NO_SIMD
+
+-#if defined(ARMV8_OS_ANDROID) || defined(ARMV8_OS_LINUX) || defined(ARMV8_OS_FUCHSIA)
++#if defined(ARMV8_OS_ANDROID) || defined(ARMV8_OS_LINUX) || defined(ARMV8_OS_FUCHSIA) || defined(ARMV8_OS_FREEBSD)
+ #include <pthread.h>
+ #endif
+
+-#if defined(ARMV8_OS_ANDROID)
++#if defined(ARMV8_OS_FREEBSD)
++#include <machine/armreg.h>
++#include <sys/types.h>
++#ifndef ID_AA64ISAR0_AES_VAL
++#define ID_AA64ISAR0_AES_VAL ID_AA64ISAR0_AES
++#endif
++#ifndef ID_AA64ISAR0_CRC32_VAL
++#define ID_AA64ISAR0_CRC32_VAL ID_AA64ISAR0_CRC32
++#endif
++#elif defined(ARMV8_OS_ANDROID)
+ #include <cpu-features.h>
+ #elif defined(ARMV8_OS_LINUX)
+ #include <asm/hwcap.h>
+@@ -49,7 +58,7 @@ int ZLIB_INTERNAL x86_cpu_enable_simd = 0;
+ static void _cpu_check_features(void);
+ #endif
+
+-#if defined(ARMV8_OS_ANDROID) || defined(ARMV8_OS_LINUX) || defined(ARMV8_OS_FUCHSIA) || defined(X86_NOT_WINDOWS)
++#if defined(ARMV8_OS_ANDROID) || defined(ARMV8_OS_LINUX) || defined(ARMV8_OS_FUCHSIA) || defined(X86_NOT_WINDOWS) || defined(ARMV8_OS_FREEBSD)
+ static pthread_once_t cpu_check_inited_once = PTHREAD_ONCE_INIT;
+ void ZLIB_INTERNAL cpu_check_features(void)
+ {
+@@ -108,6 +117,13 @@ static void _cpu_check_features(void)
+ #elif defined(ARMV8_OS_WINDOWS)
+ arm_cpu_enable_crc32 = IsProcessorFeaturePresent(PF_ARM_V8_CRC32_INSTRUCTIONS_AVAILABLE);
+ arm_cpu_enable_pmull = IsProcessorFeaturePresent(PF_ARM_V8_CRYPTO_INSTRUCTIONS_AVAILABLE);
++#elif defined(ARMV8_OS_FREEBSD)
++ uint64_t id_aa64isar0;
++ id_aa64isar0 = READ_SPECIALREG(id_aa64isar0_el1);
++ if (ID_AA64ISAR0_AES_VAL(id_aa64isar0) == ID_AA64ISAR0_AES_PMULL)
++ arm_cpu_enable_pmull = 1;
++ if (ID_AA64ISAR0_CRC32_VAL(id_aa64isar0) == ID_AA64ISAR0_CRC32_BASE)
++ arm_cpu_enable_crc32 = 1;
+ #endif
+ }
+ #endif
+@@ -145,4 +161,4 @@ static void _cpu_check_features(void)
+ }
+ #endif
+ #endif
+-#endif
+\ No newline at end of file
++#endif