From nobody Mon Jun 26 23:30:41 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 4Qqkc20sXRz4kNP2; Mon, 26 Jun 2023 23:30:42 +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 4Qqkc20HKRz3wM5; Mon, 26 Jun 2023 23:30:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1687822242; 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=wqesc+9np5et/ZqMa0PDZCHnujXYN0Km0INo3G9sW3Q=; b=MyIR90qzlB3pB2+DuNhDjhAon+tFIadzGif3TwU053bSR2/K76KHmx4E6ZJoJsfOtInJPU so3FTXXkaZ3HA9F44933+UsHYOW5thLJkkCIrvqMrZFWPUpgWQdBQCCvKYcoFFjU1kFb1G oamcKSKHxNOTcAkw/4rh7YBkmQtN4Hv3SA+ETWzAbwCqEg9JdSBgxOPJ+ep2e35//nAKVO ltf6siTVN6b9jx0kLUsl6IXgiX0yQ6ickham4EOUXM6LYWymOSpmrxOeIeHkc8yWlsH9Un hDir28UuDK8Ww9gdH9vbKfd3Sfx1Rx4WhWihl0m1E0MTIdOvX3Z2dBrsl2Bo3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1687822242; 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=wqesc+9np5et/ZqMa0PDZCHnujXYN0Km0INo3G9sW3Q=; b=NFrAddEUiCUWJUIA2uwIjTlOtmVephBz2cdjsha+eVZ2McPJhlEmcNqvO06KW31TI+/7yI RBeokM1yqIYmKTEuUQxcJ5GgOuXQbZIl+F2oPeENk0wgwCynqnnpV3pt8QUlW1DUMpciwO E62WqtjGeQ0EMjvxhBCfs0OfpM+TaIv91iV2D1y5Smf8oHU82Rjl41gqhtNPydWCGgrXED 2EYLch5EgK8ZIq2iqcRTo1FwUIU0IZOKHrBwnCRUvdjr5cHa84eOTefh3Ccs2c6t102tVg AsZQPGJ5wZwib4Gy9n1Ya5MjED3s5IOeF5UP/PUHJN6OkfifM+9+ZaUtP2Ao7w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1687822242; a=rsa-sha256; cv=none; b=g1BcKvpYp8Qgy9guvs8kxdDPrL4GhNKsd14U972AEBUXNTt1HMvRJOsR1np0r7G8aQhyUi zGg3tlEc5ahU7WEGsbD8+6KODYSwdB9L6AvLUj8gjHVUuO3oI+B/4WrinR0+lpb7/wI7Vf dAdCRq4XIja8F3NOdmocWCI43lNxnOOBAk2HSAelqflMCNkAyEorGXTzt7UuKR7Yc4i//J a6sFrchFWeY0DIk/bMgEYqUblnlJgoGgh/0qIP8PWSP1XWHgFsvt5hK252QsaN6TKlZQI6 soYY/bgzdi2FJP1K6+UUU94twdYSOCeks6q4PaGQ05PgisSkYtV/bEb5fUUM4A== 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 4Qqkc15rFqzV2l; Mon, 26 Jun 2023 23:30:41 +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 35QNUf72025663; Mon, 26 Jun 2023 23:30:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 35QNUfeS025662; Mon, 26 Jun 2023 23:30:41 GMT (envelope-from git) Date: Mon, 26 Jun 2023 23:30:41 GMT Message-Id: <202306262330.35QNUfeS025662@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: 1ebb93fd8095 - main - emulators/qmc2: fix build on armv7 and arm64 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: 1ebb93fd8095f4cc77bd8f0681580e9ef747b965 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by fuz: URL: https://cgit.FreeBSD.org/ports/commit/?id=1ebb93fd8095f4cc77bd8f0681580e9ef747b965 commit 1ebb93fd8095f4cc77bd8f0681580e9ef747b965 Author: Robert Clausecker AuthorDate: 2023-06-25 16:55:58 +0000 Commit: Robert Clausecker CommitDate: 2023-06-26 23:30:28 +0000 emulators/qmc2: fix build on armv7 and arm64 Port now bundles LZMA with known build issues. Import patch set from archivers/7-zip to fix the build on armv7 and arm64. PR: 271987 Approved by: portmgr (build fix blanket) Obtained from: archivers/7-zip --- emulators/qmc2/Makefile | 3 +- emulators/qmc2/files/patch-src_lzma_7zCrc.c | 11 +++++++ emulators/qmc2/files/patch-src_lzma_Aes.c | 11 +++++++ emulators/qmc2/files/patch-src_lzma_AesOpt.c | 38 ++++++++++++++++++++++ emulators/qmc2/files/patch-src_lzma_CpuArch.c | 42 +++++++++++++++++++++++++ emulators/qmc2/files/patch-src_lzma_Sha256Opt.c | 11 +++++++ 6 files changed, 115 insertions(+), 1 deletion(-) diff --git a/emulators/qmc2/Makefile b/emulators/qmc2/Makefile index dd97ba72bf37..fa4715f69d1b 100644 --- a/emulators/qmc2/Makefile +++ b/emulators/qmc2/Makefile @@ -1,7 +1,7 @@ PORTNAME= qmc2 PORTVERSION= 0.243 DISTVERSIONPREFIX= v -PORTREVISION= 3 +PORTREVISION= 4 CATEGORIES= emulators games MAINTAINER= agh@riseup.net @@ -52,6 +52,7 @@ MAKE_ARGS= ARCH="${OPSYS}" \ SYSCONFDIR="${PREFIX}/etc" ALL_TARGET= all arcade tools +CFLAGS_aarch64= -march=armv8-a+crc+crypto OPTIONS_DEFINE= DOCS EXAMPLES DOCS_DESC= Comprehensive qmc2 documentaion diff --git a/emulators/qmc2/files/patch-src_lzma_7zCrc.c b/emulators/qmc2/files/patch-src_lzma_7zCrc.c new file mode 100644 index 000000000000..17f415efdd35 --- /dev/null +++ b/emulators/qmc2/files/patch-src_lzma_7zCrc.c @@ -0,0 +1,11 @@ +--- src/lzma/7zCrc.c.orig 2022-04-29 08:33:05 UTC ++++ src/lzma/7zCrc.c +@@ -71,7 +71,7 @@ UInt32 MY_FAST_CALL CrcUpdateT1(UInt32 v, const void * + + #ifdef MY_CPU_LE + +-#if defined(MY_CPU_ARM_OR_ARM64) ++#if defined(MY_CPU_ARM64) + + // #pragma message("ARM*") + diff --git a/emulators/qmc2/files/patch-src_lzma_Aes.c b/emulators/qmc2/files/patch-src_lzma_Aes.c new file mode 100644 index 000000000000..9df1e0134247 --- /dev/null +++ b/emulators/qmc2/files/patch-src_lzma_Aes.c @@ -0,0 +1,11 @@ +--- src/lzma/Aes.c.orig 2022-04-29 08:33:05 UTC ++++ src/lzma/Aes.c +@@ -55,7 +55,7 @@ static Byte InvS[256]; + + #ifdef MY_CPU_X86_OR_AMD64 + #define USE_HW_AES +-#elif defined(MY_CPU_ARM_OR_ARM64) && defined(MY_CPU_LE) ++#elif defined(MY_CPU_ARM) && defined(MY_CPU_LE) + #if defined(__clang__) + #if (__clang_major__ >= 8) // fix that check + #define USE_HW_AES diff --git a/emulators/qmc2/files/patch-src_lzma_AesOpt.c b/emulators/qmc2/files/patch-src_lzma_AesOpt.c new file mode 100644 index 000000000000..3519cc5af7ce --- /dev/null +++ b/emulators/qmc2/files/patch-src_lzma_AesOpt.c @@ -0,0 +1,38 @@ +--- src/lzma/AesOpt.c.orig 2022-04-29 08:33:05 UTC ++++ src/lzma/AesOpt.c +@@ -506,7 +506,7 @@ VAES_COMPAT_STUB (AesCtr_Code_HW) + #endif // ! USE_INTEL_VAES + + +-#elif defined(MY_CPU_ARM_OR_ARM64) && defined(MY_CPU_LE) ++#elif defined(MY_CPU_ARM64) && defined(MY_CPU_LE) + + #if defined(__clang__) + #if (__clang_major__ >= 8) // fix that check +@@ -773,4 +773,25 @@ AES_FUNC_START2 (AesCtr_Code_HW) + + #endif // USE_HW_AES + +-#endif // MY_CPU_ARM_OR_ARM64 ++#else ++ ++/* no USE_HW_AES */ ++ ++#pragma message("AES HW_SW stub was used") ++ ++#define AES_TYPE_keys UInt32 ++#define AES_TYPE_data Byte ++ ++#define AES_FUNC_START(name) \ ++ void MY_FAST_CALL name(UInt32 *p, Byte *data, size_t numBlocks) \ ++ ++#define AES_COMPAT_STUB(name) \ ++ AES_FUNC_START(name); \ ++ AES_FUNC_START(name ## _HW) \ ++ { name(p, data, numBlocks); } ++ ++AES_COMPAT_STUB (AesCbc_Encode) ++AES_COMPAT_STUB (AesCbc_Decode) ++AES_COMPAT_STUB (AesCtr_Code) ++ ++#endif diff --git a/emulators/qmc2/files/patch-src_lzma_CpuArch.c b/emulators/qmc2/files/patch-src_lzma_CpuArch.c new file mode 100644 index 000000000000..ae35cfdfe082 --- /dev/null +++ b/emulators/qmc2/files/patch-src_lzma_CpuArch.c @@ -0,0 +1,42 @@ +--- src/lzma/CpuArch.c.orig 2022-04-29 08:33:05 UTC ++++ src/lzma/CpuArch.c +@@ -417,6 +417,31 @@ BoolInt CPU_IsSupported_AES (void) { return APPLE_CRYP + + #include + ++#if defined(__FreeBSD__) ++static unsigned long get_hwcap(int aux) { ++ unsigned long hwcap; ++ if (elf_aux_info(aux, &hwcap, sizeof hwcap) != 0) { ++ return 0; ++ } ++ return hwcap; ++} ++ ++#ifdef MY_CPU_ARM64 ++BoolInt CPU_IsSupported_CRC32(void) { return get_hwcap(AT_HWCAP) & HWCAP_CRC32; } ++BoolInt CPU_IsSupported_NEON(void) { return 1; } ++BoolInt CPU_IsSupported_SHA1(void){ return get_hwcap(AT_HWCAP) & HWCAP_SHA1; } ++BoolInt CPU_IsSupported_SHA2(void) { return get_hwcap(AT_HWCAP) & HWCAP_SHA2; } ++BoolInt CPU_IsSupported_AES(void) { return get_hwcap(AT_HWCAP) & HWCAP_AES; } ++#else /* MY_CPU_ARM */ ++BoolInt CPU_IsSupported_CRC32(void) { return get_hwcap(AT_HWCAP2) & HWCAP2_CRC32; } ++BoolInt CPU_IsSupported_NEON(void) { return get_hwcap(AT_HWCAP) & HWCAP_NEON; } ++BoolInt CPU_IsSupported_SHA1(void){ return get_hwcap(AT_HWCAP2) & HWCAP2_SHA1; } ++BoolInt CPU_IsSupported_SHA2(void) { return get_hwcap(AT_HWCAP2) & HWCAP2_SHA2; } ++BoolInt CPU_IsSupported_AES(void) { return get_hwcap(AT_HWCAP2) & HWCAP2_AES; } ++#endif ++ ++#else // __FreeBSD__ ++ + #define USE_HWCAP + + #ifdef USE_HWCAP +@@ -450,6 +475,7 @@ MY_HWCAP_CHECK_FUNC (SHA1) + MY_HWCAP_CHECK_FUNC (SHA2) + MY_HWCAP_CHECK_FUNC (AES) + ++#endif // FreeBSD + #endif // __APPLE__ + #endif // _WIN32 + diff --git a/emulators/qmc2/files/patch-src_lzma_Sha256Opt.c b/emulators/qmc2/files/patch-src_lzma_Sha256Opt.c new file mode 100644 index 000000000000..2a1acdccd036 --- /dev/null +++ b/emulators/qmc2/files/patch-src_lzma_Sha256Opt.c @@ -0,0 +1,11 @@ +--- src/lzma/Sha256Opt.c.orig 2022-04-29 08:33:05 UTC ++++ src/lzma/Sha256Opt.c +@@ -212,7 +212,7 @@ void MY_FAST_CALL Sha256_UpdateBlocks_HW(UInt32 state[ + + #endif // USE_HW_SHA + +-#elif defined(MY_CPU_ARM_OR_ARM64) ++#elif defined(MY_CPU_ARM64) + + #if defined(__clang__) + #if (__clang_major__ >= 8) // fix that check