From nobody Mon Aug 01 09:00:31 2022 X-Original-To: dev-commits-ports-main@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 4LxBsq34sBz4Y2j7; Mon, 1 Aug 2022 09:00:31 +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 4LxBsq2ZHvz3YVZ; Mon, 1 Aug 2022 09:00:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1659344431; 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=x1YaCwvczOkSOr6xnqcgOtFTEyr+83DyO8tS3ILkBoE=; b=Gi1MEKdjlRWRgmyKjMtwilHvpTxCK+VmU6dJ89Uz6mgjEZCvASkHqosIDs3Zr+u05SoTzo QC12T6Su3go8lWVMDVb1g/z/4DY3uUePPTEt/vslCRy+VETz0qSm5Hsi3WdVCq8cIYN3cv Q7cOPib1hgI0qtGA4AffttcmVoSO2G5LsmcsuxAmSe5FeTq1Mj0Z1A0x1YKr1AM1jgkPWF Tf8r/BEvdSq37sc05LAe7nptGe2WB1ik1/TOIfOkBh9BAYdnt92Fawx9zZPOEzODWPfdsp LZjIPiWhJARfYrvDYTPOof6UEnx5ld05V8cc81tY10ZhkityRMtUxCvseHiamg== 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 4LxBsq1f8SzRn8; Mon, 1 Aug 2022 09:00:31 +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 27190Vfd000782; Mon, 1 Aug 2022 09:00:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 27190V88000781; Mon, 1 Aug 2022 09:00:31 GMT (envelope-from git) Date: Mon, 1 Aug 2022 09:00:31 GMT Message-Id: <202208010900.27190V88000781@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: 18b528bd087d - main - devel/electron17: fix build on armv7 List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@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: 18b528bd087d9158212e0854bb14403d005dd4a2 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1659344431; 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=x1YaCwvczOkSOr6xnqcgOtFTEyr+83DyO8tS3ILkBoE=; b=iIdm0v1rKV9rQmijcmSzkRl2gN9altdVFNcTlfLwDya0xcSGNXaGUcjfDJ/wDHT0kh0e4j NA7ulc5nfNNY34D9MGXvCKHi6C7YjYS0ufYRjm3w9U9p6B6FcnfGpjuul4gA/wSmvv2CIT PpUHHPgKeR0qY5Wx+22bdwhMqbCbkwAYUM8MTremKqrQ1C71D3j2GAlFoJEk9Op+XYRBRb Xz03kQ5bOgrQFblwW871ZDSPyMwDghTZbUxOoJvdWOD+6swOKEYJkAMwv1PbFdri4JNrE7 rGG76C6Z9/rQ0bK1zXYuX0+WOWk+8nzTknoRD6xvyFLyUvX4PhzFFuatl3WJtw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1659344431; a=rsa-sha256; cv=none; b=WCswc3/MoAnJOOqutZBDHrp2xPVrysslYQffkIs6JMIcVWpV3xO6Ro2DRBf5M3bPhZOBkF ZLd+m8SDxRZ3jn/pM0vd/MqKUw+n/uaexYcoInjPh1m9KFxNQ4d73yIbQzABCE6Ss9Y51U svTe2JrKlPBFphkDym74SIovSRODgqO/DSJVE31nSNbDpH8KWxwa10DKU9lEAkE7yT5LBd NdYrZOY5/dQd13Z8tcD2nMzDfj5xUJivvUIGiSMCYWXXDebBmQ1g524FxNfW7cDLtE3G5i OAkJd6Ue/3mqor4Ja/paCEoZljnT6WBBNGt5cxBzQZtfnel3VkaIMPh/yIF5FQ== 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=18b528bd087d9158212e0854bb14403d005dd4a2 commit 18b528bd087d9158212e0854bb14403d005dd4a2 Author: Robert Clausecker AuthorDate: 2022-08-01 08:58:46 +0000 Commit: Hiroki Tagato CommitDate: 2022-08-01 09:00:12 +0000 devel/electron17: 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 | 10 +++- ...d__party_boringssl_src_crypto_cpu-arm-freebsd.c | 55 ++++++++++++++++++++++ .../patch-third__party_skia_src_core_SkCpu.cpp | 23 +++++++++ .../patch-v8_src_base_platform_platform-freebsd.cc | 2 +- .../files/patch-v8_src_codegen_arm_cpu-arm.cc | 18 +++++++ 5 files changed, 106 insertions(+), 2 deletions(-) diff --git a/devel/electron17/files/patch-third__party_boringssl_BUILD.generated.gni b/devel/electron17/files/patch-third__party_boringssl_BUILD.generated.gni index fa27e0bb40ff..19b8b96f4f61 100644 --- a/devel/electron17/files/patch-third__party_boringssl_BUILD.generated.gni +++ b/devel/electron17/files/patch-third__party_boringssl_BUILD.generated.gni @@ -1,6 +1,14 @@ --- third_party/boringssl/BUILD.generated.gni.orig 2022-05-11 07:17:05 UTC +++ third_party/boringssl/BUILD.generated.gni -@@ -183,6 +183,7 @@ crypto_sources = [ +@@ -81,6 +81,7 @@ crypto_sources = [ + "src/crypto/cpu-aarch64-fuchsia.c", + "src/crypto/cpu-aarch64-linux.c", + "src/crypto/cpu-aarch64-win.c", ++ "src/crypto/cpu-arm-freebsd.c", + "src/crypto/cpu-arm-linux.c", + "src/crypto/cpu-arm-linux.h", + "src/crypto/cpu-arm.c", +@@ -183,6 +184,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/electron17/files/patch-third__party_boringssl_src_crypto_cpu-arm-freebsd.c b/devel/electron17/files/patch-third__party_boringssl_src_crypto_cpu-arm-freebsd.c new file mode 100644 index 000000000000..c2599cf6f5e9 --- /dev/null +++ b/devel/electron17/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-31 03:32:48 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/electron17/files/patch-third__party_skia_src_core_SkCpu.cpp b/devel/electron17/files/patch-third__party_skia_src_core_SkCpu.cpp index cff64790931c..b509ae41afeb 100644 --- a/devel/electron17/files/patch-third__party_skia_src_core_SkCpu.cpp +++ b/devel/electron17/files/patch-third__party_skia_src_core_SkCpu.cpp @@ -24,3 +24,26 @@ #elif defined(SK_CPU_ARM64) && __has_include() #include +@@ -115,6 +132,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/electron17/files/patch-v8_src_base_platform_platform-freebsd.cc b/devel/electron17/files/patch-v8_src_base_platform_platform-freebsd.cc index 43a6fe33253a..8785e355c9d8 100644 --- a/devel/electron17/files/patch-v8_src_base_platform_platform-freebsd.cc +++ b/devel/electron17/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/electron17/files/patch-v8_src_codegen_arm_cpu-arm.cc b/devel/electron17/files/patch-v8_src_codegen_arm_cpu-arm.cc new file mode 100644 index 000000000000..b80cc065e78c --- /dev/null +++ b/devel/electron17/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