From owner-svn-ports-all@FreeBSD.ORG Mon Jun 1 22:01:54 2015 Return-Path: Delivered-To: svn-ports-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2D8B2A42; Mon, 1 Jun 2015 22:01:54 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 02FAF187B; Mon, 1 Jun 2015 22:01:54 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t51M1rDI050090; Mon, 1 Jun 2015 22:01:53 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t51M1rlj050087; Mon, 1 Jun 2015 22:01:53 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201506012201.t51M1rlj050087@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Mon, 1 Jun 2015 22:01:53 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r388290 - in head/sysutils/b2sum: . files X-SVN-Group: ports-head 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.20 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: Mon, 01 Jun 2015 22:01:54 -0000 Author: bapt Date: Mon Jun 1 22:01:52 2015 New Revision: 388290 URL: https://svnweb.freebsd.org/changeset/ports/388290 Log: Improve sysutils/b2sum: Make SSE2+ instructions optinal (default ON for amd64, can be used on some i386) to alow buiding on any platform Add OpenMP option Patch to not crash when compiled with Clang Pass maintainership to submitter Bump portrevision PR: 200561 Submitted by: matthew@reztek.cz Added: head/sysutils/b2sum/files/ head/sysutils/b2sum/files/patch-blake2.h (contents, props changed) head/sysutils/b2sum/files/use_ref.patch (contents, props changed) Modified: head/sysutils/b2sum/Makefile Modified: head/sysutils/b2sum/Makefile ============================================================================== --- head/sysutils/b2sum/Makefile Mon Jun 1 21:43:27 2015 (r388289) +++ head/sysutils/b2sum/Makefile Mon Jun 1 22:01:52 2015 (r388290) @@ -1,25 +1,50 @@ # $FreeBSD$ PORTNAME= b2sum -PORTVERSION= 0.0.d${DISTVERSION} -DISTVERSION= 20150529 -DISTNAME= blake2_code_${DISTVERSION}${EXTRACT_SUFFX} +PORTVERSION= 0.0.d${B2VERSION} +PORTREVISION= 1 CATEGORIES= sysutils security MASTER_SITES= http://blake2.net/ +DISTNAME= blake2_code_${B2VERSION}${EXTRACT_SUFFX} -MAINTAINER= bapt@FreeBSD.org -COMMENT= fast secure hashing +MAINTAINER= matthew@reztek.cz +COMMENT= Fast secure hashing -USES= zip +LICENSE= CC0-1.0 +LICENSE_FILE= ${WRKSRC}/../COPYING -ONLY_FOR_ARCH= amd64 +B2VERSION= 20150529 -CFLAGS+= -I../sse +USES= zip +USE_CSTD= c99 WRKSRC_SUBDIR= b2sum MAKEFILE= makefile MAKE_ARGS= CC="${CC}" CFLAGS="${CFLAGS}" PLIST_FILES= bin/b2sum +OPTIONS_DEFINE= OPENMP OPTIMIZED_CFLAGS SSE +OPTIONS_DEFAULT_amd64=SSE +SSE_DESC= Use SSE2, SSSE3, SSE4.1, AVX or XOP instructions + +OPENMP_USES+= compiler:openmp +OPENMP_CFLAGS+= -fopenmp + +.include + +.if ${PORT_OPTIONS:MOPTIMIZED_CFLAGS} +CFLAGS+= -O3 +.if !${CFLAGS:M-march=*} +CFLAGS+= -march=native +.endif +.endif + +.if (${PORT_OPTIONS:MSSE} && (${ARCH} == "i386" || ${ARCH} == "amd64")) +CFLAGS+= -I../sse +.else +CFLAGS+= -I../ref +EXTRA_PATCHES= ${PATCHDIR}/use_ref.patch +.endif + do-install: ${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${STAGEDIR}${PREFIX}/bin Added: head/sysutils/b2sum/files/patch-blake2.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/b2sum/files/patch-blake2.h Mon Jun 1 22:01:52 2015 (r388290) @@ -0,0 +1,22 @@ +--- ../ref/blake2.h.orig 2015-06-01 01:10:19 UTC ++++ ../ref/blake2.h +@@ -19,6 +19,8 @@ + + #if defined(_MSC_VER) + #define ALIGN(x) __declspec(align(x)) ++#elif defined(__clang__) ++#define ALIGN(x) /* unaligned access in b2*p at -O >0 */ + #else + #define ALIGN(x) __attribute__((aligned(x))) + #endif +--- ../sse/blake2.h.orig 2015-05-29 08:02:54 UTC ++++ ../sse/blake2.h +@@ -19,6 +19,8 @@ + + #if defined(_MSC_VER) + #define ALIGN(x) __declspec(align(x)) ++#elif defined(__clang__) ++#define ALIGN(x) /* unaligned access in b2*p at -O >0 */ + #else + #define ALIGN(x) __attribute__ ((__aligned__(x))) + #endif Added: head/sysutils/b2sum/files/use_ref.patch ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/b2sum/files/use_ref.patch Mon Jun 1 22:01:52 2015 (r388290) @@ -0,0 +1,13 @@ +--- makefile.orig 2015-05-31 23:30:20 UTC ++++ makefile +@@ -1,8 +1,8 @@ + CC=gcc + CFLAGS=-std=c99 -O3 -march=native -I../sse -static -fopenmp + LIBS= +-#FILES=blake2sum.c ../ref/blake2b-ref.c ../ref/blake2s-ref.c ../ref/blake2bp-ref.c ../ref/blake2sp-ref.c +-FILES=b2sum.c ../sse/blake2b.c ../sse/blake2s.c ../sse/blake2bp.c ../sse/blake2sp.c ++FILES=b2sum.c ../ref/blake2b-ref.c ../ref/blake2s-ref.c ../ref/blake2bp-ref.c ../ref/blake2sp-ref.c ++#FILES=b2sum.c ../sse/blake2b.c ../sse/blake2s.c ../sse/blake2bp.c ../sse/blake2sp.c + all: $(FILES) + $(CC) $(FILES) $(CFLAGS) $(LIBS) -o b2sum +