From fb6fece7704c7747d008c0afbc79d61671dcb1d6 Mon Sep 17 00:00:00 2001 From: Yann Collet Date: Tue, 1 Sep 2015 15:59:24 +0100 Subject: Updated Makefile and .travis --- .travis.yml | 22 +++++++++++----------- Makefile | 49 ++++++++++++++++++------------------------------- NEWS | 6 ++++-- lib/liblz4.pc.in | 2 +- lib/lz4.c | 9 ++++++++- lib/lz4frame.h | 30 +++++++++++++++--------------- programs/Makefile | 12 +++--------- programs/lz4.1 | 4 ++-- 8 files changed, 62 insertions(+), 72 deletions(-) diff --git a/.travis.yml b/.travis.yml index 87cb9a9..9ba2bc2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ language: c compiler: gcc -script: make test-travis +script: make $LZ4_TRAVIS_CI_ENV before_install: - sudo apt-get update -qq - sudo apt-get install -qq gcc-arm-linux-gnueabi @@ -20,16 +20,16 @@ env: - LZ4_TRAVIS_CI_ENV=gpptest - LZ4_TRAVIS_CI_ENV=armtest - LZ4_TRAVIS_CI_ENV=versionsTest - - LZ4_TRAVIS_CI_ENV=test-lz4 - - LZ4_TRAVIS_CI_ENV=test-lz4c - - LZ4_TRAVIS_CI_ENV=test-lz4c32 - - LZ4_TRAVIS_CI_ENV=test-fullbench - - LZ4_TRAVIS_CI_ENV=test-fullbench32 - - LZ4_TRAVIS_CI_ENV=test-fuzzer - - LZ4_TRAVIS_CI_ENV=test-fuzzer32 - - LZ4_TRAVIS_CI_ENV=test-frametest - - LZ4_TRAVIS_CI_ENV=test-frametest32 - - LZ4_TRAVIS_CI_ENV=test-mem + - LZ4_TRAVIS_CI_ENV="-C programs test-lz4" + - LZ4_TRAVIS_CI_ENV="-C programs test-lz4c" + - LZ4_TRAVIS_CI_ENV="-C programs test-lz4c32" + - LZ4_TRAVIS_CI_ENV="-C programs test-fullbench" + - LZ4_TRAVIS_CI_ENV="-C programs test-fullbench32" + - LZ4_TRAVIS_CI_ENV="-C programs test-fuzzer" + - LZ4_TRAVIS_CI_ENV="-C programs test-fuzzer32" + - LZ4_TRAVIS_CI_ENV="-C programs test-frametest" + - LZ4_TRAVIS_CI_ENV="-C programs test-frametest32" + - LZ4_TRAVIS_CI_ENV="-C programs test-mem" matrix: fast_finish: true diff --git a/Makefile b/Makefile index 1f8c941..7def674 100644 --- a/Makefile +++ b/Makefile @@ -43,13 +43,6 @@ PRGDIR = programs LZ4DIR = lib -# Select test target for Travis CI's Build Matrix -ifneq (,$(filter test-%,$(LZ4_TRAVIS_CI_ENV))) -TRAVIS_TARGET=prg-travis -else -TRAVIS_TARGET=$(LZ4_TRAVIS_CI_ENV) -endif - # Define nul output ifneq (,$(filter Windows%,$(OS))) VOID = nul @@ -62,20 +55,19 @@ endif default: lz4programs -all: lib - @cd $(PRGDIR); $(MAKE) all +all: lib lz4programs lib: - @cd $(LZ4DIR); $(MAKE) all + @$(MAKE) -C $(LZ4DIR) all lz4programs: - @cd $(PRGDIR); $(MAKE) + @$(MAKE) -C $(PRGDIR) clean: - @cd $(PRGDIR); $(MAKE) clean > $(VOID) - @cd $(LZ4DIR); $(MAKE) clean > $(VOID) - @cd examples; $(MAKE) clean > $(VOID) - @cd versionsTest; $(MAKE) clean > $(VOID) + @$(MAKE) -C $(PRGDIR) $@ > $(VOID) + @$(MAKE) -C $(LZ4DIR) $@ > $(VOID) + @$(MAKE) -C examples $@ > $(VOID) + @$(MAKE) -C versionsTest $@ > $(VOID) @echo Cleaning completed @@ -84,20 +76,18 @@ clean: ifneq (,$(filter $(shell uname),Linux Darwin GNU/kFreeBSD GNU)) install: - @cd $(LZ4DIR); $(MAKE) install - @cd $(PRGDIR); $(MAKE) install + @$(MAKE) -C $(LZ4DIR) $@ + @$(MAKE) -C $(PRGDIR) $@ uninstall: - @cd $(LZ4DIR); $(MAKE) uninstall - @cd $(PRGDIR); $(MAKE) uninstall + @$(MAKE) -C $(LZ4DIR) $@ + @$(MAKE) -C $(PRGDIR) $@ travis-install: sudo $(MAKE) install test: - @cd $(PRGDIR); $(MAKE) test - -test-travis: $(TRAVIS_TARGET) + $(MAKE) -C $(PRGDIR) test cmake: @cd cmake_unofficial; cmake CMakeLists.txt; $(MAKE) @@ -115,18 +105,15 @@ staticAnalyze: clean CFLAGS=-g scan-build --status-bugs -v $(MAKE) all armtest: clean - cd lib; CFLAGS="-O3 -Werror" $(MAKE) all CC=arm-linux-gnueabi-gcc - cd programs; CFLAGS="-O3 -Werror" $(MAKE) bins CC=arm-linux-gnueabi-gcc + CFLAGS="-O3 -Werror" $(MAKE) -C $(LZ4DIR) all CC=arm-linux-gnueabi-gcc + CFLAGS="-O3 -Werror" $(MAKE) -C $(PRGDIR) bins CC=arm-linux-gnueabi-gcc versionsTest: clean - @cd versionsTest; $(MAKE) + $(MAKE) -C versionsTest examples: - cd lib; $(MAKE) - cd programs; $(MAKE) lz4 - cd examples; $(MAKE) test - -prg-travis: - @cd $(PRGDIR); $(MAKE) test-travis + $(MAKE) -C $(LZ4DIR) + $(MAKE) -C $(PRGDIR) lz4 + $(MAKE) -C examples test endif diff --git a/NEWS b/NEWS index 3e8f68f..a1baead 100644 --- a/NEWS +++ b/NEWS @@ -1,7 +1,9 @@ r132 Improved: Small decompression speed boost (+4%) -Improved: Performance on ARMv6 -Makefile: Generate intermediate object files (*.o) for faster compilation on low power systems +Improved: Performance on ARMv6 and ARMv7 +Added : Debianization, by Evgeniy Polyakov +Makefile: Safely protects lz4 version when selecting custom CFLAGS +Makefile: Generates intermediate object files (*.o) for faster compilation on low power systems r131 New : Dos/DJGPP target, thanks to Louis Santillan (#114) diff --git a/lib/liblz4.pc.in b/lib/liblz4.pc.in index 0d05152..d9393c7 100644 --- a/lib/liblz4.pc.in +++ b/lib/liblz4.pc.in @@ -8,7 +8,7 @@ includedir=@INCLUDEDIR@ Name: lz4 Description: fast lossless compression algorithm library -URL: http://code.google.com/p/lz4/ +URL: http://lz4.org/ Version: @VERSION@ Libs: -L@LIBDIR@ -llz4 Cflags: -I@INCLUDEDIR@ diff --git a/lib/lz4.c b/lib/lz4.c index b2d9293..d23d6b9 100644 --- a/lib/lz4.c +++ b/lib/lz4.c @@ -206,7 +206,7 @@ static void LZ4_write16(void* memPtr, U16 value) memcpy(memPtr, &value, sizeof(value)); } -#endif // LZ4_FORCE_DIRECT_MEMORY_ACCESS +#endif // LZ4_FORCE_MEMORY_ACCESS static U16 LZ4_readLE16(const void* memPtr) @@ -247,6 +247,13 @@ static void LZ4_wildCopy(void* dstPtr, const void* srcPtr, void* dstEnd) BYTE* d = (BYTE*)dstPtr; const BYTE* s = (const BYTE*)srcPtr; BYTE* const e = (BYTE*)dstEnd; + +#if 1 + const size_t l2 = 8 - (((size_t)d) & (sizeof(void*)-1)); + LZ4_copy8(d,s); if (d>e-9) return; + d+=l2; s+=l2; +#endif // join to align + do { LZ4_copy8(d,s); d+=8; s+=8; } while (d tmpSrc @@ -164,7 +160,7 @@ test-lz4-sparse: lz4 datagen ./lz4 tmpSrc | ./lz4 -dv --no-sparse > tmpNoSparse diff -s tmpSrc tmpNoSparse ls -ls tmp* - ./datagen -s1 -g1200007 -P100 | ./lz4 | ./lz4 -dv --sparse > tmpOdd # Odd size file (to not finish on an exact nb of blocks) + ./datagen -s1 -g1200007 -P100 | ./lz4 | ./lz4 -dv --sparse > tmpOdd # Odd size file (to generate non-full last block) ./datagen -s1 -g1200007 -P100 | diff -s - tmpOdd ls -ls tmpOdd @rm tmp* @@ -182,8 +178,6 @@ test-lz4-sparse: lz4 datagen diff tmp2M tmpR @rm tmp* - - test-lz4-contentSize: lz4 datagen @echo "\n ---- test original size support ----" ./datagen -g15M > tmp @@ -306,6 +300,6 @@ test-mem: lz4 datagen fuzzer frametest fullbench valgrind --leak-check=yes --error-exitcode=1 ./frametest -i256 test-mem32: lz4c32 datagen -# unfortunately, valgrind doesn't seem to work with non-native binary. If someone knows how to do a valgrind-test on a 32-bits exe with a 64-bits system... +# unfortunately, valgrind doesn't seem to work with non-native binary... endif diff --git a/programs/lz4.1 b/programs/lz4.1 index 414da48..5c6eb32 100644 --- a/programs/lz4.1 +++ b/programs/lz4.1 @@ -1,6 +1,6 @@ \" \" lz4.1: This is a manual page for 'lz4' program. This file is part of the -\" lz4 project. +\" lz4 project. \" Author: Yann Collet \" @@ -215,7 +215,7 @@ This is default behavior anyway, so this option is just for compatibility with g iteration loops [1-9](default : 3), benchmark mode only .SH BUGS -Report bugs at: https://github.com/Cyan4973/lz4 +Report bugs at: https://github.com/Cyan4973/lz4/issues .SH AUTHOR Yann Collet -- cgit v0.12