Date: Sat, 30 Jul 2022 02:07:21 GMT From: Hiroki Tagato <tagattie@FreeBSD.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org Subject: git: 4538dfed8f4a - main - devel/electron19: fix build on armv7 Message-ID: <202207300207.26U27LSK022862@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by tagattie: URL: https://cgit.FreeBSD.org/ports/commit/?id=4538dfed8f4afa89fa8f6ecef453591f9cd0cc50 commit 4538dfed8f4afa89fa8f6ecef453591f9cd0cc50 Author: Robert Clausecker <fuz@fuz.su> AuthorDate: 2022-07-30 02:04:57 +0000 Commit: Hiroki Tagato <tagattie@FreeBSD.org> CommitDate: 2022-07-30 02:07:00 +0000 devel/electron19: fix build on armv7 - add some missing bits of armv7 FreeBSD support code for the bundled boringssl - import V8 patch from bug #260651 PR: 265438 Reported by: Robert Clausecker <fuz@fuz.su> --- ...atch-third__party_boringssl_BUILD.generated.gni | 11 +++-- ..._party_boringssl_src_crypto_cpu__arm__freebsd.c | 55 ++++++++++++++++++++++ .../patch-third__party_skia_src_core_SkCpu.cpp | 25 +++++++++- .../patch-v8_src_base_platform_platform-freebsd.cc | 2 +- .../files/patch-v8_src_codegen_arm_cpu-arm.cc | 18 +++++++ 5 files changed, 106 insertions(+), 5 deletions(-) diff --git a/devel/electron19/files/patch-third__party_boringssl_BUILD.generated.gni b/devel/electron19/files/patch-third__party_boringssl_BUILD.generated.gni index c9ac16f9f69a..62a9600e3cf8 100644 --- a/devel/electron19/files/patch-third__party_boringssl_BUILD.generated.gni +++ b/devel/electron19/files/patch-third__party_boringssl_BUILD.generated.gni @@ -1,14 +1,19 @@ ---- third_party/boringssl/BUILD.generated.gni.orig 2022-05-25 04:01:51 UTC +--- third_party/boringssl/BUILD.generated.gni.orig 2022-06-10 05:37:11 UTC +++ third_party/boringssl/BUILD.generated.gni -@@ -81,6 +81,7 @@ crypto_sources = [ +@@ -81,10 +81,12 @@ crypto_sources = [ "src/crypto/cpu_aarch64_apple.c", "src/crypto/cpu_aarch64_fuchsia.c", "src/crypto/cpu_aarch64_linux.c", + "src/crypto/cpu_aarch64_openbsd.c", "src/crypto/cpu_aarch64_win.c", "src/crypto/cpu_arm.c", ++ "src/crypto/cpu_arm_freebsd.c", "src/crypto/cpu_arm_linux.c", -@@ -186,6 +187,7 @@ crypto_sources = [ + "src/crypto/cpu_arm_linux.h", + "src/crypto/cpu_intel.c", + "src/crypto/cpu_ppc64le.c", + "src/crypto/crypto.c", +@@ -186,6 +188,7 @@ crypto_sources = [ "src/crypto/rand_extra/deterministic.c", "src/crypto/rand_extra/forkunsafe.c", "src/crypto/rand_extra/fuchsia.c", diff --git a/devel/electron19/files/patch-third__party_boringssl_src_crypto_cpu__arm__freebsd.c b/devel/electron19/files/patch-third__party_boringssl_src_crypto_cpu__arm__freebsd.c new file mode 100644 index 000000000000..19f3a785fdd8 --- /dev/null +++ b/devel/electron19/files/patch-third__party_boringssl_src_crypto_cpu__arm__freebsd.c @@ -0,0 +1,55 @@ +--- third_party/boringssl/src/crypto/cpu_arm_freebsd.c.orig 2022-07-24 00:49:45 UTC ++++ third_party/boringssl/src/crypto/cpu_arm_freebsd.c +@@ -0,0 +1,52 @@ ++/* Copyright (c) 2016, Google Inc. ++ * ++ * Permission to use, copy, modify, and/or distribute this software for any ++ * purpose with or without fee is hereby granted, provided that the above ++ * copyright notice and this permission notice appear in all copies. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES ++ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF ++ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY ++ * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES ++ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION ++ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN ++ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ ++ ++#include "internal.h" ++ ++#if defined(OPENSSL_ARM) && defined(OPENSSL_FREEBSD) && \ ++ !defined(OPENSSL_STATIC_ARMCAP) ++#include <sys/types.h> ++#include <sys/auxv.h> ++ ++#include <openssl/arm_arch.h> ++#include <openssl/mem.h> ++ ++extern uint32_t OPENSSL_armcap_P; ++ ++void OPENSSL_cpuid_setup(void) { ++ unsigned long hwcap = 0, hwcap2 = 0; ++ ++ elf_aux_info(AT_HWCAP, &hwcap, sizeof hwcap); ++ elf_aux_info(AT_HWCAP2, &hwcap2, sizeof hwcap2); ++ ++ // Matching OpenSSL, only report other features if NEON is present. ++ if (hwcap & HWCAP_NEON) { ++ OPENSSL_armcap_P |= ARMV7_NEON; ++ ++ if (hwcap2 & HWCAP2_AES) { ++ OPENSSL_armcap_P |= ARMV8_AES; ++ } ++ if (hwcap2 & HWCAP2_PMULL) { ++ OPENSSL_armcap_P |= ARMV8_PMULL; ++ } ++ if (hwcap2 & HWCAP2_SHA1) { ++ OPENSSL_armcap_P |= ARMV8_SHA1; ++ } ++ if (hwcap2 & HWCAP2_SHA2) { ++ OPENSSL_armcap_P |= ARMV8_SHA256; ++ } ++ } ++} ++ ++#endif // OPENSSL_ARM && OPENSSL_OPENBSD && !OPENSSL_STATIC_ARMCAP diff --git a/devel/electron19/files/patch-third__party_skia_src_core_SkCpu.cpp b/devel/electron19/files/patch-third__party_skia_src_core_SkCpu.cpp index 81d6e62786b1..5c0ed7c34aec 100644 --- a/devel/electron19/files/patch-third__party_skia_src_core_SkCpu.cpp +++ b/devel/electron19/files/patch-third__party_skia_src_core_SkCpu.cpp @@ -1,4 +1,4 @@ ---- third_party/skia/src/core/SkCpu.cpp.orig 2022-05-25 04:04:36 UTC +--- third_party/skia/src/core/SkCpu.cpp.orig 2022-06-10 05:40:07 UTC +++ third_party/skia/src/core/SkCpu.cpp @@ -73,6 +73,42 @@ return features; @@ -43,3 +43,26 @@ #elif defined(SK_CPU_ARM64) && __has_include(<sys/auxv.h>) #include <sys/auxv.h> +@@ -115,6 +151,22 @@ + return features; + } + ++#elif defined(SK_CPU_ARM32) && defined(__FreeBSD__) ++ #include <sys/auxv.h> ++ ++ static uint32_t read_cpu_features() { ++ unsigned long hwcaps = 0; ++ uint32_t features = 0; ++ ++ elf_aux_info(AT_HWCAP, (void *)&hwcaps, sizeof hwcaps); ++ if (hwcaps & HWCAP_NEON) { ++ features |= SkCpu::NEON; ++ if (hwcaps & HWCAP_VFPv4) { ++ features |= SkCpu::NEON_FMA|SkCpu::VFP_FP16; ++ } ++ } ++ return features; ++ } + #elif defined(SK_CPU_ARM32) && __has_include(<sys/auxv.h>) && \ + (!defined(__ANDROID_API__) || __ANDROID_API__ >= 18) + // sys/auxv.h will always be present in the Android NDK due to unified diff --git a/devel/electron19/files/patch-v8_src_base_platform_platform-freebsd.cc b/devel/electron19/files/patch-v8_src_base_platform_platform-freebsd.cc index 43a6fe33253a..8785e355c9d8 100644 --- a/devel/electron19/files/patch-v8_src_base_platform_platform-freebsd.cc +++ b/devel/electron19/files/patch-v8_src_base_platform_platform-freebsd.cc @@ -20,7 +20,7 @@ lib_name = std::string(path); } result.push_back(SharedLibraryAddress( -+#if defined(__i386__) || defined(OS_FREEBSD) ++#if defined(__i386__) || defined(__arm__) || defined(OS_FREEBSD) + lib_name, static_cast<uintptr_t>(map->kve_start), + static_cast<uintptr_t>(map->kve_end))); +#else diff --git a/devel/electron19/files/patch-v8_src_codegen_arm_cpu-arm.cc b/devel/electron19/files/patch-v8_src_codegen_arm_cpu-arm.cc new file mode 100644 index 000000000000..b80cc065e78c --- /dev/null +++ b/devel/electron19/files/patch-v8_src_codegen_arm_cpu-arm.cc @@ -0,0 +1,18 @@ +--- v8/src/codegen/arm/cpu-arm.cc.orig 2022-07-25 18:25:18 UTC ++++ v8/src/codegen/arm/cpu-arm.cc +@@ -2,12 +2,15 @@ + // Use of this source code is governed by a BSD-style license that can be + // found in the LICENSE file. + ++#include "include/v8config.h" ++ + // CPU specific code for arm independent of OS goes here. + #ifdef __arm__ + #ifdef __QNXNTO__ + #include <sys/mman.h> // for cache flushing. + #undef MAP_TYPE + #elif V8_OS_FREEBSD ++#include <sys/cdefs.h> + #include <machine/sysarch.h> // for cache flushing + #include <sys/types.h> + #elif V8_OS_STARBOARD
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202207300207.26U27LSK022862>