From nobody Mon Jun 05 16:54:09 2023 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 4QZfpB2Q83z4ZXMQ; Mon, 5 Jun 2023 16:54:10 +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 4QZfpB0xwtz3Jbp; Mon, 5 Jun 2023 16:54:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685984050; 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=J94Q7TwCjIBV2Q9VzQbLjzcW9CcyfI4SDf0WBLLwfBs=; b=OS03PvKRX/E61ngcfZOSi4vAXSGFEpNVIJlaM8xbCyJ70oKP+HBuGgiG67yqjYFmjIdLb4 lVl+40JlNpuSbL3L4FVEuzUZefmG8AqqjxiXpJu1RWnj5pf5rQ1r3FUCuYAQnZ4eKT7oh1 9jGSzg8OMFPr5a19AJ+QeTiSrVR0IbmOsTHDiLcFWmlEfGoovjXOWU1COBGIop0K5LSmb+ vsIE6ECZRFEZs0xHXEjnB/QQ/Jr/eNBWD79VKbkoA21dsi7axBOGefqu1onM5ddS7b/NBw lYIb465BmB5478r6P14joJFy1dyy2SCyB9tRxWmdlfUQxz2a6cOIuxXef3ThZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685984050; 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=J94Q7TwCjIBV2Q9VzQbLjzcW9CcyfI4SDf0WBLLwfBs=; b=hRFrqH9FoXiQOkRJdmIUC0XMflrxA/AeS+ve/zdbmMWp2F142U6A6xCVAwNHSNluP/HN5f +W1qx9YBDw96cjnTlLG3SaCPUtVW9MXzeZXbb6YDZotnp4/AsYudER/XpwVKce1zXVjVkz 2NxIeHxn9QrJe7UtMrLyvIjcDNMxeAqWvMnUsZ4DR1kAfUY0p4GN6KkKkLWKA9l83Zfz/I XEeSdeKfAPFqgtbPYk3kHr0BAIYF3B7WoZfNso6P0Wnk8jGGk2th5cfIW026bnuzC7g/sQ TnTfvMjSwZKVLbLbZgukeYVgplyzGLe5FP7e5S08SoQldZjKxU0jyXz79ZP9Fw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685984050; a=rsa-sha256; cv=none; b=f55rHpB2vjaZZu/GI+X5RHg+viL+WvWzyJM7khwXJs9NtuYK0gOAh0yzaA95Y5UJHP6Oqg DHDzRGgV8/qxHw/ZVUYODFL0+78BrfxAJ1KZjKUNrpvKnEhFnCHQOkLYNzVjmpk3mAGRDs KAvqEVKntn5/A5OlijM9uWQsPOb485UbAQmR72Wj0Rcm7sr8HNygccZoRrrAjr4OI1pIyd ve7csL3J/un4WXSPt/qVC4nc2Vj2LFW/MKH3wJ3XrfjQKlDPHpDVkwZOKb13qgwjUtfqdE 8T/blmq1k2kNKmhNblOwGSr6EgXCL5qCeJkbAk7rCcFwulnlxN3mi7lbcM/7KA== 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 4QZfpB02Wvzw2N; Mon, 5 Jun 2023 16:54:10 +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 355Gs9AK049821; Mon, 5 Jun 2023 16:54:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 355Gs9Wc049820; Mon, 5 Jun 2023 16:54:09 GMT (envelope-from git) Date: Mon, 5 Jun 2023 16:54:09 GMT Message-Id: <202306051654.355Gs9Wc049820@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Robert Clausecker Subject: git: dd2c7b778901 - main - www/qt6-webengine: 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: fuz X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dd2c7b778901a7b310d37f044c0018de1603c37f Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by fuz: URL: https://cgit.FreeBSD.org/ports/commit/?id=dd2c7b778901a7b310d37f044c0018de1603c37f commit dd2c7b778901a7b310d37f044c0018de1603c37f Author: Robert Clausecker AuthorDate: 2023-05-03 14:59:15 +0000 Commit: Robert Clausecker CommitDate: 2023-06-05 16:53:00 +0000 www/qt6-webengine: fix build on armv7 Improve two patches with more complete variants from devel/electron19. Patch bundled boringssl with additional patches from the same port. Avoid an OOM condition by using the same extra patch previously only used on i386. In that patch, decreate BROTLI_PARAM_QUALITY further to 4 to avoid flakiness on armv7. Obtained from: devel/electron19 Approved by: kai (with hat: kde, maintainer) PR: 271228 --- www/qt6-webengine/Makefile | 6 +-- ...iles_js => extra-patch-32bit-compress_files_js} | 2 +- ...mium_third__party_boringssl_BUILD.generated.gni | 9 ++-- ..._party_boringssl_src_crypto_cpu__arm__freebsd.c | 55 ++++++++++++++++++++++ ...y_chromium_third__party_skia_src_core_SkCpu.cpp | 25 +++++++++- ...romium_v8_src_base_platform_platform-freebsd.cc | 2 +- 6 files changed, 90 insertions(+), 9 deletions(-) diff --git a/www/qt6-webengine/Makefile b/www/qt6-webengine/Makefile index 1785daecb9f1..2e4d8f546493 100644 --- a/www/qt6-webengine/Makefile +++ b/www/qt6-webengine/Makefile @@ -15,7 +15,7 @@ PORTNAME= webengine DISTVERSION= ${QT6_VERSION} -PORTREVISION= 5 +PORTREVISION= 6 CATEGORIES= www PKGNAMEPREFIX= qt6- @@ -109,8 +109,8 @@ SNDIO_CMAKE_OFF= -DQT_FEATURE_webengine_system_sndio:BOOL=OFF .include -.if ${ARCH} == i386 -EXTRA_PATCHES+= ${PATCHDIR}/extra-patch-i386-compress_files_js +.if ${ARCH} == i386 || ${ARCH} == armv7 +EXTRA_PATCHES+= ${PATCHDIR}/extra-patch-32bit-compress_files_js .endif post-extract: diff --git a/www/qt6-webengine/files/extra-patch-i386-compress_files_js b/www/qt6-webengine/files/extra-patch-32bit-compress_files_js similarity index 92% rename from www/qt6-webengine/files/extra-patch-i386-compress_files_js rename to www/qt6-webengine/files/extra-patch-32bit-compress_files_js index 80ea9a241cf1..f8841846ef6c 100644 --- a/www/qt6-webengine/files/extra-patch-i386-compress_files_js +++ b/www/qt6-webengine/files/extra-patch-32bit-compress_files_js @@ -8,7 +8,7 @@ node.js stops with either SIGSEGV or SIGABRT after ~530 processed files. output.write(Buffer.from(sizeHeader)); return new Promise((resolve, reject) => { - pipeline(Readable.from(sourceData), zlib.createBrotliCompress(), output, err => { -+ pipeline(Readable.from(sourceData), zlib.createBrotliCompress({ params: { [zlib.constants.BROTLI_PARAM_QUALITY]: 5 } }), output, err => { ++ pipeline(Readable.from(sourceData), zlib.createBrotliCompress({ params: { [zlib.constants.BROTLI_PARAM_QUALITY]: 4 } }), output, err => { return err ? reject(err) : resolve(); }); }); diff --git a/www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_boringssl_BUILD.generated.gni b/www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_boringssl_BUILD.generated.gni index d56bf128afe3..bf3f823921b2 100644 --- a/www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_boringssl_BUILD.generated.gni +++ b/www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_boringssl_BUILD.generated.gni @@ -1,14 +1,17 @@ ---- src/3rdparty/chromium/third_party/boringssl/BUILD.generated.gni.orig 2022-09-26 10:05:50 UTC +--- src/3rdparty/chromium/third_party/boringssl/BUILD.generated.gni.orig 2022-12-12 18:53:13 UTC +++ src/3rdparty/chromium/third_party/boringssl/BUILD.generated.gni -@@ -81,6 +81,7 @@ crypto_sources = [ +@@ -81,8 +81,10 @@ 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", +@@ -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/www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_boringssl_src_crypto_cpu__arm__freebsd.c b/www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_boringssl_src_crypto_cpu__arm__freebsd.c new file mode 100644 index 000000000000..adc47e13ece5 --- /dev/null +++ b/www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_boringssl_src_crypto_cpu__arm__freebsd.c @@ -0,0 +1,55 @@ +--- src/3rdparty/chromium/third_party/boringssl/src/crypto/cpu_arm_freebsd.c.orig 2023-06-03 08:17:28 UTC ++++ src/3rdparty/chromium/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/www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_skia_src_core_SkCpu.cpp b/www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_skia_src_core_SkCpu.cpp index 9eec9fed6607..d7a0a931b2aa 100644 --- a/www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_skia_src_core_SkCpu.cpp +++ b/www/qt6-webengine/files/patch-src_3rdparty_chromium_third__party_skia_src_core_SkCpu.cpp @@ -1,4 +1,4 @@ ---- src/3rdparty/chromium/third_party/skia/src/core/SkCpu.cpp.orig 2022-09-26 10:05:50 UTC +--- src/3rdparty/chromium/third_party/skia/src/core/SkCpu.cpp.orig 2022-06-10 05:40:07 UTC +++ src/3rdparty/chromium/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/www/qt6-webengine/files/patch-src_3rdparty_chromium_v8_src_base_platform_platform-freebsd.cc b/www/qt6-webengine/files/patch-src_3rdparty_chromium_v8_src_base_platform_platform-freebsd.cc index 63441114dca2..eb34b5eb35c5 100644 --- a/www/qt6-webengine/files/patch-src_3rdparty_chromium_v8_src_base_platform_platform-freebsd.cc +++ b/www/qt6-webengine/files/patch-src_3rdparty_chromium_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