diff --git a/lib/lz4mt_compress.c b/lib/lz4mt_compress.c index cbd98b1..abf8148 100644 --- a/lib/lz4mt_compress.c +++ b/lib/lz4mt_compress.c @@ -333,7 +333,7 @@ size_t LZ4MT_compressCCtx(LZ4MT_CCtx * ctx, LZ4MT_RdWr_t * rdwr) /* wait for all workers */ for (t = 0; t < ctx->threads; t++) { cwork_t *w = &ctx->cwork[t]; - void *p; + void *p = 0; pthread_join(w->pthread, &p); if (p) retval_of_thread = p; diff --git a/lib/lz4mt_decompress.c b/lib/lz4mt_decompress.c index bd8997c..8540b97 100644 --- a/lib/lz4mt_decompress.c +++ b/lib/lz4mt_decompress.c @@ -542,7 +542,7 @@ size_t LZ4MT_decompressDCtx(LZ4MT_DCtx * ctx, LZ4MT_RdWr_t * rdwr) /* wait for all workers */ for (t = 0; t < ctx->threads; t++) { cwork_t *w = &ctx->cwork[t]; - void *p; + void *p = 0; pthread_join(w->pthread, &p); if (p) retval_of_thread = p; diff --git a/lib/lz5mt_compress.c b/lib/lz5mt_compress.c index 9f96e1a..acbfc6a 100644 --- a/lib/lz5mt_compress.c +++ b/lib/lz5mt_compress.c @@ -333,7 +333,7 @@ size_t LZ5MT_compressCCtx(LZ5MT_CCtx * ctx, LZ5MT_RdWr_t * rdwr) /* wait for all workers */ for (t = 0; t < ctx->threads; t++) { cwork_t *w = &ctx->cwork[t]; - void *p; + void *p = 0; pthread_join(w->pthread, &p); if (p) retval_of_thread = p; diff --git a/lib/lz5mt_decompress.c b/lib/lz5mt_decompress.c index e02c076..8890760 100644 --- a/lib/lz5mt_decompress.c +++ b/lib/lz5mt_decompress.c @@ -542,7 +542,7 @@ size_t LZ5MT_decompressDCtx(LZ5MT_DCtx * ctx, LZ5MT_RdWr_t * rdwr) /* wait for all workers */ for (t = 0; t < ctx->threads; t++) { cwork_t *w = &ctx->cwork[t]; - void *p; + void *p = 0; pthread_join(w->pthread, &p); if (p) retval_of_thread = p; diff --git a/lib/zstdmt_compress.c b/lib/zstdmt_compress.c index eaaf89a..969982d 100644 --- a/lib/zstdmt_compress.c +++ b/lib/zstdmt_compress.c @@ -355,7 +355,7 @@ size_t ZSTDMT_compressCCtx(ZSTDMT_CCtx * ctx, ZSTDMT_RdWr_t * rdwr) /* wait for all workers */ for (t = 0; t < ctx->threads; t++) { cwork_t *w = &ctx->cwork[t]; - void *p; + void *p = 0; pthread_join(w->pthread, &p); if (p) retval_of_thread = p; diff --git a/lib/zstdmt_decompress.c b/lib/zstdmt_decompress.c index 1c7af2e..d588a5b 100644 --- a/lib/zstdmt_decompress.c +++ b/lib/zstdmt_decompress.c @@ -817,7 +817,7 @@ size_t ZSTDMT_decompressDCtx(ZSTDMT_DCtx * ctx, ZSTDMT_RdWr_t * rdwr) /* wait for all workers */ for (t = 0; t < ctx->threads; t++) { cwork_t *w = &ctx->cwork[t]; - void *p; + void *p = 0; pthread_join(w->pthread, &p); if (p) retval_of_thread = p; diff --git a/windows/Makefile b/windows/Makefile index 9e860ed..463faec 100644 --- a/windows/Makefile +++ b/windows/Makefile @@ -1,13 +1,15 @@ CROSS = i686-w64-mingw32- +#CROSS = x86_64-w64-mingw32- CC = $(CROSS)gcc -STRIP = $(CROSS)strip RANLIB = $(CROSS)ranlib -#CC = clang -CFLAGS = -W -pthread -Wall -pipe -CFLAGS = -fomit-frame-pointer +STRIP = $(CROSS)strip +SFLAGS = -R .note -R .comment + LDFLAGS = -lpthread +CFLAGS = -W -pthread -Wall -pipe -flto +CFLAGS += -fomit-frame-pointer #CFLAGS += -DDEBUGME #CFLAGS += -g @@ -17,16 +19,16 @@ CFLAGS += -O3 #CFLAGS += -Wno-unused-variable #CFLAGS += -Wno-unused-function -PRGS = lz4mt lz5mt zstdmt +PRGS = lz4mt.exe lz5mt.exe zstdmt.exe all: loadsource $(PRGS) again: clean $(PRGS) ZSTDMTDIR = ../lib -LIBLZ4 = $(ZSTDMTDIR)/threading.c $(ZSTDMTDIR)/lz4mt_common.c $(ZSTDMTDIR)/lz4mt_compress.c $(ZSTDMTDIR)/lz4mt_decompress.c -LIBLZ5 = $(ZSTDMTDIR)/threading.c $(ZSTDMTDIR)/lz5mt_common.c $(ZSTDMTDIR)/lz5mt_compress.c $(ZSTDMTDIR)/lz5mt_decompress.c -LIBZSTD = $(ZSTDMTDIR)/threading.c $(ZSTDMTDIR)/zstdmt_common.c $(ZSTDMTDIR)/zstdmt_compress.c $(ZSTDMTDIR)/zstdmt_decompress.c +LIBLZ4 = $(ZSTDMTDIR)/threading.c $(ZSTDMTDIR)/lz4mt_common.c $(ZSTDMTDIR)/lz4mt_compress.c $(ZSTDMTDIR)/lz4mt_decompress.c lz4mt.c +LIBLZ5 = $(ZSTDMTDIR)/threading.c $(ZSTDMTDIR)/lz5mt_common.c $(ZSTDMTDIR)/lz5mt_compress.c $(ZSTDMTDIR)/lz5mt_decompress.c lz5mt.c +LIBZSTD = $(ZSTDMTDIR)/threading.c $(ZSTDMTDIR)/zstdmt_common.c $(ZSTDMTDIR)/zstdmt_compress.c $(ZSTDMTDIR)/zstdmt_decompress.c zstdmt.c LZ4DIR = lz4/lib LIBLZ4 += $(LZ4DIR)/lz4.c $(LZ4DIR)/lz4frame.c $(LZ4DIR)/lz4hc.c $(LZ4DIR)/xxhash.c @@ -54,17 +56,17 @@ loadsource: test -d lz5 || git clone https://github.com/inikep/lz5 -b v1.5 --depth=1 lz5 test -d zstd || git clone https://github.com/facebook/zstd -b v1.1.3 --depth=1 zstd -lz4mt: lz4mt.o - $(CC) $(CF_LZ4) $(LDFLAGS) -o $@ $(LIBLZ4) lz4mt.o - $(STRIP) $@ +lz4mt.exe: + $(CC) $(CF_LZ4) $(CDFLAGS) $(LDFLAGS) -o $@ $(LIBLZ4) + $(STRIP) $(SFLAGS) $@ -lz5mt: lz5mt.o - $(CC) $(CF_LZ5) $(LDFLAGS) -o $@ $(LIBLZ5) lz5mt.o - $(STRIP) $@ +lz5mt.exe: + $(CC) $(CF_LZ5) $(CDFLAGS) $(LDFLAGS) -o $@ $(LIBLZ5) + $(STRIP) $(SFLAGS) $@ -zstdmt: zstdmt.o - $(CC) $(CF_ZSTD) $(LDFLAGS) -o $@ $(LIBZSTD) zstdmt.o - $(STRIP) $@ +zstdmt.exe: + $(CC) $(CF_ZSTD) $(CDFLAGS) $(LDFLAGS) -o $@ $(LIBZSTD) + $(STRIP) $(SFLAGS) $@ clean: rm -f $(PRGS) *.o *.a