From owner-svn-src-all@freebsd.org Wed Apr 19 14:24:23 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 037CDD45096; Wed, 19 Apr 2017 14:24:23 +0000 (UTC) (envelope-from rb743@hermes.cam.ac.uk) Received: from ppsw-40.csi.cam.ac.uk (ppsw-40.csi.cam.ac.uk [131.111.8.140]) (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 B73E112FD; Wed, 19 Apr 2017 14:24:22 +0000 (UTC) (envelope-from rb743@hermes.cam.ac.uk) X-Cam-AntiVirus: no malware found X-Cam-ScannerInfo: http://help.uis.cam.ac.uk/email-scanner-virus Received: from sc1.bsdpad.com ([163.172.212.18]:61583) by ppsw-40.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.158]:587) with esmtpsa (LOGIN:rb743) (TLSv1:ECDHE-RSA-AES256-SHA:256) id 1d0qWp-000HSt-lT (Exim 4.89) (return-path ); Wed, 19 Apr 2017 15:24:19 +0100 Date: Wed, 19 Apr 2017 14:21:06 +0000 From: Ruslan Bukin To: Baptiste Daroussin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r316978 - in head: contrib/zstd etc/mtree lib lib/libzstd share/mk usr.bin usr.bin/zstd Message-ID: <20170419142106.GA59031@bsdpad.com> References: <201704152005.v3FK5M2j002459@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <201704152005.v3FK5M2j002459@repo.freebsd.org> User-Agent: Mutt/1.6.1 (2016-04-27) Sender: "R. Bukin" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Apr 2017 14:24:23 -0000 This break RISC-V world build: /home/br/obj//riscv.riscv64/usr/home/br/dev/freebsd-head/tmp/usr/lib/libprivatezstd.so: undefined reference to `__bswap si2' /home/br/obj//riscv.riscv64/usr/home/br/dev/freebsd-head/tmp/usr/lib/libprivatezstd.so: undefined reference to `__bswap di2' Here is patch that makes it compilable: diff --git a/contrib/zstd/lib/common/xxhash.c b/contrib/zstd/lib/common/xxhash.c index eb44222c5fc..d59a22a0638 100644 --- a/contrib/zstd/lib/common/xxhash.c +++ b/contrib/zstd/lib/common/xxhash.c @@ -206,7 +206,7 @@ static U64 XXH_read64(const void* memPtr) #if defined(_MSC_VER) /* Visual Studio */ # define XXH_swap32 _byteswap_ulong # define XXH_swap64 _byteswap_uint64 -#elif GCC_VERSION >= 403 +#elif (GCC_VERSION >= 403 && !defined(__riscv__)) # define XXH_swap32 __builtin_bswap32 # define XXH_swap64 __builtin_bswap64 #else Ruslan On Sat, Apr 15, 2017 at 08:05:22PM +0000, Baptiste Daroussin wrote: > Author: bapt > Date: Sat Apr 15 20:05:22 2017 > New Revision: 316978 > URL: https://svnweb.freebsd.org/changeset/base/316978 > > Log: > Import zstandard 1.1.4 in base > > zstandard is a new compression library/tool which is very fast at > compression/decompression > > For now import as a private library > > Added: > head/contrib/zstd/ > - copied from r316976, vendor/zstd/dist/ > head/lib/libzstd/ > head/lib/libzstd/Makefile (contents, props changed) > head/usr.bin/zstd/ > head/usr.bin/zstd/Makefile (contents, props changed) > Modified: > head/etc/mtree/BSD.usr.dist > head/lib/Makefile > head/share/mk/src.libnames.mk > head/usr.bin/Makefile > > Modified: head/etc/mtree/BSD.usr.dist > ============================================================================== > --- head/etc/mtree/BSD.usr.dist Sat Apr 15 20:03:50 2017 (r316977) > +++ head/etc/mtree/BSD.usr.dist Sat Apr 15 20:05:22 2017 (r316978) > @@ -17,6 +17,8 @@ > .. > ucl > .. > + zstd > + .. > .. > .. > lib > > Modified: head/lib/Makefile > ============================================================================== > --- head/lib/Makefile Sat Apr 15 20:03:50 2017 (r316977) > +++ head/lib/Makefile Sat Apr 15 20:05:22 2017 (r316978) > @@ -90,6 +90,7 @@ SUBDIR= ${SUBDIR_BOOTSTRAP} \ > libxo \ > liby \ > libz \ > + libzstd \ > ncurses > > # Inter-library dependencies. When the makefile for a library contains LDADD > > Added: head/lib/libzstd/Makefile > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/lib/libzstd/Makefile Sat Apr 15 20:05:22 2017 (r316978) > @@ -0,0 +1,34 @@ > +# $FreeBSD$ > + > +LIB= zstd > +SRCS= entropy_common.c \ > + error_private.c \ > + fse_decompress.c \ > + pool.c \ > + threading.c \ > + xxhash.c \ > + zstd_common.c \ > + fse_compress.c \ > + huf_compress.c \ > + zstd_compress.c \ > + zstdmt_compress.c \ > + huf_decompress.c \ > + zstd_decompress.c \ > + zbuff_common.c \ > + zbuff_compress.c \ > + zbuff_decompress.c \ > + cover.c \ > + divsufsort.c \ > + zdict.c > +WARNS= 2 > +INCS= zstd.h > +CFLAGS+= -I${ZSTDDIR}/lib -I${ZSTDDIR}/lib/common -DXXH_NAMESPACE=ZSTD_ > + > +PRIVATELIB= yes > + > +ZSTDDIR= ${SRCTOP}/contrib/zstd > +.PATH: ${ZSTDDIR}/lib/common ${ZSTDDIR}/lib/compress \ > + ${ZSTDDIR}/lib/decompress ${ZSTDDIR}/lib/deprecated \ > + ${ZSTDDIR}/lib/dictBuilder ${ZSTDDIR}/lib > + > +.include > > Modified: head/share/mk/src.libnames.mk > ============================================================================== > --- head/share/mk/src.libnames.mk Sat Apr 15 20:03:50 2017 (r316977) > +++ head/share/mk/src.libnames.mk Sat Apr 15 20:05:22 2017 (r316978) > @@ -24,7 +24,8 @@ _PRIVATELIBS= \ > sqlite3 \ > ssh \ > ucl \ > - unbound > + unbound \ > + zstd > > _INTERNALLIBS= \ > amu \ > > Modified: head/usr.bin/Makefile > ============================================================================== > --- head/usr.bin/Makefile Sat Apr 15 20:03:50 2017 (r316977) > +++ head/usr.bin/Makefile Sat Apr 15 20:05:22 2017 (r316978) > @@ -189,7 +189,8 @@ SUBDIR= alias \ > xo \ > xz \ > xzdec \ > - yes > + yes \ > + zstd > > # NB: keep these sorted by MK_* knobs > > > Added: head/usr.bin/zstd/Makefile > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/usr.bin/zstd/Makefile Sat Apr 15 20:05:22 2017 (r316978) > @@ -0,0 +1,21 @@ > +# $FreeBSD$ > + > +PROG= zstd > +SRCS= bench.c \ > + datagen.c \ > + dibio.c \ > + fileio.c \ > + zstdcli.c > + > +CFLAGS+= -I${SRCTOP}/contrib/zstd/programs \ > + -I${SRCTOP}/contrib/zstd/lib/common \ > + -I${SRCTOP}/contrib/zstd/lib/compress \ > + -I${SRCTOP}/contrib/zstd/lib/dictBuilder \ > + -I${SRCTOP}/contrib/zstd/lib \ > + -DXXH_NAMESPACE=ZSTD_ > + > +WARNS= 2 > +LIBADD= zstd > +.PATH: ${SRCTOP}/contrib/zstd/programs > + > +.include >