FreeBSD Bugzilla – Attachment 239834 Details for
Bug 269267
security/gostsum: fix build on armv7
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
security/gostsum: fix build on armv7
0001-security-gostsum-fix-build-on-armv7.patch (text/plain), 3.09 KB, created by
Robert Clausecker
on 2023-01-31 21:37:36 UTC
(
hide
)
Description:
security/gostsum: fix build on armv7
Filename:
MIME Type:
Creator:
Robert Clausecker
Created:
2023-01-31 21:37:36 UTC
Size:
3.09 KB
patch
obsolete
>From 08b5b0a57ce37e9c20b218bedd63bc77ada90f93 Mon Sep 17 00:00:00 2001 >From: Robert Clausecker <fuz@fuz.su> >Date: Tue, 31 Jan 2023 22:34:52 +0100 >Subject: [PATCH] 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. >--- > security/gostsum/Makefile | 1 + > security/gostsum/files/patch-gosthash.c | 68 +++++++++++++++++++++++++ > 2 files changed, 69 insertions(+) > create mode 100644 security/gostsum/files/patch-gosthash.c > >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 <malloc.h> >+ #endif // __sun__ __linux__ __FreeBSD__ >++#include <malloc.h> >+ >+ 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 >-- >2.38.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
fuz
:
maintainer-approval?
(
rozhuk.im
)
Actions:
View
|
Diff
Attachments on
bug 269267
: 239834