Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
pax_global_header
v1.5.2
zstd-1.5.2/
zstd*/
log/
install
log.STABLE
20 changes: 11 additions & 9 deletions buildenv
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
# bump: zstd-version /ZSTD_VERSION=(.*)/ https://github.com/facebook/zstd.git|semver:^1
ZSTD_VERSION=1.5.5
ZSTD_VERSION=1.5.7

export ZOPEN_BUILD_LINE="STABLE"
export ZOPEN_CATEGORIES="compression"
export ZOPEN_STABLE_URL="https://github.com/facebook/zstd/archive/refs/tags/v${ZSTD_VERSION}.tar.gz"
export ZOPEN_STABLE_DEPS="curl gzip make coreutils zoslib check_python"
export ZOPEN_STABLE_URL="https://github.com/facebook/zstd.git"
export ZOPEN_STABLE_TAG="v${ZSTD_VERSION}"
export ZOPEN_STABLE_DEPS="make coreutils check_python diffutils which"
Copy link
Copy Markdown

@augmentcode augmentcode Bot May 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

buildenv:8 ZOPEN_STABLE_URL is now a git repo, but ZOPEN_STABLE_DEPS no longer includes any tool that guarantees git is available; this may cause source-fetch failures in minimal build environments.

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

export ZOPEN_BOOTSTRAP=skip
export ZOPEN_CONFIGURE=skip
export ZSTD_NO_ASM=1
export MT=1
export ZOPEN_COMP=CLANG
export ZOPEN_MAKE_OPTS="prefix=\${ZOPEN_INSTALL_DIR}"
export ZOPEN_MAKE_OPTS="prefix=\${ZOPEN_INSTALL_DIR} lib-mt"
export ZOPEN_CHECK_OPTS="-i check"
export ZOPEN_INSTALL_OPTS="install POSIX_ENV=Yes prefix=\${ZOPEN_INSTALL_DIR}"
export ZOPEN_CONFIGURE_MINIMAL="yes"
export ZOPEN_MAKE_MINIMAL="yes"
export USE_CLANG_WRAPPER=1

#
# Starter for Python
Expand All @@ -21,10 +26,6 @@ if ! type python3 >/dev/null ; then
return 4
fi

export ZOPEN_NAME="zstd-${ZSTD_VERSION}"
rm -f "v${ZSTD_VERSION}"
ln -s ${ZOPEN_NAME} "v${ZSTD_VERSION}"

zopen_append_to_env()
{
cat <<ZZ
Expand All @@ -48,5 +49,6 @@ ZZ

zopen_get_version()
{
./zstd --version | head -1 | awk '{print $5; }' | tr -d ',v'
echo $ZSTD_VERSION
Copy link
Copy Markdown

@augmentcode augmentcode Bot May 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

buildenv:52 zopen_get_version() now returns the configured $ZSTD_VERSION instead of querying the built ./zstd, which can hide version/build mismatches (e.g., if the checked-out tag differs from what was built/installed).

Severity: low

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

#./zstd --version | head -1 | awk '{print $5; }' | tr -d ',v'
}
40 changes: 12 additions & 28 deletions patches/Makefile.patch
Original file line number Diff line number Diff line change
@@ -1,29 +1,13 @@
diff --git a/programs/Makefile b/programs/Makefile
index f77e1b7..d06f6d8 100644
--- a/programs/Makefile
+++ b/programs/Makefile
@@ -335,7 +335,7 @@ include $(wildcard $(DEPFILES))
#-----------------------------------------------------------------------------
# make install is validated only for Linux, macOS, BSD, Hurd and Solaris targets
#-----------------------------------------------------------------------------
-ifneq (,$(filter $(UNAME),Linux Darwin GNU/kFreeBSD GNU OpenBSD FreeBSD NetBSD DragonFly SunOS Haiku AIX))
+ifneq (,$(filter $(UNAME),Linux Darwin GNU/kFreeBSD GNU OpenBSD FreeBSD NetBSD DragonFly SunOS Haiku AIX OS/390))
diff --git a/Makefile b/Makefile
index e8e6bcf..7221ef4 100644
--- a/Makefile
+++ b/Makefile
@@ -147,7 +147,7 @@ clean:
#------------------------------------------------------------------------------
# make install is validated only for Linux, macOS, Hurd and some BSD targets
#------------------------------------------------------------------------------
-ifneq (,$(filter Linux Darwin GNU/kFreeBSD GNU OpenBSD FreeBSD DragonFly NetBSD MSYS_NT% CYGWIN_NT% Haiku AIX,$(shell sh -c 'MSYSTEM="MSYS" uname') ))
+ifneq (,$(filter Linux Darwin GNU/kFreeBSD GNU OpenBSD FreeBSD DragonFly NetBSD MSYS_NT% CYGWIN_NT% Haiku AIX OS/390,$(shell sh -c 'MSYSTEM="MSYS" uname') ))

HOST_OS = POSIX

HAVE_COLORNEVER = $(shell echo a | egrep --color=never a > /dev/null 2> /dev/null && echo 1 || echo 0)
EGREP_OPTIONS ?=
@@ -404,15 +404,10 @@ install:
[ -e $(DESTDIR)$(MAN1DIR) ] || $(INSTALL) -d -m 755 $(DESTDIR)$(MAN1DIR)/
@echo Installing binaries
$(INSTALL_PROGRAM) zstd$(EXT) $(DESTDIR)$(BINDIR)/zstd$(EXT)
- ln -sf zstd$(EXT) $(DESTDIR)$(BINDIR)/zstdcat$(EXT)
- ln -sf zstd$(EXT) $(DESTDIR)$(BINDIR)/unzstd$(EXT)
- ln -sf zstd$(EXT) $(DESTDIR)$(BINDIR)/zstdmt$(EXT)
$(INSTALL_SCRIPT) zstdless $(DESTDIR)$(BINDIR)/zstdless
$(INSTALL_SCRIPT) zstdgrep $(DESTDIR)$(BINDIR)/zstdgrep
@echo Installing man pages
$(INSTALL_MAN) zstd.1 $(DESTDIR)$(MAN1DIR)/zstd.1
- ln -sf zstd.1 $(DESTDIR)$(MAN1DIR)/zstdcat.1
- ln -sf zstd.1 $(DESTDIR)$(MAN1DIR)/unzstd.1
$(INSTALL_MAN) zstdgrep.1 $(DESTDIR)$(MAN1DIR)/zstdgrep.1
$(INSTALL_MAN) zstdless.1 $(DESTDIR)$(MAN1DIR)/zstdless.1
@echo zstd installation completed
44 changes: 0 additions & 44 deletions patches/PR1/addzostomakefile.patch

This file was deleted.

87 changes: 87 additions & 0 deletions patches/lib.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
diff --git a/lib/Makefile b/lib/Makefile
index a6a0eb0..c3fb5fd 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -83,12 +83,19 @@ ifeq ($(UNAME_TARGET_SYSTEM), Darwin)
else
ifeq ($(UNAME_TARGET_SYSTEM), AIX)
SONAME_FLAGS =
+ else ifeq ($(UNAME_TARGET_SYSTEM), OS/390)
+ SONAME_FLAGS =
else
SONAME_FLAGS = -Wl,-soname=libzstd.$(SHARED_EXT).$(LIBVER_MAJOR)
endif
SHARED_EXT = so
- SHARED_EXT_MAJOR = $(SHARED_EXT).$(LIBVER_MAJOR)
- SHARED_EXT_VER = $(SHARED_EXT).$(LIBVER)
+ ifeq ($(UNAME_TARGET_SYSTEM), OS/390)
+ SHARED_EXT_MAJOR = $(SHARED_EXT)
+ SHARED_EXT_VER = $(SHARED_EXT)
+ else
+ SHARED_EXT_MAJOR = $(SHARED_EXT).$(LIBVER_MAJOR)
+ SHARED_EXT_VER = $(SHARED_EXT).$(LIBVER)
+ endif
endif


@@ -145,6 +152,9 @@ LIBZSTD = libzstd.$(SHARED_EXT_VER)
.PHONY: $(LIBZSTD) # must be run every time
$(LIBZSTD): CPPFLAGS += $(CPPFLAGS_DYNLIB)
$(LIBZSTD): CFLAGS += -fPIC -fvisibility=hidden
+ifeq ($(UNAME_TARGET_SYSTEM), OS/390)
+$(LIBZSTD): CFLAGS += -shared
Copy link
Copy Markdown

@augmentcode augmentcode Bot May 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

patches/lib.patch:32 Adding -shared to CFLAGS means it may be used during compilation steps as well as linking; if the toolchain treats -shared as link-only, this can fail or produce unexpected build behavior.

Severity: medium

Other Locations
  • patches/lib.patch:60

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

+endif
$(LIBZSTD): LDFLAGS += -shared $(LDFLAGS_DYNLIB)

ifndef BUILD_DIR
@@ -167,12 +177,17 @@ $(ZSTD_DYNLIB): $(ZSTD_DYNLIB_OBJ)
@echo compiling multi-threaded dynamic library $(LIBVER),\
@echo compiling single-threaded dynamic library $(LIBVER))
$(CC) $(FLAGS) $^ $(LDFLAGS) $(SONAME_FLAGS) -o $@
+ifneq ($(UNAME_TARGET_SYSTEM), OS/390)
@echo creating versioned links
ln -sf $@ libzstd.$(SHARED_EXT_MAJOR)
ln -sf $@ libzstd.$(SHARED_EXT)
+endif

$(LIBZSTD): $(ZSTD_DYNLIB)
cp -f $< $@
+ifeq ($(UNAME_TARGET_SYSTEM), OS/390)
+ [ ! -f $(dir $<)libzstd.x ] || cp -f $(dir $<)libzstd.x libzstd.x
+endif

endif # ifndef BUILD_DIR
endif # if windows
@@ -247,6 +262,9 @@ $(DEPFILES):
ZSTDMT_FILES = zstdmt_compress.c
ZSTD_NOMT_FILES = $(filter-out $(ZSTDMT_FILES),$(notdir $(ZSTD_FILES)))
libzstd-nomt: CFLAGS += -fPIC -fvisibility=hidden
+ifeq ($(UNAME_TARGET_SYSTEM), OS/390)
+libzstd-nomt: CFLAGS += -shared
+endif
libzstd-nomt: LDFLAGS += -shared
libzstd-nomt: $(ZSTD_NOMT_FILES)
@echo compiling single-thread dynamic library $(LIBVER)
@@ -268,7 +286,7 @@ clean:
#-----------------------------------------------------------------------------
# make install is validated only for below listed environments
#-----------------------------------------------------------------------------
-ifneq (,$(filter Linux Darwin GNU/kFreeBSD GNU OpenBSD FreeBSD NetBSD DragonFly SunOS Haiku AIX MSYS_NT% CYGWIN_NT%,$(UNAME)))
+ifneq (,$(filter Linux Darwin GNU/kFreeBSD GNU OpenBSD FreeBSD NetBSD DragonFly SunOS Haiku AIX MSYS_NT% CYGWIN_NT% OS/390,$(UNAME)))

lib: libzstd.pc

@@ -363,8 +381,13 @@ install-shared:
[ -e $(DESTDIR)$(LIBDIR) ] || $(INSTALL) -d -m 755 $(DESTDIR)$(LIBDIR)/
@echo Installing shared library
$(INSTALL_PROGRAM) $(LIBZSTD) $(DESTDIR)$(LIBDIR)
+ifeq ($(UNAME_TARGET_SYSTEM), OS/390)
+ [ ! -f libzstd.x ] || $(INSTALL_DATA) libzstd.x $(DESTDIR)$(LIBDIR)
+endif
+ifneq ($(UNAME_TARGET_SYSTEM), OS/390)
ln -sf $(LIBZSTD) $(DESTDIR)$(LIBDIR)/libzstd.$(SHARED_EXT_MAJOR)
ln -sf $(LIBZSTD) $(DESTDIR)$(LIBDIR)/libzstd.$(SHARED_EXT)
+endif

.PHONY: install-includes
install-includes:
59 changes: 36 additions & 23 deletions patches/PR1/assertfirst.patch → patches/programs.patch
Original file line number Diff line number Diff line change
@@ -1,25 +1,39 @@
diff --git a/programs/Makefile b/programs/Makefile
index f4af5e9..be62692 100644
--- a/programs/Makefile
+++ b/programs/Makefile
@@ -345,7 +345,7 @@ include $(wildcard $(DEPFILES))
#-----------------------------------------------------------------------------
# make install is validated only for Linux, macOS, BSD, Hurd and Solaris targets
#-----------------------------------------------------------------------------
-ifneq (,$(filter Linux Darwin GNU/kFreeBSD GNU OpenBSD FreeBSD NetBSD DragonFly SunOS Haiku AIX MSYS_NT% CYGWIN_NT%,$(UNAME)))
+ifneq (,$(filter Linux Darwin GNU/kFreeBSD GNU OpenBSD FreeBSD NetBSD DragonFly SunOS Haiku AIX MSYS_NT% CYGWIN_NT% OS/390,$(UNAME)))

HAVE_COLORNEVER = $(shell echo a | egrep --color=never a > /dev/null 2> /dev/null && echo 1 || echo 0)
EGREP_OPTIONS ?=
diff --git a/programs/benchzstd.c b/programs/benchzstd.c
index 9bc3628..bdbf7f3 100644
index f9274a5..3ca5908 100644
--- a/programs/benchzstd.c
+++ b/programs/benchzstd.c
@@ -20,13 +20,13 @@
@@ -18,15 +18,13 @@
/* *************************************
* Includes
***************************************/
-#include "platform.h" /* Large Files support */
-#include "util.h" /* UTIL_getFileSize, UTIL_sleep */
#include <stdlib.h> /* malloc, free */
#include <string.h> /* memset, strerror */
#include <stdio.h> /* fprintf, fopen */
* Includes
***************************************/
-/* this must be included first */
-#include "platform.h" /* Large Files support, compiler specifics */
-
/* then following system includes */
#include <assert.h> /* assert */
#include <errno.h>
#include <assert.h> /* assert */
+#include "platform.h" /* Large Files support */
+#include "util.h" /* UTIL_getFileSize, UTIL_sleep */

#include "timefn.h" /* UTIL_time_t */
#include <stdio.h> /* fprintf, fopen */
#include <stdlib.h> /* malloc, free */
#include <string.h> /* memset, strerror */
+#include "platform.h" /* Large Files support, compiler specifics */
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

platform.h is documented upstream as needing to be included first (e.g., for large-file/feature macros), but this patch moves it (and in one case util.h) after system headers in several translation units, which can cause subtle ABI/IO issues. Consider keeping these headers first (or ensuring the required macros are provided via compiler flags) to preserve the intended behavior.

Severity: medium

Other Locations
  • patches/assertfirst.patch:36
  • patches/assertfirst.patch:58
  • patches/assertfirst.patch:77
  • patches/assertfirst.patch:95

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

#include "util.h" /* UTIL_getFileSize, UTIL_sleep */
#include "../lib/common/mem.h"
#include "benchfn.h"
diff --git a/programs/dibio.c b/programs/dibio.c
index 26ebe5c..7b448b2 100644
index 7ba22d1..66abdd0 100644
--- a/programs/dibio.c
+++ b/programs/dibio.c
@@ -21,12 +21,12 @@
Expand All @@ -38,7 +52,7 @@ index 26ebe5c..7b448b2 100644
#include "timefn.h" /* UTIL_time_t, UTIL_clockSpanMicro, UTIL_getTime */
#include "../lib/common/debug.h" /* assert */
diff --git a/programs/fileio.c b/programs/fileio.c
index 84a0f48..9d1e9b4 100644
index 0ecca40..3c85983 100644
--- a/programs/fileio.c
+++ b/programs/fileio.c
@@ -23,8 +23,6 @@
Expand All @@ -60,10 +74,10 @@ index 84a0f48..9d1e9b4 100644

#if defined (_MSC_VER)
diff --git a/programs/util.c b/programs/util.c
index c9031e9..29b1547 100644
index 065a358..21d8e67 100644
--- a/programs/util.c
+++ b/programs/util.c
@@ -16,12 +16,12 @@ extern "C" {
@@ -11,12 +11,12 @@
/*-****************************************
* Dependencies
******************************************/
Expand All @@ -75,13 +89,13 @@ index c9031e9..29b1547 100644
#include <assert.h>
+#include "util.h" /* note : ensure that platform.h is included first ! */

#if defined(_WIN32)
# include <sys/utime.h> /* utime */
#if defined(__FreeBSD__)
#include <sys/param.h> /* __FreeBSD_version */
diff --git a/programs/zstdcli.c b/programs/zstdcli.c
index d246545..70d3cab 100644
index 83d9b88..6b7012f 100644
--- a/programs/zstdcli.c
+++ b/programs/zstdcli.c
@@ -27,13 +27,13 @@
@@ -11,12 +11,12 @@
/*-************************************
* Dependencies
**************************************/
Expand All @@ -90,7 +104,6 @@ index d246545..70d3cab 100644
#include <stdlib.h> /* getenv */
#include <string.h> /* strcmp, strlen */
#include <stdio.h> /* fprintf(), stdin, stdout, stderr */
#include <errno.h> /* errno */
#include <assert.h> /* assert */
+#include "platform.h" /* PLATFORM_POSIX_VERSION */
+#include "util.h" /* UTIL_HAS_CREATEFILELIST, UTIL_createFileList, UTIL_isConsole */
Expand Down
13 changes: 13 additions & 0 deletions patches/test.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/tests/Makefile b/tests/Makefile
index 406c7f2..ef9405b 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -273,7 +273,7 @@ clean:
# valgrind tests validated only for some posix platforms
#----------------------------------------------------------------------------------
UNAME := $(shell sh -c 'MSYSTEM="MSYS" uname')
-ifneq (,$(filter Linux Darwin GNU/kFreeBSD GNU OpenBSD FreeBSD NetBSD DragonFly SunOS AIX CYGWIN_NT%,$(UNAME)))
+ifneq (,$(filter Linux Darwin GNU/kFreeBSD GNU OpenBSD FreeBSD NetBSD DragonFly SunOS AIX CYGWIN_NT% OS/390,$(UNAME)))
HOST_OS = POSIX

.PHONY: test-valgrind
Loading
Loading