Update to libnxz 0.63

This commit is contained in:
Tulio Magno Quites Machado Filho 2022-03-04 14:40:18 -03:00 committed by Tulio Magno Quites Machado Filho
parent 849d9559e0
commit 23d8d2295c
4 changed files with 18 additions and 110 deletions

View File

@ -1,67 +0,0 @@
From 28c9671c39d50934da68c16a8c6730288e53e11e Mon Sep 17 00:00:00 2001
From: Matheus Castanho <msc@linux.ibm.com>
Date: Thu, 7 Oct 2021 13:58:48 -0300
Subject: [PATCH] Remove unnecessary checks during configuration processing
GCC 12 (dev) started to complain that some NULL checks were not necessary as the
values could never be NULL. The warnings seem to be correct, so the checks have
been removed.
In find_cfg and nx_dump_cfg the loop iterates over a maximum of
cfg_table->cfg_num elements. As long as cfg_num is at most MAX_CONFIG_ITEM, we
are fine because cfg_table can hold that many elements, and key and val are
pointers to "static" arrays inside struct cfg_item.
In set_cfg, we access key and val of item at index cfg_cnt, which is guarded by
the function to be less than MAX_CONFIG_ITEM, so we are guaranteed to access
initialized data.
Tested with gcc 11.1.1 and gcc 12.0.0 (rev 5f0285418940).
Signed-off-by: Matheus Castanho <msc@linux.ibm.com>
---
lib/nx_utils.c | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/lib/nx_utils.c b/lib/nx_utils.c
index 5e01745..5386359 100644
--- a/lib/nx_utils.c
+++ b/lib/nx_utils.c
@@ -99,8 +99,6 @@ static int find_cfg(char *key, struct nx_cfg_tab *cfg_table)
configs = cfg_table->configs;
for (i = 0; i < cfg_table->cfg_num; i++) {
- if (!configs[i].key)
- continue;
if (strcmp(key, configs[i].key) == 0)
return i;
}
@@ -138,9 +136,6 @@ static int set_cfg(struct nx_cfg_tab *cfg_table, char *key, char *val, int cnt)
} else
ret = 0;
- if (!configs[cfg_cnt].key || !configs[cfg_cnt].val)
- return -1;
-
memcpy(configs[cfg_cnt].key, trim_key, key_size);
if (trim_space(configs[cfg_cnt].val, MAX_CONFIG_LINE, val) < 0) {
/* val is all space, or lengh of val larger than MAX_CONFIG_LINE,
@@ -154,15 +149,14 @@ static int set_cfg(struct nx_cfg_tab *cfg_table, char *key, char *val, int cnt)
int nx_dump_cfg(struct nx_cfg_tab *cfg_table, FILE *fp)
{
int i;
- char *key, *val;
+
if (!cfg_table || !fp)
return -1;
fprintf(fp, "nx-zlib config file ========\n");
for (i = 0; i < cfg_table->cfg_num; i++) {
- key = (!cfg_table->configs[i].key) ? "NULL" : cfg_table->configs[i].key;
- val = (!cfg_table->configs[i].val) ? "NULL" : cfg_table->configs[i].val;
- fprintf(fp, "[%d]: %s = %s\n", i, key, val);
+ fprintf(fp, "[%d]: %s = %s\n", i, cfg_table->configs[i].key,
+ cfg_table->configs[i].val);
}
return 0;

View File

@ -1,19 +1,14 @@
Name: libnxz
Version: 0.62
Release: 4%{?dist}
Version: 0.63
Release: 1%{?dist}
Summary: Zlib implementation for POWER processors
License: ASL 2.0
License: ASL 2.0 or GPLv2+
Url: https://github.com/libnxz/power-gzip
BuildRequires: zlib-devel
Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
# Stop depending on a git repository when running make.
Patch0: rm-git.patch
# Avoid warnings when building with GCC 12.
Patch1: gcc12.patch
# Be explicit about the soname in order to avoid unintentional changes.
%global soname libnxz.so.0.62
%global soname libnxz.so.0
ExclusiveArch: ppc64le
BuildRequires: gcc
@ -44,23 +39,25 @@ application that use %{name}.
%autosetup -p1 -n power-gzip-%{version}
%build
%make_build FLG="-std=gnu11 %{build_cflags} "
%configure --enable-zlib-api
%make_build
%check
# libnxz tests only work on P9 servers or newer, with Linux >= 5.8.
# This combination is not guaranteed to have at build time. Check if
# NX GZIP engine device is available before deciding to run the tests.
if [[ -w "/dev/crypto/nx-gzip" ]]; then
make -k %{?_smp_mflags} check
make check
fi
%install
make install PREFIX="%{buildroot}%{_prefix}" LIBDIR="%{buildroot}%{_libdir}"
%make_install
%files
%{_libdir}/%{soname}
%{_libdir}/libnxz.so.0
%license licenses/APACHE-2.0.txt
%{_libdir}/libnxz.so.0.%{version}
%license %{_docdir}/%{name}/APACHE-2.0.txt
%license %{_docdir}/%{name}/gpl-2.0.txt
%doc README.md
%files devel
@ -69,8 +66,14 @@ make install PREFIX="%{buildroot}%{_prefix}" LIBDIR="%{buildroot}%{_libdir}"
%files static
%{_libdir}/libnxz.a
%{_libdir}/libnxz.la
%changelog
* Fri Mar 04 2022 Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com> - 0.63-1
- Update to libnxz 0.63.
- Fix the soname to the right string.
- Properly list the dual-licensing scenario of the project.
* Wed Jan 26 2022 Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com> - 0.62-4
- Fix issue with GCC 12.

View File

@ -1,28 +0,0 @@
From 9a6ff0c71ab6c06c660c760ad0acb9691655d1a0 Mon Sep 17 00:00:00 2001
From: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
Date: Tue, 27 Oct 2020 21:42:38 -0300
Subject: [PATCH] Stop depending on git when building
Replace the git command with the current version.
Signed-off-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
---
lib/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/Makefile b/lib/Makefile
index cc996dc..3cb3a7c 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -5,7 +5,7 @@ SRCS = nx_inflate.c nx_deflate.c nx_zlib.c nx_crc.c nx_dht.c nx_dhtgen.c nx_dht_
OBJS = nx_inflate.o nx_deflate.o nx_zlib.o nx_crc.o nx_dht.o nx_dhtgen.o nx_dht_builtin.o \
nx_adler32.o gzip_vas.o nx_compress.o nx_uncompr.o crc32_ppc.o crc32_ppc_asm.o nx_utils.o
-VERSION ?= $(shell git describe --tags | cut -d - -f 1,2 | tr - . | cut -c 2-)
+VERSION ?= 0.62
SOVERSION = $(shell echo $(VERSION) | cut -d . -f 1)
PACKAGENAME = libnxz
STATICLIB = $(PACKAGENAME).a
--
2.25.4

View File

@ -1 +1 @@
SHA512 (libnxz-0.62.tar.gz) = 773760838eb87b6be475226b3aada5fcd84d9d7a1248f4ec00c59f87eef0185afd95d0c449821dd24f32d637376742c33ab411f936f95eed8a713d1cdd35fe6a
SHA512 (libnxz-0.63.tar.gz) = 9cefc3e1aa3993211ccccf72cf41441ca204c5b0d076ab31218323fb893ca2d67d09f0586e04ffb8d341f1ca1b7e63de3431deda0f56eee13acbae09d3c4ef85