1
0
mirror of https://github.com/facebook/zstd.git synced 2025-07-30 22:23:13 +03:00

[AIX] Fix Compiler Flags and Bugs on AIX to Pass All Tests (#3219)

* 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
This commit is contained in:
Qiongsi Wu
2022-07-29 15:21:59 -04:00
committed by GitHub
parent ec5fdcde19
commit b1bbb0eb4c
5 changed files with 7 additions and 4 deletions

View File

@ -242,7 +242,7 @@ zstd-pgo :
$(MAKE) zstd MOREFLAGS=-fprofile-use $(MAKE) zstd MOREFLAGS=-fprofile-use
## zstd-small: minimal target, supporting only zstd compression and decompression. no bench. no legacy. no other format. ## 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 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) $(CC) $(FLAGS) -DZSTD_NOBENCH -DZSTD_NODICT -DZSTD_NOTRACE -UZSTD_LEGACY_SUPPORT -DZSTD_LEGACY_SUPPORT=0 $^ -o $@$(EXT)

View File

@ -355,7 +355,7 @@ int DiB_trainFromFiles(const char* dictFileName, size_t maxDictSize,
} }
/* Checks */ /* Checks */
if ((!sampleSizes) || (!srcBuffer) || (!dictBuffer)) if ((fs.nbSamples && !sampleSizes) || (!srcBuffer) || (!dictBuffer))
EXM_THROW(12, "not enough memory for DiB_trainFiles"); /* should not happen */ EXM_THROW(12, "not enough memory for DiB_trainFiles"); /* should not happen */
if (fs.oneSampleTooLarge) { if (fs.oneSampleTooLarge) {
DISPLAYLEVEL(2, "! Warning : some sample(s) are very large \n"); DISPLAYLEVEL(2, "! Warning : some sample(s) are very large \n");

View File

@ -219,7 +219,7 @@ static void ABRThandler(int sig) {
} }
#endif #endif
void FIO_addAbortHandler() void FIO_addAbortHandler(void)
{ {
#if BACKTRACE_ENABLE #if BACKTRACE_ENABLE
signal(SIGABRT, ABRThandler); signal(SIGABRT, ABRThandler);

View File

@ -1378,6 +1378,9 @@ int UTIL_countCores(int logical)
int UTIL_countCores(int logical) int UTIL_countCores(int logical)
{ {
/* suppress unused parameter warning */
(void)logical;
/* assume 1 */ /* assume 1 */
return 1; return 1;
} }

View File

@ -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_corrupt.zst --check --no-check # final flag overrides
zstd -d -f tmp.zst --no-check zstd -d -f tmp.zst --no-check
if [ "$isWindows" = false ]; then if [ "$isWindows" = false ] && [ "$UNAME" != "AIX" ]; then
if [ -n "$(which readelf)" ]; then if [ -n "$(which readelf)" ]; then
println "test: check if binary has executable stack (#2963)" println "test: check if binary has executable stack (#2963)"
readelf -lW "$ZSTD_BIN" | grep 'GNU_STACK .* RW ' || die "zstd binary has executable stack!" readelf -lW "$ZSTD_BIN" | grep 'GNU_STACK .* RW ' || die "zstd binary has executable stack!"