From 5366d1e54ad15f063761f1ee018cbb5f180db99a Mon Sep 17 00:00:00 2001 From: AlmaLinux RelEng Bot Date: Mon, 30 Mar 2026 10:56:40 -0400 Subject: [PATCH] import CS qat-zstd-plugin-1.0.0-1.el9 --- .gitignore | 2 +- .qat-zstd-plugin.metadata | 2 +- SOURCES/lib-version.patch | 46 ------------------------------------ SOURCES/rh-makefile.patch | 27 ++++++++------------- SOURCES/test.patch | 48 ++++++++++++++++++++++++-------------- SPECS/qat-zstd-plugin.spec | 39 ++++++++++++++++++++++++++----- 6 files changed, 76 insertions(+), 88 deletions(-) delete mode 100644 SOURCES/lib-version.patch diff --git a/.gitignore b/.gitignore index 83c7292..ad97588 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/qat-zstd-plugin-0.2.0.tar.gz +SOURCES/qat-zstd-plugin-1.0.0.tar.gz diff --git a/.qat-zstd-plugin.metadata b/.qat-zstd-plugin.metadata index dac7b27..3828b6e 100644 --- a/.qat-zstd-plugin.metadata +++ b/.qat-zstd-plugin.metadata @@ -1 +1 @@ -902e29b525f2bc950e6feed73a68cd9753912134 SOURCES/qat-zstd-plugin-0.2.0.tar.gz +cfdcb9b4a3308da2d7e8a29b19519bcd41fc13e2 SOURCES/qat-zstd-plugin-1.0.0.tar.gz diff --git a/SOURCES/lib-version.patch b/SOURCES/lib-version.patch deleted file mode 100644 index 2cb58df..0000000 --- a/SOURCES/lib-version.patch +++ /dev/null @@ -1,46 +0,0 @@ ---- a/src/Makefile 2024-10-09 18:14:19.453675299 +0300 -+++ b/src/Makefile 2024-10-09 18:25:13.601675269 +0300 -@@ -79,18 +79,27 @@ - QATFLAGS += -O3 - endif - -+VERSION_MAJOR=0 -+VERSION_MINOR=2 -+VERSION_PATCH=0 -+VERSION=$(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_PATCH) -+ - qatseqprod.o: qatseqprod.c - $(CC) -c $(CFLAGS) $(QATFLAGS) $(DEBUGFLAGS) $^ -o $@ - - lib: qatseqprod.o - $(AR) rc libqatseqprod.a $^ -- $(CC) -shared $^ $(LDFLAGS) -o libqatseqprod.so -+ $(CC) -shared $^ $(LDFLAGS) -Wl,-soname,libqatseqprod.so.$(VERSION_MAJOR) -o libqatseqprod.so.$(VERSION) -+ ln -sf libqatseqprod.so.$(VERSION) libqatseqprod.so.$(VERSION_MAJOR) -+ ln -sf libqatseqprod.so.$(VERSION_MAJOR) libqatseqprod.so - - .PHONY: install - install: lib - [ -e $(DESTDIR)$(LIBDIR) ] || $(INSTALL) -d -m 755 $(DESTDIR)$(LIBDIR)/ - [ -e $(DESTDIR)$(INCLUDEDIR) ] || $(INSTALL) -d -m 755 $(DESTDIR)$(INCLUDEDIR)/ -- $(INSTALL_PROGRAM) libqatseqprod.so $(DESTDIR)$(LIBDIR) -+ $(INSTALL_PROGRAM) libqatseqprod.so.$(VERSION) $(DESTDIR)$(LIBDIR) -+ ln -sf libqatseqprod.so.$(VERSION) $(DESTDIR)$(LIBDIR)/libqatseqprod.so.$(VERSION_MAJOR) -+ ln -sf libqatseqprod.so.$(VERSION_MAJOR) $(DESTDIR)$(LIBDIR)/libqatseqprod.so - $(INSTALL_DATA) libqatseqprod.a $(DESTDIR)$(LIBDIR) - $(INSTALL_DATA) qatseqprod.h $(DESTDIR)$(INCLUDEDIR) - @echo qatseqprod library successfully installed -@@ -98,10 +107,12 @@ - .PHONY: uninstall - uninstall: - $(RM) $(LIBDIR)/libqatseqprod.a -+ $(RM) $(LIBDIR)/libqatseqprod.so.$(VERSION) -+ $(RM) $(LIBDIR)/libqatseqprod.so.$(VERSION_MAJOR) - $(RM) $(LIBDIR)/libqatseqprod.so - $(RM) $(INCLUDEDIR)/qatseqprod.h - @echo qatseqprod library successfully uninstalled - - clean: - $(RM) *.o -- $(RM) libqatseqprod.a libqatseqprod.so -+ $(RM) libqatseqprod.a libqatseqprod.so libqatseqprod.so.$(VERSION) libqatseqprod.so.$(VERSION_MAJOR) diff --git a/SOURCES/rh-makefile.patch b/SOURCES/rh-makefile.patch index 03913ca..1856c9e 100644 --- a/SOURCES/rh-makefile.patch +++ b/SOURCES/rh-makefile.patch @@ -1,16 +1,20 @@ --- a/src/Makefile 2024-10-30 22:20:03.296178391 +0100 +++ b/src/Makefile 2024-10-30 22:21:43.915301707 +0100 -@@ -52,11 +52,11 @@ ifneq ($(ICP_ROOT), ) +@@ -53,7 +53,7 @@ ifneq ($(ICP_ROOT), ) -I$(ICP_ROOT)/quickassist/include/dc \ -I$(ICP_ROOT)/quickassist/lookaside/access_layer/include \ -I$(ICP_ROOT)/quickassist/utilities/libusdm_drv - LDFLAGS = -Wl,-rpath,$(ICP_ROOT)/build -L$(ICP_ROOT)/build -lqat_s \ + LDFLAGS += -Wl,-rpath,$(ICP_ROOT)/build -L$(ICP_ROOT)/build -lqat_s \ - -lusdm_drv_s + -lusdm_drv_s -lnuma else - QATFLAGS = -DINTREE -- LDFLAGS = -lqat -lusdm -+ LDFLAGS += -lqat -lusdm + # In-tree - look for headers in standard locations +@@ -63,7 +63,7 @@ else + else + $(error QAT headers not found in Standard path, Please install QATLib development package or set ICP_ROOT for out-of-tree driver) + endif +- LDFLAGS = -lqat -lusdm -lnuma ++ LDFLAGS += -lqat -lusdm -lnuma endif ifdef ZSTDLIB @@ -24,15 +28,4 @@ +LDFLAGS += -L$(LIB) -I$(LIB) ifneq ($(ICP_ROOT), ) - LDFLAGS += -lqat_s -lusdm_drv_s -Wl,-rpath,$(ICP_ROOT)/build -L$(ICP_ROOT)/build ---- a/src/Makefile 2024-10-30 22:20:03.296178391 +0100 -+++ b/src/Makefile 2024-10-30 22:21:43.915301707 +0100 -@@ -76,7 +76,7 @@ DEBUGFLAGS += -DDEBUGLEVEL=$(DEBUGLEVEL) - ifneq ($(DEBUGLEVEL), 0) - QATFLAGS += -g -O0 - else -- QATFLAGS += -O3 -+ QATFLAGS += -g -O2 - endif - - VERSION_MAJOR=0 + LDFLAGS += -lqat_s -lusdm_drv_s -lnuma -Wl,-rpath,$(ICP_ROOT)/build -L$(ICP_ROOT)/build diff --git a/SOURCES/test.patch b/SOURCES/test.patch index fd6cea5..f48f38e 100644 --- a/SOURCES/test.patch +++ b/SOURCES/test.patch @@ -1,6 +1,6 @@ --- a/test/Makefile +++ b/test/Makefile -@@ -34,24 +34,12 @@ +@@ -34,42 +34,27 @@ # ####################################################################### LIB = ../src @@ -8,25 +8,46 @@ +LDFLAGS = -L$(LIB) -I$(LIB) ifneq ($(ICP_ROOT), ) - LDFLAGS += -lqat_s -lusdm_drv_s -Wl,-rpath,$(ICP_ROOT)/build -L$(ICP_ROOT)/build + LDFLAGS += -lqat_s -lusdm_drv_s -lnuma -Wl,-rpath,$(ICP_ROOT)/build -L$(ICP_ROOT)/build else -- LDFLAGS += -lqat -lusdm +- LDFLAGS += -lqat -lusdm -lnuma -endif - -ifdef ZSTDLIB +-CFLAGS += -I$(ZSTDLIB) -LDFLAGS += $(ZSTDLIB)/libzstd.a -else --ZSTDLIB := $(shell find /usr /lib /local -name 'libzstd.a' 2>/dev/null | head -n 1) --ZSTDLIB ?= /usr/local/lib/libzstd.a --ifneq ("$(wildcard $(ZSTDLIB))","") -- LDFLAGS += $(ZSTDLIB) --else -- $(error libzstd.a not found, please install libzstd or specify the path manually) --endif +-ZSTDLIB := $(shell find /usr /lib /local -name 'libzstd.a' 2>/dev/null | head -n 1| xargs dirname) +-LDFLAGS += $(ZSTDLIB)/libzstd.a + LDFLAGS += -lzstd -lqatseqprod -lqat -lusdm endif default: test benchmark + + all: test benchmark + +-check_zstdlib: +- @echo checking zstd static libaray '$(ZSTDLIB)/libzstd.a' +- @if [ ! -e $(ZSTDLIB)/libzstd.a ]; then \ +- echo libzstd.a is not found, please install libzstd or specify the path manually; \ +- exit 1; \ +- fi +- +-test: test.c check_zstdlib ++test: test.c + $(Q)$(MAKE) -C $(LIB) + $(CC) $< $(CFLAGS) $(LDFLAGS) -o $@ + +-benchmark: benchmark.c check_zstdlib ++benchmark: benchmark.c + $(Q)$(MAKE) -C $(LIB) + $(CC) $(CFLAGS) $< $(LDFLAGS) -o $@ -lpthread + + clean: + $(Q)$(MAKE) -C $(LIB) $@ + $(RM) test benchmark +-.PHONY: clean check_zstdlib ++.PHONY: clean --- a/test/test.c +++ b/test/test.c @@ -44,9 +44,6 @@ @@ -39,10 +60,3 @@ #include "zstd.h" #include "zstd_errors.h" -@@ -143,4 +140,4 @@ - free(dstBuffer); - free(decompBuffer); - return 0; --} -\ No newline at end of file -+} diff --git a/SPECS/qat-zstd-plugin.spec b/SPECS/qat-zstd-plugin.spec index d9adc30..1d33b1f 100644 --- a/SPECS/qat-zstd-plugin.spec +++ b/SPECS/qat-zstd-plugin.spec @@ -2,14 +2,16 @@ ## (rpmautospec version 0.6.5) ## RPMAUTOSPEC: autorelease, autochangelog %define autorelease(e:s:pb:n) %{?-p:0.}%{lua: - release_number = 3; + release_number = 1; base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); print(release_number + base_release_number - 1); }%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}} ## END: Set by rpmautospec +# SPDX-License-Identifier: MIT + Name: qat-zstd-plugin -Version: 0.2.0 +Version: 1.0.0 Release: %autorelease Summary: Intel QuickAssist Technology ZSTD Plugin @@ -17,14 +19,14 @@ License: BSD-3-Clause URL: https://github.com/intel/QAT-ZSTD-Plugin Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz -Patch0: lib-version.patch -Patch1: test.patch -Patch2: rh-makefile.patch +Patch0: test.patch +Patch1: rh-makefile.patch BuildRequires: automake BuildRequires: gcc BuildRequires: libzstd-devel BuildRequires: qatlib-devel +BuildRequires: numactl-devel # Upstream only supports x86_64 ExclusiveArch: x86_64 @@ -58,6 +60,24 @@ sed -i -e 's|$(PREFIX)/lib|%{_libdir}|g' src/Makefile sed -i -e 's|$(PREFIX)/include|%{_includedir}|g' src/Makefile %build +# c9s build system quickfix BEGIN +CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64-v2 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection' +export CFLAGS +CXXFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64-v2 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection' +export CXXFLAGS +FFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64-v2 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -I/usr/lib64/gfortran/modules' +export FFLAGS +FCFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64-v2 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -I/usr/lib64/gfortran/modules' +export FCFLAGS +LDFLAGS='-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 ' +export LDFLAGS +LT_SYS_LIBRARY_PATH=/usr/lib64: +export LT_SYS_LIBRARY_PATH +CC=gcc +export CC +CXX=g++ +export CXX +# c9s build system quickfix END %make_build LDFLAGS="$LDFLAGS -lzstd" make test @@ -69,7 +89,7 @@ LD_LIBRARY_PATH=%{buildroot}%{_libdir} ./test/test README.md %files %license LICENSE -%{_libdir}/libqatseqprod.so.0 +%{_libdir}/libqatseqprod.so.1 %{_libdir}/libqatseqprod.so.%{version} %files devel @@ -82,6 +102,13 @@ LD_LIBRARY_PATH=%{buildroot}%{_libdir} ./test/test README.md %changelog ## START: Generated by rpmautospec +* Mon Feb 02 2026 Vladislav Dronov - 1.0.0-1 +- Update to qat-zstd-plugin 1.0.0 @ 1e8b930c (RHEL-72905) +- NUMA node aware mem allocations and other Code optimizations +- Bug Fixes and Static analysis Fixes (OpenScanhub and Latest Coverity) +- Support ZSTD v1.5.7 and README refactor +- Spec file updates for RPM Packaging + * Tue Oct 29 2024 Vladis Dronov - 0.2.0-1 - Initial commit on c9s (RHEL-46072) ## END: Generated by rpmautospec