]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
[AIX] Fix Compiler Flags and Bugs on AIX to Pass All Tests (#3219)
authorQiongsi Wu <274595+qiongsiwu@users.noreply.github.com>
Fri, 29 Jul 2022 19:21:59 +0000 (15:21 -0400)
committerGitHub <noreply@github.com>
Fri, 29 Jul 2022 19:21:59 +0000 (12:21 -0700)
* Fixing compiler warnings

* Replace the old -s flag with the -Wl,-s flag

* Fixing compiler warnings

* Fixing the linker strip flag and tests/code not working as expected on AIX

programs/Makefile
programs/dibio.c
programs/fileio.c
programs/util.c
tests/playTests.sh

index 16763e493656db13bb38fd999bc73bb327958765..a5f5b45f2ed988be6c89a9bb6a7edb81bda4c512 100644 (file)
@@ -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)
 
index f6757dd34880fa943cf99a7f6d4aa7364b44a872..8643bc378f36b592b8d7d84fa5c249ab493b77a3 100644 (file)
@@ -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");
index b8b2818bcd83e08839235084b7c1e8dc6a3959d8..a83b8064a9d3f563c19dc0c0d2833182ee4a6fc4 100644 (file)
@@ -219,7 +219,7 @@ static void ABRThandler(int sig) {
 }
 #endif
 
-void FIO_addAbortHandler()
+void FIO_addAbortHandler(void)
 {
 #if BACKTRACE_ENABLE
     signal(SIGABRT, ABRThandler);
index f53eb03fbec260da6cd3a044a6e1ef167813b40b..50db70fd447bf9e0f6f8360971169c86a9953f8c 100644 (file)
@@ -1378,6 +1378,9 @@ int UTIL_countCores(int logical)
 
 int UTIL_countCores(int logical)
 {
+    /* suppress unused parameter warning */
+    (void)logical;
+
     /* assume 1 */
     return 1;
 }
index 50aef5df5a3c6f398abedecbe997943a1d142287..0e2b0fbb2bfa140db8b3ffd7f7710be2cdd4ec31 100755 (executable)
@@ -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!"