From d46ecb58a5d537fad672fdc15b3f91da8e0d17be Mon Sep 17 00:00:00 2001 From: Yann Collet Date: Sat, 17 Dec 2016 16:28:12 +0100 Subject: [PATCH] added dll compilation tests --- .travis.yml | 22 ++++++++++++++++++---- NEWS | 3 +++ lib/dictBuilder/zdict.c | 5 ++--- lib/zstd.h | 2 +- programs/dibio.c | 2 +- tests/.gitignore | 2 ++ tests/Makefile | 27 ++++++++++++++++++++------- 7 files changed, 47 insertions(+), 16 deletions(-) diff --git a/.travis.yml b/.travis.yml index 92c07718..ef1e67e3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -69,7 +69,7 @@ matrix: # Ubuntu 14.04 LTS Server Edition 64 bit - - env: Ubu=14.04 Cmd="make armtest && make clean && make aarch64test" + - env: Ubu=14.04 Cmd="make armtest" dist: trusty sudo: required addons: @@ -78,7 +78,17 @@ matrix: - qemu-system-arm - qemu-user-static - gcc-arm-linux-gnueabi - - libc6-dev-armel-cross + - libc6-dev-armel-cross + + # Ubuntu 14.04 LTS Server Edition 64 bit + - env: Ubu=14.04 Cmd="make aarch64test" + dist: trusty + sudo: required + addons: + apt: + packages: + - qemu-system-arm + - qemu-user-static - gcc-aarch64-linux-gnu - libc6-dev-arm64-cross @@ -91,6 +101,7 @@ matrix: - qemu-system-ppc - qemu-user-static - gcc-powerpc-linux-gnu + - libc6-dev-armel-cross - env: Ubu=14.04 Cmd='make -C lib all && CFLAGS="-O1 -g" make -C zlibWrapper valgrindTest && make -C tests valgrindTest' os: linux @@ -101,7 +112,10 @@ matrix: packages: - valgrind - - env: Ubu=14.04 Cmd="make gpptest && make clean && make gnu90test && make clean && make c99test && make clean && make gnu99test && make clean && make clangtest && make clean && make -C contrib/pzstd googletest32 && make -C contrib/pzstd all32 && make -C contrib/pzstd check && make -C contrib/pzstd clean" + - env: Ubu=14.04 Cmd="make gpptest && make clean && make gnu90test && make clean \ + && make c99test && make clean && make gnu99test && make clean \ + && make clangtest && make clean && make -C contrib/pzstd googletest32 \ + && make -C contrib/pzstd all32 && make -C contrib/pzstd check && make -C contrib/pzstd clean" os: linux dist: trusty sudo: required @@ -127,7 +141,7 @@ matrix: - libc6-dev-i386 - gcc-multilib - - env: Ubu=14.04 Cmd="make gcc5test && make clean && make gcc6test" + - env: Ubu=14.04 Cmd="make gcc5test && make clean && make gcc6test && make clean && make -C tests dll" os: linux dist: trusty sudo: required diff --git a/NEWS b/NEWS index 9b000163..0fc90aff 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,6 @@ +v1.1.3 +API : fix : all symbols properly exposed in libzstd, by Nick Terrell + v1.1.2 API : streaming : decompression : changed : automatic implicit reset when chain-decoding new frames without init API : experimental : added : dictID retrieval functions, and ZSTD_initCStream_srcSize() diff --git a/lib/dictBuilder/zdict.c b/lib/dictBuilder/zdict.c index ea50b54a..b539c09f 100644 --- a/lib/dictBuilder/zdict.c +++ b/lib/dictBuilder/zdict.c @@ -36,12 +36,11 @@ #include /* clock */ #include "mem.h" /* read */ -#include "error_private.h" #include "fse.h" /* FSE_normalizeCount, FSE_writeNCount */ #define HUF_STATIC_LINKING_ONLY -#include "huf.h" +#include "huf.h" /* HUF_buildCTable, HUF_writeCTable */ #include "zstd_internal.h" /* includes zstd.h */ -#include "xxhash.h" +#include "xxhash.h" /* XXH64 */ #include "divsufsort.h" #ifndef ZDICT_STATIC_LINKING_ONLY # define ZDICT_STATIC_LINKING_ONLY diff --git a/lib/zstd.h b/lib/zstd.h index 64e782b5..7eda6987 100644 --- a/lib/zstd.h +++ b/lib/zstd.h @@ -56,7 +56,7 @@ extern "C" { /*------ Version ------*/ #define ZSTD_VERSION_MAJOR 1 #define ZSTD_VERSION_MINOR 1 -#define ZSTD_VERSION_RELEASE 2 +#define ZSTD_VERSION_RELEASE 3 #define ZSTD_LIB_VERSION ZSTD_VERSION_MAJOR.ZSTD_VERSION_MINOR.ZSTD_VERSION_RELEASE #define ZSTD_QUOTE(str) #str diff --git a/programs/dibio.c b/programs/dibio.c index a793669c..6fce405b 100644 --- a/programs/dibio.c +++ b/programs/dibio.c @@ -183,7 +183,7 @@ int DiB_trainFromFiles(const char* dictFileName, unsigned maxDictSize, size_t* const fileSizes = (size_t*)malloc(nbFiles * sizeof(size_t)); unsigned long long const totalSizeToLoad = UTIL_getTotalFileSize(fileNamesTable, nbFiles); size_t const maxMem = DiB_findMaxMem(totalSizeToLoad * MEMMULT) / MEMMULT; - size_t benchedSize = MIN (maxMem, (size_t)totalSizeToLoad); + size_t benchedSize = (size_t) MIN ((unsigned long long)maxMem, totalSizeToLoad); void* const srcBuffer = malloc(benchedSize+NOISELENGTH); int result = 0; diff --git a/tests/.gitignore b/tests/.gitignore index 59a7a1bd..586c17b6 100644 --- a/tests/.gitignore +++ b/tests/.gitignore @@ -3,10 +3,12 @@ fullbench fullbench32 fuzzer fuzzer32 +fuzzer-dll zbufftest zbufftest32 zstreamtest zstreamtest32 +zstreamtest-dll datagen paramgrill paramgrill32 diff --git a/tests/Makefile b/tests/Makefile index b27d1cc6..6e37d160 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -28,12 +28,12 @@ PYTHON ?= python3 TESTARTEFACT := versionsTest namespaceTest -CPPFLAGS= -I$(ZSTDDIR) -I$(ZSTDDIR)/common -I$(ZSTDDIR)/dictBuilder -I$(ZSTDDIR)/deprecated -I$(PRGDIR) -CFLAGS ?= -O3 -CFLAGS += -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow -Wstrict-aliasing=1 \ +CPPFLAGS+= -I$(ZSTDDIR) -I$(ZSTDDIR)/common -I$(ZSTDDIR)/dictBuilder -I$(ZSTDDIR)/deprecated -I$(PRGDIR) +CFLAGS ?= -O3 +CFLAGS += -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow -Wstrict-aliasing=1 \ -Wswitch-enum -Wdeclaration-after-statement -Wstrict-prototypes -Wundef -CFLAGS += $(MOREFLAGS) -FLAGS = $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) +CFLAGS += $(MOREFLAGS) +FLAGS = $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) ZSTDCOMMON_FILES := $(ZSTDDIR)/common/*.c @@ -65,6 +65,8 @@ all: fullbench fuzzer zstreamtest paramgrill datagen zbufftest all32: fullbench32 fuzzer32 zstreamtest32 zbufftest32 +dll: fuzzer-dll zstreamtest-dll + zstd: @@ -93,11 +95,16 @@ fullbench-dll: $(PRGDIR)/datagen.c fullbench.c $(MAKE) -C $(ZSTDDIR) libzstd $(CC) $(FLAGS) $^ -o $@$(EXT) -DZSTD_DLL_IMPORT=1 $(ZSTDDIR)/dll/libzstd.dll -fuzzer : $(ZSTD_FILES) $(ZDICT_FILES) $(PRGDIR)/datagen.c fuzzer.c +fuzzer : $(ZSTD_FILES) $(ZDICT_FILES) $(PRGDIR)/datagen.c fuzzer.c $(CC) $(FLAGS) $^ -o $@$(EXT) fuzzer32 : $(ZSTD_FILES) $(ZDICT_FILES) $(PRGDIR)/datagen.c fuzzer.c - $(CC) -m32 $(FLAGS) $^ -o $@$(EXT) + $(CC) -m32 $(FLAGS) $^ -o $@$(EXT) + +fuzzer-dll : LDFLAGS+= -L$(ZSTDDIR) -lzstd +fuzzer-dll : $(ZSTDDIR)/common/xxhash.c $(PRGDIR)/datagen.c fuzzer.c + $(MAKE) -C $(ZSTDDIR) libzstd + $(CC) $(CPPFLAGS) $(CFLAGS) $^ $(LDFLAGS) -o $@$(EXT) zbufftest : CPPFLAGS += -I$(ZSTDDIR)/deprecated zbufftest : CFLAGS += -Wno-deprecated-declarations # required to silence deprecation warnings @@ -115,6 +122,11 @@ zstreamtest : $(ZSTD_FILES) $(PRGDIR)/datagen.c zstreamtest.c zstreamtest32 : $(ZSTD_FILES) $(PRGDIR)/datagen.c zstreamtest.c $(CC) -m32 $(FLAGS) $^ -o $@$(EXT) +zstreamtest-dll : LDFLAGS+= -L$(ZSTDDIR) -lzstd +zstreamtest-dll : $(ZSTDDIR)/common/xxhash.c $(PRGDIR)/datagen.c zstreamtest.c + $(MAKE) -C $(ZSTDDIR) libzstd + $(CC) $(CPPFLAGS) $(CFLAGS) $^ $(LDFLAGS) -o $@$(EXT) + paramgrill : $(ZSTD_FILES) $(PRGDIR)/datagen.c paramgrill.c $(CC) $(FLAGS) $^ -lm -o $@$(EXT) @@ -151,6 +163,7 @@ clean: fullbench$(EXT) fullbench32$(EXT) \ fullbench-lib$(EXT) fullbench-dll$(EXT) \ fuzzer$(EXT) fuzzer32$(EXT) zbufftest$(EXT) zbufftest32$(EXT) \ + fuzzer-dll$(EXT) zstreamtest-dll$(EXT) \ zstreamtest$(EXT) zstreamtest32$(EXT) \ datagen$(EXT) paramgrill$(EXT) roundTripCrash$(EXT) longmatch$(EXT) \ symbols$(EXT)