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



On Wed, May 24, 2017 at 10:04 PM, Noriyuki Soda <soda%netbsd.org@localhost> wrote:
Module Name:    pkgsrc
Committed By:   soda
Date:           Thu May 25 03:04:05 UTC 2017

Modified Files:
        pkgsrc/devel/git-base: Makefile distinfo
        pkgsrc/devel/git-base/patches: patch-sha1dc_sha1.c

Log Message:
git-base-2.13.0nb1 broke all little endian platforms on *BSD.
(NOTE: _BIG_ENDIAN is always defined even on litte endian platforms)
from nonaka@


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 pkgsrc/devel/git-base/Makefile
cvs rdiff -u -r1.62 -r1.63 pkgsrc/devel/git-base/distinfo
cvs rdiff -u -r1.1 -r1.2 pkgsrc/devel/git-base/patches/patch-sha1dc_sha1.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.


$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