From owner-svn-ports-all@freebsd.org Fri Nov 2 15:19:34 2018 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C958010FACA1; Fri, 2 Nov 2018 15:19:34 +0000 (UTC) (envelope-from linimon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 722DA706C6; Fri, 2 Nov 2018 15:19:34 +0000 (UTC) (envelope-from linimon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 54DC7490A; Fri, 2 Nov 2018 15:19:34 +0000 (UTC) (envelope-from linimon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wA2FJY80078270; Fri, 2 Nov 2018 15:19:34 GMT (envelope-from linimon@FreeBSD.org) Received: (from linimon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wA2FJXYd078267; Fri, 2 Nov 2018 15:19:33 GMT (envelope-from linimon@FreeBSD.org) Message-Id: <201811021519.wA2FJXYd078267@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: linimon set sender to linimon@FreeBSD.org using -f From: Mark Linimon Date: Fri, 2 Nov 2018 15:19:33 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r483817 - head/devel/objecthash/files X-SVN-Group: ports-head X-SVN-Commit-Author: linimon X-SVN-Commit-Paths: head/devel/objecthash/files X-SVN-Commit-Revision: 483817 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2018 15:19:35 -0000 Author: linimon Date: Fri Nov 2 15:19:33 2018 New Revision: 483817 URL: https://svnweb.freebsd.org/changeset/ports/483817 Log: GCC disallows creating arrays of variable size (and const int is a variable as well). Fix that to fix build on powerpc64. PR: 231736 Submitted by: Piotr Kubaj Added: head/devel/objecthash/files/ head/devel/objecthash/files/patch-Makefile (contents, props changed) head/devel/objecthash/files/patch-objecthash.c (contents, props changed) head/devel/objecthash/files/patch-objecthash.h (contents, props changed) Added: head/devel/objecthash/files/patch-Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/objecthash/files/patch-Makefile Fri Nov 2 15:19:33 2018 (r483817) @@ -0,0 +1,15 @@ +--- Makefile.orig 2016-08-01 17:37:31 UTC ++++ Makefile +@@ -14,10 +14,10 @@ java: + sbt test + + objecthash_test: libobjecthash.so +- $(CC) -std=c99 -Wall -Werror -o objecthash_test objecthash_test.c -lobjecthash -L. -Wl,-rpath -Wl,. ++ $(CC) ${CFLAGS} -std=c99 -Wall -Werror -o objecthash_test objecthash_test.c -lobjecthash -L. -Wl,-rpath -Wl,. + + libobjecthash.so: objecthash.c +- $(CC) -fPIC -shared -std=c99 -Wall -Werror -o libobjecthash.so objecthash.c -lcrypto `pkg-config --libs --cflags icu-uc json-c` ++ $(CC) ${CFLAGS} -fPIC -shared -std=c99 -Wall -Werror -o libobjecthash.so objecthash.c -lcrypto `pkg-config --libs --cflags icu-uc json-c` + + get: + GOPATH=`pwd` go get golang.org/x/text/unicode/norm Added: head/devel/objecthash/files/patch-objecthash.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/objecthash/files/patch-objecthash.c Fri Nov 2 15:19:33 2018 (r483817) @@ -0,0 +1,38 @@ +--- objecthash.c.orig 2018-09-25 21:01:54 UTC ++++ objecthash.c +@@ -13,7 +13,7 @@ + + #include "objecthash.h" + +-bool object_hash(/*const*/ json_object *j, byte hash[HASH_SIZE]); ++bool object_hash(/*const*/ json_object *j, byte hash[SHA256_DIGEST_LENGTH]); + + static void hash_update(hash_ctx * const c, const byte * const b, + const size_t l) { +@@ -45,7 +45,7 @@ static int dict_comp(const void *a, const void *b) { + return memcmp(a, b, 2 * sizeof(hash)); + } + +-static bool object_hash_str(const char *str, size_t len, byte hash[HASH_SIZE]) { ++static bool object_hash_str(const char *str, size_t len, byte hash[SHA256_DIGEST_LENGTH]) { + hash_bytes('u', (const byte *)str, len, hash); + return true; + } +@@ -147,7 +147,7 @@ static bool object_hash_list(json_object *l, hash h) { + + int len = json_object_array_length(l); + for (int n = 0; n < len; ++n) { +- byte ihash[HASH_SIZE]; ++ byte ihash[SHA256_DIGEST_LENGTH]; + if (!object_hash(json_object_array_get_idx(l, n), ihash)) + return false; + hash_update(&ctx, ihash, sizeof ihash); +@@ -157,7 +157,7 @@ static bool object_hash_list(json_object *l, hash h) { + return true; + } + +-bool object_hash(/*const*/ json_object *j, byte hash[HASH_SIZE]) { ++bool object_hash(/*const*/ json_object *j, byte hash[SHA256_DIGEST_LENGTH]) { + enum json_type type; + type = json_object_get_type(j); + switch (type) { Added: head/devel/objecthash/files/patch-objecthash.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/objecthash/files/patch-objecthash.h Fri Nov 2 15:19:33 2018 (r483817) @@ -0,0 +1,13 @@ +--- objecthash.h.orig 2018-09-25 20:58:11 UTC ++++ objecthash.h +@@ -8,9 +8,7 @@ extern "C" { + + typedef unsigned char byte; + +-static const int HASH_SIZE = SHA256_DIGEST_LENGTH; +- +-typedef byte hash[HASH_SIZE]; ++typedef byte hash[SHA256_DIGEST_LENGTH]; + typedef SHA256_CTX hash_ctx; + + bool python_json_hash(const char *json, hash h);