pkgsrc-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: CVS commit: pkgsrc/devel/git-base
This commit breaks compile on Solaris SPARC... where _BIG_ENDIAN is defined as empty.
Does the attached patch work correctly for you on *BSD?
Thanks,
- Tim
$NetBSD: patch-sha1dc_sha1.c,v 1.1 2017/05/24 14:41:35 martin Exp $
Upstream fix for alignement issues in SHA1DCUpdate,
see: https://public-inbox.org/git/20170515220939.vkgofpkdtpz7u26v%sigill.intra.peff.net@localhost/T/#u
--- sha1dc/sha1.c.orig 2017-05-09 14:47:28.000000000 +0000
+++ sha1dc/sha1.c
@@ -20,8 +20,10 @@
*/
#if (defined(__BYTE_ORDER) && (__BYTE_ORDER == __BIG_ENDIAN)) || \
(defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __BIG_ENDIAN__)) || \
+ (defined(_BYTE_ORDER) && (_BYTE_ORDER == _BIG_ENDIAN + 0)) || \
defined(__BIG_ENDIAN__) || defined(__ARMEB__) || defined(__THUMBEB__) || defined(__AARCH64EB__) || \
- defined(_MIPSEB) || defined(__MIPSEB) || defined(__MIPSEB__)
+ defined(_MIPSEB) || defined(__MIPSEB) || defined(__MIPSEB__) || \
+ defined(__sparc) || defined(__sparcv9) || defined(__sparc__)
#define SHA1DC_BIGENDIAN 1
#else
@@ -1728,7 +1730,8 @@ void SHA1DCUpdate(SHA1_CTX* ctx, const c
while (len >= 64)
{
ctx->total += 64;
- sha1_process(ctx, (uint32_t*)(buf));
+ memcpy(ctx->buffer, buf, 64);
+ sha1_process(ctx, (uint32_t*)(ctx->buffer));
buf += 64;
len -= 64;
}
Home |
Main Index |
Thread Index |
Old Index