Compare commits
No commits in common. 'c9' and 'c10-beta' have entirely different histories.
@ -1 +1 @@
|
|||||||
SOURCES/pigz-2.5.tar.gz
|
SOURCES/pigz-2.8.tar.gz
|
||||||
|
@ -1 +1 @@
|
|||||||
82eef9525c2b4f4b1881d824a6cf621c74214cd0 SOURCES/pigz-2.5.tar.gz
|
567c47a1f63e64abb2498bf42877e0c8c272d29b SOURCES/pigz-2.8.tar.gz
|
||||||
|
@ -0,0 +1,25 @@
|
|||||||
|
From 32f59866bffcbfcfc44c22c613c0019a2e5d32f2 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Tony Camuso <tcamuso@redhat.com>
|
||||||
|
Date: Mon, 22 Jul 2024 11:54:28 -0400
|
||||||
|
Subject: [PATCH v0] Makefile: accept LDFLAGS from env if defined
|
||||||
|
|
||||||
|
Signed-off-by: Tony Camuso <tcamuso@redhat.com>
|
||||||
|
---
|
||||||
|
Makefile | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/Makefile b/Makefile
|
||||||
|
index b1866cf..b2b279c 100644
|
||||||
|
--- a/Makefile
|
||||||
|
+++ b/Makefile
|
||||||
|
@@ -1,6 +1,6 @@
|
||||||
|
CC=gcc
|
||||||
|
CFLAGS=-O3 -Wall -Wextra -Wno-unknown-pragmas -Wcast-qual
|
||||||
|
-LDFLAGS=
|
||||||
|
+LDFLAGS ?=
|
||||||
|
# CFLAGS=-O3 -Wall -Wextra -Wno-unknown-pragmas -Wcast-qual -g -fsanitize=thread
|
||||||
|
# LDFLAGS=-g -fsanitize=thread
|
||||||
|
# CFLAGS=-O3 -Wall -Wextra -Wno-unknown-pragmas -Wcast-qual -g -fsanitize=address
|
||||||
|
--
|
||||||
|
2.45.2
|
||||||
|
|
@ -1,276 +0,0 @@
|
|||||||
From c9de6c53dcf3eb1071c7999c8accc43ef2b3f458 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Mark Adler <madler@alumni.caltech.edu>
|
|
||||||
Date: Sun, 24 Jan 2021 22:00:00 -0800
|
|
||||||
Subject: [PATCH] Portability improvements.
|
|
||||||
|
|
||||||
Avoid many bogus warnings across versions of gcc. Work around
|
|
||||||
missing definitions on some systems. Fix some printf format types.
|
|
||||||
---
|
|
||||||
pigz.c | 77 ++++++++++++++++++++-----------------
|
|
||||||
try.h | 6 +--
|
|
||||||
zopfli/src/zopfli/cache.c | 2 +-
|
|
||||||
zopfli/src/zopfli/deflate.c | 13 ++++---
|
|
||||||
4 files changed, 53 insertions(+), 45 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/pigz.c b/pigz.c
|
|
||||||
index 7430e1e..6ec3a82 100644
|
|
||||||
--- a/pigz.c
|
|
||||||
+++ b/pigz.c
|
|
||||||
@@ -333,7 +333,7 @@
|
|
||||||
// Portability defines.
|
|
||||||
#define _FILE_OFFSET_BITS 64 // Use large file functions
|
|
||||||
#define _LARGE_FILES // Same thing for AIX
|
|
||||||
-#define _POSIX_C_SOURCE 200809L // For MinGW
|
|
||||||
+#define _XOPEN_SOURCE 700 // For POSIX 2008
|
|
||||||
|
|
||||||
// Included headers and what is expected from each.
|
|
||||||
#include <stdio.h> // fflush(), fprintf(), fputs(), getchar(), putc(),
|
|
||||||
@@ -874,10 +874,10 @@ local void log_dump(void) {
|
|
||||||
;
|
|
||||||
log_free();
|
|
||||||
if (mem_track.num || mem_track.size)
|
|
||||||
- complain("memory leak: %lu allocs of %lu bytes total",
|
|
||||||
+ complain("memory leak: %zu allocs of %zu bytes total",
|
|
||||||
mem_track.num, mem_track.size);
|
|
||||||
if (mem_track.max)
|
|
||||||
- fprintf(stderr, "%lu bytes of memory used in %lu allocs\n",
|
|
||||||
+ fprintf(stderr, "%zu bytes of memory used in %zu allocs\n",
|
|
||||||
mem_track.max, mem_track.tot);
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -993,7 +993,7 @@ local size_t writen(int desc, void const *buf, size_t len) {
|
|
||||||
size_t left = len;
|
|
||||||
|
|
||||||
while (left) {
|
|
||||||
- size_t const max = SIZE_MAX >> 1; // max ssize_t
|
|
||||||
+ size_t const max = SSIZE_MAX;
|
|
||||||
ssize_t ret = write(desc, next, left > max ? max : left);
|
|
||||||
if (ret < 1)
|
|
||||||
throw(errno, "write error on %s (%s)", g.outf, strerror(errno));
|
|
||||||
@@ -1668,26 +1668,32 @@ local void compress_thread(void *dummy) {
|
|
||||||
size_t len; // remaining bytes to compress/check
|
|
||||||
#if ZLIB_VERNUM >= 0x1260
|
|
||||||
int bits; // deflate pending bits
|
|
||||||
-#endif
|
|
||||||
-#ifndef NOZOPFLI
|
|
||||||
- struct space *temp = NULL; // temporary space for zopfli input
|
|
||||||
#endif
|
|
||||||
int ret; // zlib return code
|
|
||||||
- z_stream strm; // deflate stream
|
|
||||||
ball_t err; // error information from throw()
|
|
||||||
|
|
||||||
(void)dummy;
|
|
||||||
|
|
||||||
try {
|
|
||||||
- // initialize the deflate stream for this thread
|
|
||||||
- strm.zfree = ZFREE;
|
|
||||||
- strm.zalloc = ZALLOC;
|
|
||||||
- strm.opaque = OPAQUE;
|
|
||||||
- ret = deflateInit2(&strm, 6, Z_DEFLATED, -15, 8, Z_DEFAULT_STRATEGY);
|
|
||||||
- if (ret == Z_MEM_ERROR)
|
|
||||||
- throw(ENOMEM, "not enough memory");
|
|
||||||
- if (ret != Z_OK)
|
|
||||||
- throw(EINVAL, "internal error");
|
|
||||||
+ z_stream strm; // deflate stream
|
|
||||||
+#ifndef NOZOPFLI
|
|
||||||
+ struct space *temp = NULL;
|
|
||||||
+ // get temporary space for zopfli input
|
|
||||||
+ if (g.level > 9)
|
|
||||||
+ temp = get_space(&out_pool);
|
|
||||||
+ else
|
|
||||||
+#endif
|
|
||||||
+ {
|
|
||||||
+ // initialize the deflate stream for this thread
|
|
||||||
+ strm.zfree = ZFREE;
|
|
||||||
+ strm.zalloc = ZALLOC;
|
|
||||||
+ strm.opaque = OPAQUE;
|
|
||||||
+ ret = deflateInit2(&strm, 6, Z_DEFLATED, -15, 8, Z_DEFAULT_STRATEGY);
|
|
||||||
+ if (ret == Z_MEM_ERROR)
|
|
||||||
+ throw(ENOMEM, "not enough memory");
|
|
||||||
+ if (ret != Z_OK)
|
|
||||||
+ throw(EINVAL, "internal error");
|
|
||||||
+ }
|
|
||||||
|
|
||||||
// keep looking for work
|
|
||||||
for (;;) {
|
|
||||||
@@ -1714,11 +1720,8 @@ local void compress_thread(void *dummy) {
|
|
||||||
(void)deflateParams(&strm, g.level, Z_DEFAULT_STRATEGY);
|
|
||||||
#ifndef NOZOPFLI
|
|
||||||
}
|
|
||||||
- else {
|
|
||||||
- if (temp == NULL)
|
|
||||||
- temp = get_space(&out_pool);
|
|
||||||
+ else
|
|
||||||
temp->len = 0;
|
|
||||||
- }
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// set dictionary if provided, release that input or dictionary
|
|
||||||
@@ -1912,11 +1915,15 @@ local void compress_thread(void *dummy) {
|
|
||||||
}
|
|
||||||
|
|
||||||
// found job with seq == -1 -- return to join
|
|
||||||
+ release(compress_have);
|
|
||||||
#ifndef NOZOPFLI
|
|
||||||
- drop_space(temp);
|
|
||||||
+ if (g.level > 9)
|
|
||||||
+ drop_space(temp);
|
|
||||||
+ else
|
|
||||||
#endif
|
|
||||||
- release(compress_have);
|
|
||||||
- (void)deflateEnd(&strm);
|
|
||||||
+ {
|
|
||||||
+ (void)deflateEnd(&strm);
|
|
||||||
+ }
|
|
||||||
}
|
|
||||||
catch (err) {
|
|
||||||
THREADABORT(err);
|
|
||||||
@@ -3078,7 +3085,7 @@ local void show_info(int method, unsigned long check, length_t len, int cont) {
|
|
||||||
strncpy(tag, "<...>", max + 1);
|
|
||||||
else if (g.hname == NULL) {
|
|
||||||
n = strlen(g.inf) - compressed_suffix(g.inf);
|
|
||||||
- strncpy(tag, g.inf, n > max + 1 ? max + 1 : n);
|
|
||||||
+ memcpy(tag, g.inf, n > max + 1 ? max + 1 : n);
|
|
||||||
if (strcmp(g.inf + n, ".tgz") == 0 && n < max + 1)
|
|
||||||
strncpy(tag + n, ".tar", max + 1 - n);
|
|
||||||
}
|
|
||||||
@@ -3802,37 +3809,33 @@ local char *justname(char *path) {
|
|
||||||
return p == NULL ? path : p + 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
-#pragma GCC diagnostic push
|
|
||||||
-#pragma GCC diagnostic ignored "-Wunused-result"
|
|
||||||
-
|
|
||||||
// Copy file attributes, from -> to, as best we can. This is best effort, so no
|
|
||||||
// errors are reported. The mode bits, including suid, sgid, and the sticky bit
|
|
||||||
// are copied (if allowed), the owner's user id and group id are copied (again
|
|
||||||
// if allowed), and the access and modify times are copied.
|
|
||||||
-local void copymeta(char *from, char *to) {
|
|
||||||
+local int copymeta(char *from, char *to) {
|
|
||||||
struct stat st;
|
|
||||||
struct timeval times[2];
|
|
||||||
|
|
||||||
// get all of from's Unix meta data, return if not a regular file
|
|
||||||
if (stat(from, &st) != 0 || (st.st_mode & S_IFMT) != S_IFREG)
|
|
||||||
- return;
|
|
||||||
+ return -4;
|
|
||||||
|
|
||||||
// set to's mode bits, ignore errors
|
|
||||||
- (void)chmod(to, st.st_mode & 07777);
|
|
||||||
+ int ret = chmod(to, st.st_mode & 07777);
|
|
||||||
|
|
||||||
// copy owner's user and group, ignore errors
|
|
||||||
- (void)chown(to, st.st_uid, st.st_gid);
|
|
||||||
+ ret += chown(to, st.st_uid, st.st_gid);
|
|
||||||
|
|
||||||
// copy access and modify times, ignore errors
|
|
||||||
times[0].tv_sec = st.st_atime;
|
|
||||||
times[0].tv_usec = 0;
|
|
||||||
times[1].tv_sec = st.st_mtime;
|
|
||||||
times[1].tv_usec = 0;
|
|
||||||
- (void)utimes(to, times);
|
|
||||||
+ ret += utimes(to, times);
|
|
||||||
+ return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
-#pragma GCC diagnostic pop
|
|
||||||
-
|
|
||||||
// Set the access and modify times of fd to t.
|
|
||||||
local void touch(char *path, time_t t) {
|
|
||||||
struct timeval times[2];
|
|
||||||
@@ -4430,6 +4433,7 @@ local int option(char *arg) {
|
|
||||||
puts("Subject to the terms of the zlib license.");
|
|
||||||
puts("No warranty is provided or implied.");
|
|
||||||
exit(0);
|
|
||||||
+ break; // avoid warning
|
|
||||||
case 'M': g.headis |= 0xa; break;
|
|
||||||
case 'N': g.headis = 0xf; break;
|
|
||||||
#ifndef NOZOPFLI
|
|
||||||
@@ -4443,13 +4447,16 @@ local int option(char *arg) {
|
|
||||||
if (g.verbosity > 1)
|
|
||||||
printf("zlib %s\n", zlibVersion());
|
|
||||||
exit(0);
|
|
||||||
+ break; // avoid warning
|
|
||||||
case 'Y': g.sync = 1; break;
|
|
||||||
case 'Z':
|
|
||||||
throw(EINVAL, "invalid option: LZW output not supported: %s",
|
|
||||||
bad);
|
|
||||||
+ break; // avoid warning
|
|
||||||
case 'a':
|
|
||||||
throw(EINVAL, "invalid option: no ascii conversion: %s",
|
|
||||||
bad);
|
|
||||||
+ break; // avoid warning
|
|
||||||
case 'b': get = 1; break;
|
|
||||||
case 'c': g.pipeout = 1; break;
|
|
||||||
case 'd': if (!g.decode) g.headis >>= 2; g.decode = 1; break;
|
|
||||||
diff --git a/try.h b/try.h
|
|
||||||
index 03289dd..3009f7d 100644
|
|
||||||
--- a/try.h
|
|
||||||
+++ b/try.h
|
|
||||||
@@ -304,8 +304,8 @@ struct try_s_ {
|
|
||||||
# define try_stack_ ((try_t_ *)pthread_getspecific(try_key_))
|
|
||||||
# define try_stack_set_(next) \
|
|
||||||
do { \
|
|
||||||
- int try_ret_ = pthread_setspecific(try_key_, next); \
|
|
||||||
- assert(try_ret_ == 0 && "try: pthread_setspecific() failed"); \
|
|
||||||
+ assert(pthread_setspecific(try_key_, next) == 0 && \
|
|
||||||
+ "try: pthread_setspecific() failed"); \
|
|
||||||
} while (0)
|
|
||||||
#else /* !PTHREAD_ONCE_INIT */
|
|
||||||
extern try_t_ *try_stack_;
|
|
||||||
@@ -320,7 +320,7 @@ struct try_s_ {
|
|
||||||
#define TRY_TRY_ \
|
|
||||||
do { \
|
|
||||||
try_t_ try_this_; \
|
|
||||||
- int try_pushed_ = 1; \
|
|
||||||
+ volatile int try_pushed_ = 1; \
|
|
||||||
try_this_.ball.code = 0; \
|
|
||||||
try_this_.ball.free = 0; \
|
|
||||||
try_this_.ball.why = NULL; \
|
|
||||||
diff --git a/zopfli/src/zopfli/cache.c b/zopfli/src/zopfli/cache.c
|
|
||||||
index f5559c3..e5934df 100644
|
|
||||||
--- a/zopfli/src/zopfli/cache.c
|
|
||||||
+++ b/zopfli/src/zopfli/cache.c
|
|
||||||
@@ -33,7 +33,7 @@ void ZopfliInitCache(size_t blocksize, ZopfliLongestMatchCache* lmc) {
|
|
||||||
lmc->sublen = (unsigned char*)malloc(ZOPFLI_CACHE_LENGTH * 3 * blocksize);
|
|
||||||
if(lmc->sublen == NULL) {
|
|
||||||
fprintf(stderr,
|
|
||||||
- "Error: Out of memory. Tried allocating %lu bytes of memory.\n",
|
|
||||||
+ "Error: Out of memory. Tried allocating %zu bytes of memory.\n",
|
|
||||||
ZOPFLI_CACHE_LENGTH * 3 * blocksize);
|
|
||||||
exit (EXIT_FAILURE);
|
|
||||||
}
|
|
||||||
diff --git a/zopfli/src/zopfli/deflate.c b/zopfli/src/zopfli/deflate.c
|
|
||||||
index abe7360..f7b62e4 100644
|
|
||||||
--- a/zopfli/src/zopfli/deflate.c
|
|
||||||
+++ b/zopfli/src/zopfli/deflate.c
|
|
||||||
@@ -431,22 +431,23 @@ Changes the population counts in a way that the consequent Huffman tree
|
|
||||||
compression, especially its rle-part, will be more likely to compress this data
|
|
||||||
more efficiently. length contains the size of the histogram.
|
|
||||||
*/
|
|
||||||
-void OptimizeHuffmanForRle(int length, size_t* counts) {
|
|
||||||
- int i, k, stride;
|
|
||||||
+void OptimizeHuffmanForRle(unsigned length, size_t* counts) {
|
|
||||||
+ unsigned i;
|
|
||||||
+ int k, stride;
|
|
||||||
size_t symbol, sum, limit;
|
|
||||||
int* good_for_rle;
|
|
||||||
|
|
||||||
/* 1) We don't want to touch the trailing zeros. We may break the
|
|
||||||
rules of the format by adding more data in the distance codes. */
|
|
||||||
- for (; length >= 0; --length) {
|
|
||||||
- if (length == 0) {
|
|
||||||
- return;
|
|
||||||
- }
|
|
||||||
+ for (; length > 0; --length) {
|
|
||||||
if (counts[length - 1] != 0) {
|
|
||||||
/* Now counts[0..length - 1] does not have trailing zeros. */
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+ if (length == 0) {
|
|
||||||
+ return;
|
|
||||||
+ }
|
|
||||||
/* 2) Let's mark all population counts that already can be encoded
|
|
||||||
with an rle code.*/
|
|
||||||
good_for_rle = (int*)malloc(length * sizeof(int));
|
|
@ -1,49 +0,0 @@
|
|||||||
From f310c0868634a1dbacdcdcb2dbce9501a8a87868 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Mark Adler <madler@alumni.caltech.edu>
|
|
||||||
Date: Sun, 24 Jan 2021 21:39:26 -0800
|
|
||||||
Subject: [PATCH] Fix usage of x2nmodp() when compiling for no threads.
|
|
||||||
|
|
||||||
---
|
|
||||||
pigz.c | 8 ++++++--
|
|
||||||
1 file changed, 6 insertions(+), 2 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/pigz.c b/pigz.c
|
|
||||||
index e5a094a..7430e1e 100644
|
|
||||||
--- a/pigz.c
|
|
||||||
+++ b/pigz.c
|
|
||||||
@@ -545,7 +545,9 @@ local struct {
|
|
||||||
int procs; // maximum number of compression threads (>= 1)
|
|
||||||
int setdict; // true to initialize dictionary in each thread
|
|
||||||
size_t block; // uncompressed input size per thread (>= 32K)
|
|
||||||
+#ifndef NOTHREAD
|
|
||||||
crc_t shift; // pre-calculated CRC-32 shift for length block
|
|
||||||
+#endif
|
|
||||||
|
|
||||||
// saved gzip/zip header data for decompression, testing, and listing
|
|
||||||
time_t stamp; // time stamp from gzip header
|
|
||||||
@@ -4286,13 +4288,13 @@ local void defaults(void) {
|
|
||||||
// blocksplittingmax = 15
|
|
||||||
ZopfliInitOptions(&g.zopts);
|
|
||||||
#endif
|
|
||||||
+ g.block = 131072UL; // 128K
|
|
||||||
#ifdef NOTHREAD
|
|
||||||
g.procs = 1;
|
|
||||||
#else
|
|
||||||
g.procs = nprocs(8);
|
|
||||||
-#endif
|
|
||||||
- g.block = 131072UL; // 128K
|
|
||||||
g.shift = x2nmodp(g.block, 3);
|
|
||||||
+#endif
|
|
||||||
g.rsync = 0; // don't do rsync blocking
|
|
||||||
g.setdict = 1; // initialize dictionary each thread
|
|
||||||
g.verbosity = 1; // normal message level
|
|
||||||
@@ -4480,7 +4482,9 @@ local int option(char *arg) {
|
|
||||||
if (get == 1) {
|
|
||||||
n = num(arg);
|
|
||||||
g.block = n << 10; // chunk size
|
|
||||||
+#ifndef NOTHREAD
|
|
||||||
g.shift = x2nmodp(g.block, 3);
|
|
||||||
+#endif
|
|
||||||
if (g.block < DICT)
|
|
||||||
throw(EINVAL, "block size too small (must be >= 32K)");
|
|
||||||
if (n != g.block >> 10 ||
|
|
Loading…
Reference in new issue