From nobody Sun Feb 5 14:50:36 2023 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 4P8sl05qpdz3ncfM; Sun, 5 Feb 2023 14:50:36 +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 4P8sl05MVCz411K; Sun, 5 Feb 2023 14:50:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675608636; 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=vqYS/BTgcczCF//VdEf30/HiNwAAqxoWPyV0PWZrQUM=; b=UWxhHo2anphmKeHVDogKHx4y7I4O3pk3rrs6OlO9wRUBgnTtggwTFykGmsPO6AEWIcB7ud /mNSgqFGFcoyCq3ZoRVkRrVWCXHb6Y43KU38TMkqHNnk7OkGdr2+TEnB7um7b0zkv5xbBl cbbH70P0vaLW7DKv7+finDkmLZlyOepg5t+xbUhJNw5jsOQoi9eV05Km/5jgsx8BMVGV5O GIaplfYPSDh9pjXaHXiCofrgMXIL/yOI4TaST3AGzebSeuqOwiND4sagfjpMqpGwjfJMct ib33zdrPyO20jss5zaPHQfazaY+QGO7UmMrOaLrzBlV2lsX9PRaGwNIHu1WUBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675608636; 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=vqYS/BTgcczCF//VdEf30/HiNwAAqxoWPyV0PWZrQUM=; b=n+LoSwkDXmQWTZPPJIbejAC2tfOpk43sSp3w6UqPWst/URRudc9YomvW9NNqf+zorN17Yp cP9y6T7nywcPUEqEnADNhPSdUhJZN45O19lHrTQAZVCcGnAJQ0F+cQNu8qKus5Ng+KGDt8 1f6G/Lmqo7uu5uHt8VZbfVOfEJKSLUy/+AC35UNMr3W50yyARXchPl6LOmR7bXEgxYqt9B 7bBCoHkYhsyy4lb34Fqtp3d03QSeda314o4LJsqC1sTIcB01W8BCqkGVh0TJNM4Fbbpy1q RazywINSV8k/aicJm6NAW6aW2HumeF7Dbn8IHOMoMR8GrPWInJhnw25RjmzGDw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675608636; a=rsa-sha256; cv=none; b=bSrp36Ct5fszIYEh4HRYrjHpRX1r++S8FNE6r1CyTi/BAEdYV9z8/Lt/0YBaV8FA9IDnrp h9ZN3q1ToQTSHfSgXDFQsMLPKWGSwMzMQ5dMrkc4ss/E5ToMKN41KIlKt2OoZG2Gi1pwlU RF17XdtrfaOPNL+duQoXeH17C7k9a0015w6NZQFh182j/x7Rw9aT9zJ6cn6b/1SF2a4jkR VQTIX1mrpwsnbhC5TvjdoSQ7TIkKC4rpKFVCK6o4Rhtb1JoHJDFaOlhRmNxIrJ7f3NODrM DDzGS5VuYdPLwW/djSKdz7PWzU/2wtYWaOoqwodb4aVEdVhjX7XpLo0Tsc9fGw== 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 4P8sl04QF0zy8l; Sun, 5 Feb 2023 14:50:36 +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 315Eoa4I033025; Sun, 5 Feb 2023 14:50:36 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 315EoaoK033024; Sun, 5 Feb 2023 14:50:36 GMT (envelope-from git) Date: Sun, 5 Feb 2023 14:50:36 GMT Message-Id: <202302051450.315EoaoK033024@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Nuno Teixeira Subject: git: 154cb0fbb0b4 - main - security/gostsum: 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: eduardo X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 154cb0fbb0b42ccbbf26a17dd9a2c43ed268cf06 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by eduardo: URL: https://cgit.FreeBSD.org/ports/commit/?id=154cb0fbb0b42ccbbf26a17dd9a2c43ed268cf06 commit 154cb0fbb0b42ccbbf26a17dd9a2c43ed268cf06 Author: Robert Clausecker AuthorDate: 2023-02-05 14:48:18 +0000 Commit: Nuno Teixeira CommitDate: 2023-02-05 14:50:10 +0000 security/gostsum: Fix build on armv7 The build is fixed by adding some missing bits of assembly code. Add some more assembly code for arm64 for good measure. While we are at it, fix a warning due to a missing include file. PR: 269267 Approved by: portmgr blanket MFH: 2023Q1 (build fixes) --- security/gostsum/Makefile | 1 + security/gostsum/files/patch-gosthash.c | 68 +++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+) diff --git a/security/gostsum/Makefile b/security/gostsum/Makefile index 5d14ce027b94..1bf5776c9de2 100644 --- a/security/gostsum/Makefile +++ b/security/gostsum/Makefile @@ -1,5 +1,6 @@ PORTNAME= gostsum PORTVERSION= 20221213 +PORTREVISION= 1 CATEGORIES= security MAINTAINER= rozhuk.im@gmail.com diff --git a/security/gostsum/files/patch-gosthash.c b/security/gostsum/files/patch-gosthash.c new file mode 100644 index 000000000000..211dab17ad28 --- /dev/null +++ b/security/gostsum/files/patch-gosthash.c @@ -0,0 +1,68 @@ +--- gosthash.c.orig 2022-12-13 13:51:25 UTC ++++ gosthash.c +@@ -26,9 +26,8 @@ echo -n "8JaanTcVv6ndF8Xp/N011Lp46e68LjaUT9FhnEyQGs8=" + #if defined(__sun__) || defined(__linux__) || defined(__FreeBSD__) + #define _aligned_malloc(size, align) memalign(align, size) + #define _aligned_free(ptr) free(ptr) +-#else +-#include + #endif // __sun__ __linux__ __FreeBSD__ ++#include + + typedef char v16qi __attribute__((__vector_size__(16))); + //typedef uint8_t v4qi __attribute__((__vector_size__(4))); +@@ -141,7 +140,53 @@ static inline void XOR(v256 *x, const v256 *a) + x->q[1] ^= a->q[1]; + } + #if defined(__arm__) +-extern void UADD(v256 *a, v256 *b); ++static inline ++void UADD(v256 *a, v256 *b) ++{ ++ __asm volatile ( ++ " ldmia %0, {r0, r1, r2, r3}\n" ++ " ldmia %1!, {r4, r5, r6, r7}\n" ++ " adds r0, r0, r4\n" ++ " adcs r1, r1, r5\n" ++ " adcs r2, r2, r6\n" ++ " adcs r3, r3, r7\n" ++ " stmia %0!, {r0, r1, r2, r3}\n" ++ ++ " ldmia %0, {r0, r1, r2, r3}\n" ++ " ldmia %1!, {r4, r5, r6, r7}\n" ++ " adcs r0, r0, r4\n" ++ " adcs r1, r1, r5\n" ++ " adcs r2, r2, r6\n" ++ " adcs r3, r3, r7\n" ++ " stmia %0!, {r0, r1, r2, r3}\n" ++ ++ " sub %0, %0, #64\n" ++ " sub %1, %1, #64\n" ++ ++ :: "r"(a), "r"(b) : "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", "memory"); ++} ++#elif defined(__aarch64__) ++static inline ++void UADD(v256 *a, v256 *b) ++{ ++ uint64_t a0, a1, b0, b1; ++ ++ __asm volatile ( ++ " ldp %0, %1, [%4, #0]\n" ++ " ldp %2, %3, [%5, #0]\n" ++ " adds %0, %0, %2\n" ++ " adcs %1, %1, %3\n" ++ " stp %0, %1, [%4, #0]\n" ++ ++ " ldp %0, %1, [%4, #16]\n" ++ " ldp %2, %3, [%5, #16]\n" ++ " adcs %0, %0, %2\n" ++ " adcs %1, %1, %3\n" ++ " stp %0, %1, [%4, #16]\n" ++ ++ : "=r"(a0), "=r"(a1), "=r"(b0), "=r"(b1) ++ : "r"(a), "r"(b) : "memory"); ++} + + #elif defined(__x86_64__)//0 + static inline