From d3da83172a4757bc3c07b370a521a96f3d237344 Mon Sep 17 00:00:00 2001 From: Qiongsi Wu Date: Thu, 21 Jul 2022 14:34:43 -0400 Subject: [PATCH 1/4] Fixing compiler warnings --- programs/fileio.c | 2 +- programs/util.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/programs/fileio.c b/programs/fileio.c index b8b2818bcd8..a83b8064a9d 100644 --- a/programs/fileio.c +++ b/programs/fileio.c @@ -219,7 +219,7 @@ static void ABRThandler(int sig) { } #endif -void FIO_addAbortHandler() +void FIO_addAbortHandler(void) { #if BACKTRACE_ENABLE signal(SIGABRT, ABRThandler); diff --git a/programs/util.c b/programs/util.c index f53eb03fbec..50db70fd447 100644 --- a/programs/util.c +++ b/programs/util.c @@ -1378,6 +1378,9 @@ int UTIL_countCores(int logical) int UTIL_countCores(int logical) { + /* suppress unused parameter warning */ + (void)logical; + /* assume 1 */ return 1; } From 8d5dfec6f09700b5c1e5f5cf1e4e4b337ade0bd2 Mon Sep 17 00:00:00 2001 From: Qiongsi Wu Date: Thu, 21 Jul 2022 16:11:31 -0400 Subject: [PATCH 2/4] Replace the old -s flag with the -Wl,-s flag --- programs/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/programs/Makefile b/programs/Makefile index 16763e49365..a5f5b45f2ed 100644 --- a/programs/Makefile +++ b/programs/Makefile @@ -242,7 +242,7 @@ zstd-pgo : $(MAKE) zstd MOREFLAGS=-fprofile-use ## zstd-small: minimal target, supporting only zstd compression and decompression. no bench. no legacy. no other format. -zstd-small: CFLAGS = -Os -s +zstd-small: CFLAGS = -Os -Wl,-s zstd-frugal zstd-small: $(ZSTDLIB_CORE_SRC) zstdcli.c util.c timefn.c fileio.c fileio_asyncio.c $(CC) $(FLAGS) -DZSTD_NOBENCH -DZSTD_NODICT -DZSTD_NOTRACE -UZSTD_LEGACY_SUPPORT -DZSTD_LEGACY_SUPPORT=0 $^ -o $@$(EXT) From 2a1262a17c3bd1d6ef01a5607064f1fa9e8f73f1 Mon Sep 17 00:00:00 2001 From: Qiongsi Wu Date: Thu, 21 Jul 2022 14:34:43 -0400 Subject: [PATCH 3/4] Fixing compiler warnings --- programs/fileio.c | 2 +- programs/util.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/programs/fileio.c b/programs/fileio.c index b8b2818bcd8..a83b8064a9d 100644 --- a/programs/fileio.c +++ b/programs/fileio.c @@ -219,7 +219,7 @@ static void ABRThandler(int sig) { } #endif -void FIO_addAbortHandler() +void FIO_addAbortHandler(void) { #if BACKTRACE_ENABLE signal(SIGABRT, ABRThandler); diff --git a/programs/util.c b/programs/util.c index f53eb03fbec..50db70fd447 100644 --- a/programs/util.c +++ b/programs/util.c @@ -1378,6 +1378,9 @@ int UTIL_countCores(int logical) int UTIL_countCores(int logical) { + /* suppress unused parameter warning */ + (void)logical; + /* assume 1 */ return 1; } From 54bcf9d7dfdb91050d8b0ce57e5e9e7caea9b698 Mon Sep 17 00:00:00 2001 From: Qiongsi Wu Date: Fri, 29 Jul 2022 12:59:18 -0400 Subject: [PATCH 4/4] Fixing the linker strip flag and tests/code not working as expected on AIX --- programs/Makefile | 2 +- programs/dibio.c | 2 +- tests/playTests.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/programs/Makefile b/programs/Makefile index 16763e49365..a5f5b45f2ed 100644 --- a/programs/Makefile +++ b/programs/Makefile @@ -242,7 +242,7 @@ zstd-pgo : $(MAKE) zstd MOREFLAGS=-fprofile-use ## zstd-small: minimal target, supporting only zstd compression and decompression. no bench. no legacy. no other format. -zstd-small: CFLAGS = -Os -s +zstd-small: CFLAGS = -Os -Wl,-s zstd-frugal zstd-small: $(ZSTDLIB_CORE_SRC) zstdcli.c util.c timefn.c fileio.c fileio_asyncio.c $(CC) $(FLAGS) -DZSTD_NOBENCH -DZSTD_NODICT -DZSTD_NOTRACE -UZSTD_LEGACY_SUPPORT -DZSTD_LEGACY_SUPPORT=0 $^ -o $@$(EXT) diff --git a/programs/dibio.c b/programs/dibio.c index f6757dd3488..8643bc378f3 100644 --- a/programs/dibio.c +++ b/programs/dibio.c @@ -355,7 +355,7 @@ int DiB_trainFromFiles(const char* dictFileName, size_t maxDictSize, } /* Checks */ - if ((!sampleSizes) || (!srcBuffer) || (!dictBuffer)) + if ((fs.nbSamples && !sampleSizes) || (!srcBuffer) || (!dictBuffer)) EXM_THROW(12, "not enough memory for DiB_trainFiles"); /* should not happen */ if (fs.oneSampleTooLarge) { DISPLAYLEVEL(2, "! Warning : some sample(s) are very large \n"); diff --git a/tests/playTests.sh b/tests/playTests.sh index 50aef5df5a3..0e2b0fbb2bf 100755 --- a/tests/playTests.sh +++ b/tests/playTests.sh @@ -317,7 +317,7 @@ zstd -d -f tmp_corrupt.zst --no-check zstd -d -f tmp_corrupt.zst --check --no-check # final flag overrides zstd -d -f tmp.zst --no-check -if [ "$isWindows" = false ]; then +if [ "$isWindows" = false ] && [ "$UNAME" != "AIX" ]; then if [ -n "$(which readelf)" ]; then println "test: check if binary has executable stack (#2963)" readelf -lW "$ZSTD_BIN" | grep 'GNU_STACK .* RW ' || die "zstd binary has executable stack!"