From nobody Sat Jul 30 02:07:21 2022 X-Original-To: dev-commits-ports-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Lvnp150J7z4XlHj; Sat, 30 Jul 2022 02:07:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Lvnp14NmVz3sFY; Sat, 30 Jul 2022 02:07:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1659146841; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=X+X6Qr8HHnnvR0VANPM7YAK2TPy7hD/HD2o5WcHeE8c=; b=qwNCCEgl0wqzhGXAD4f58gfnP2C9mniSEF6S1HA9noBfUyCDUjM6CRzqYY4jecUCh5gTf6 9y+rHRhzZL3IV03UGn8dKvqXyrL4DPWg27Rh4gDmhK6Div4t/jqrCxXvp8AAAWXnzwSLuk UUBwsL1RuTlZD0HLY/ydPAyYjIATYmCqOzXZ4gcIehCtJrW8HcvMaYA4GYl2s6gSfejqFa HmqYSqkfeMpwdzOr7bjqnX/SaZTbRi0wB7Qi8HUfdXqXgiNUiy2aVqD1qwIQTaGXJKda/6 ootdPrgUAgsVL+ju05J8MzW0I7JvTzLZzj6uT5Hs3kJK+oUUSMuMviDIDgqitQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Lvnp13Q7Rzxnl; Sat, 30 Jul 2022 02:07:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 26U27LN4022863; Sat, 30 Jul 2022 02:07:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 26U27LSK022862; Sat, 30 Jul 2022 02:07:21 GMT (envelope-from git) Date: Sat, 30 Jul 2022 02:07:21 GMT Message-Id: <202207300207.26U27LSK022862@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Hiroki Tagato Subject: git: 4538dfed8f4a - main - devel/electron19: fix build on armv7 List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tagattie X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4538dfed8f4afa89fa8f6ecef453591f9cd0cc50 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1659146841; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=X+X6Qr8HHnnvR0VANPM7YAK2TPy7hD/HD2o5WcHeE8c=; b=L4AIwV/HxE1s/bX6MPMP+VvAATgXBOJrb7ur55g0SxhwxplNAJSojlWGTLUN3jxITJm+0h ovFCZiQ7lKRExXUA0SlGEXYaLy3uuwosIQp05HEAHBRH18hxLVZ28mBRpj2nHu5tFXF9Bu HTKWLPlqgaTFFbzDhxb0kS3sDgO8nSjjHe0UwnEbs/xyiCYuw19ndMzQGN0EnaeoeyQa60 OUknp7fUFW5hLaR7MFJh/85smWU2+Ub8ZvEFBdN0UuUg++Jtd+k8ykwYTze3pOISsHQNfc pNQmqn+xeYvgSluut4EC0vJ/nY4Ljl1gUlPxxRjn6HuwX8X8oR4Fj4iHmiZBrA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1659146841; a=rsa-sha256; cv=none; b=hKcMIvoMusge0IdGGOz8cIXjlcYD10fmhrKVJRqI5V0iKdRW32dkqebQCXq6vz3eP7Vq5I TJrDGuIZaZm0flNufEem57oXfU9wB8UthDcrS4A42Qn0HqMo3yBwCpGbFiwgYtLD6gkmBP Pm38MhrAk5whZxtciVUp5FZbXnCEWbxam0sy5cU3kqXuiyayNGdu/Zv29UFh6dw25yHz3F vy25wUXmZtaxshFHd3cNgkFAXyVoEm7ec7vpWz/y+iIqXYaj5GucrD9DxIIfjJkl1QmMz0 q+hGVSL9pB7H2+RuMFevW/WkNFxjX6CxmHC2/KRcQe4+W/x/LO0gUWRridQeGg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by tagattie: URL: https://cgit.FreeBSD.org/ports/commit/?id=4538dfed8f4afa89fa8f6ecef453591f9cd0cc50 commit 4538dfed8f4afa89fa8f6ecef453591f9cd0cc50 Author: Robert Clausecker AuthorDate: 2022-07-30 02:04:57 +0000 Commit: Hiroki Tagato 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 --- ...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 ++#include ++ ++#include ++#include ++ ++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() #include +@@ -115,6 +151,22 @@ + return features; + } + ++#elif defined(SK_CPU_ARM32) && defined(__FreeBSD__) ++ #include ++ ++ 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() && \ + (!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(map->kve_start), + static_cast(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 // for cache flushing. + #undef MAP_TYPE + #elif V8_OS_FREEBSD ++#include + #include // for cache flushing + #include + #elif V8_OS_STARBOARD