Sync from SUSE:SLFO:Main xxhash revision 85733a876ba23049650c95a9ba2ef1ad

This commit is contained in:
Adrian Schröter 2024-10-23 12:06:51 +02:00
parent f9eec010d5
commit d7b332e816
11 changed files with 118 additions and 199 deletions

View File

@ -1,40 +0,0 @@
From 15ce80f9f2760609d8cc68cea76d3f3217ab70e1 Mon Sep 17 00:00:00 2001
From: Mattias Ellert <mattias.ellert@physics.uu.se>
Date: Tue, 30 Nov 2021 23:19:38 +0100
Subject: [PATCH] Fix compilation on RHEL 7 ppc64le (gcc 4.8)
---
xxhash.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/xxhash.h b/xxhash.h
index 08ab7945..7850622a 100644
--- a/xxhash.h
+++ b/xxhash.h
@@ -4129,7 +4129,7 @@ XXH3_accumulate_512_vsx( void* XXH_RESTRICT acc,
const void* XXH_RESTRICT secret)
{
/* presumed aligned */
- unsigned long long* const xacc = (unsigned long long*) acc;
+ unsigned int* const xacc = (unsigned int*) acc;
xxh_u64x2 const* const xinput = (xxh_u64x2 const*) input; /* no alignment restriction */
xxh_u64x2 const* const xsecret = (xxh_u64x2 const*) secret; /* no alignment restriction */
xxh_u64x2 const v32 = { 32, 32 };
@@ -4145,7 +4145,7 @@ XXH3_accumulate_512_vsx( void* XXH_RESTRICT acc,
/* product = ((xxh_u64x2)data_key & 0xFFFFFFFF) * ((xxh_u64x2)shuffled & 0xFFFFFFFF); */
xxh_u64x2 const product = XXH_vec_mulo((xxh_u32x4)data_key, shuffled);
/* acc_vec = xacc[i]; */
- xxh_u64x2 acc_vec = vec_xl(0, xacc + 2 * i);
+ xxh_u64x2 acc_vec = (xxh_u64x2)vec_xl(0, xacc + 4 * i);
acc_vec += product;
/* swap high and low halves */
@@ -4155,7 +4155,7 @@ XXH3_accumulate_512_vsx( void* XXH_RESTRICT acc,
acc_vec += vec_xxpermdi(data_vec, data_vec, 2);
#endif
/* xacc[i] = acc_vec; */
- vec_xst(acc_vec, 0, xacc + 2 * i);
+ vec_xst((xxh_u32x4)acc_vec, 0, xacc + 4 * i);
}
}

View File

@ -1,126 +0,0 @@
From 836f4e735cf368542f14005e41d2f84ec29dfd60 Mon Sep 17 00:00:00 2001
From: Yann Collet <yann.collet.73@gmail.com>
Date: Sat, 4 Dec 2021 10:29:49 -0800
Subject: [PATCH] fix man page installation
for variant redirectors (`xxh32sum`, `xxh64sum` and `xxh128sum`).
fix #647, reported by @jpalus.
Also : slightly updated man page text, for clarity and accuracy.
---
Makefile | 14 ++++++++------
cli/xxhsum.1 | 8 ++++----
cli/xxhsum.1.md | 8 +++++---
3 files changed, 17 insertions(+), 13 deletions(-)
diff --git a/Makefile b/Makefile
index 2fbefbc6..63273e16 100644
--- a/Makefile
+++ b/Makefile
@@ -457,6 +457,7 @@ endif
INSTALL_PROGRAM ?= $(INSTALL)
INSTALL_DATA ?= $(INSTALL) -m 644
+INSTALL_DIR ?= $(INSTALL) -d -m 755
# Escape special symbols by putting each character into its separate class
@@ -496,7 +497,7 @@ libxxhash.pc: libxxhash.pc.in
.PHONY: install
install: lib libxxhash.pc xxhsum ## install libraries, CLI, links and man page
@echo Installing libxxhash
- $(Q)$(INSTALL) -d -m 755 $(DESTDIR)$(LIBDIR)
+ $(Q)$(INSTALL_DIR) $(DESTDIR)$(LIBDIR)
$(Q)$(INSTALL_DATA) libxxhash.a $(DESTDIR)$(LIBDIR)
$(Q)$(INSTALL_PROGRAM) $(LIBXXH) $(DESTDIR)$(LIBDIR)
$(Q)ln -sf $(LIBXXH) $(DESTDIR)$(LIBDIR)/libxxhash.$(SHARED_EXT_MAJOR)
@@ -508,19 +509,20 @@ ifeq ($(DISPATCH),1)
$(Q)$(INSTALL_DATA) xxh_x86dispatch.h $(DESTDIR)$(INCLUDEDIR)
endif
@echo Installing pkgconfig
- $(Q)$(INSTALL) -d -m 755 $(DESTDIR)$(PKGCONFIGDIR)/
+ $(Q)$(INSTALL_DIR) $(DESTDIR)$(PKGCONFIGDIR)/
$(Q)$(INSTALL_DATA) libxxhash.pc $(DESTDIR)$(PKGCONFIGDIR)/
@echo Installing xxhsum
- $(Q)$(INSTALL) -d -m 755 $(DESTDIR)$(BINDIR)/ $(DESTDIR)$(MANDIR)/
+ $(Q)$(INSTALL_DIR) $(DESTDIR)$(BINDIR)/
$(Q)$(INSTALL_PROGRAM) xxhsum $(DESTDIR)$(BINDIR)/xxhsum
$(Q)ln -sf xxhsum $(DESTDIR)$(BINDIR)/xxh32sum
$(Q)ln -sf xxhsum $(DESTDIR)$(BINDIR)/xxh64sum
$(Q)ln -sf xxhsum $(DESTDIR)$(BINDIR)/xxh128sum
@echo Installing man pages
+ $(Q)$(INSTALL_DIR) $(DESTDIR)$(MANDIR)/
$(Q)$(INSTALL_DATA) $(MAN) $(DESTDIR)$(MANDIR)/xxhsum.1
- $(Q)ln -sf $(MAN) $(DESTDIR)$(MANDIR)/xxh32sum.1
- $(Q)ln -sf $(MAN) $(DESTDIR)$(MANDIR)/xxh64sum.1
- $(Q)ln -sf $(MAN) $(DESTDIR)$(MANDIR)/xxh128sum.1
+ $(Q)ln -sf xxhsum.1 $(DESTDIR)$(MANDIR)/xxh32sum.1
+ $(Q)ln -sf xxhsum.1 $(DESTDIR)$(MANDIR)/xxh64sum.1
+ $(Q)ln -sf xxhsum.1 $(DESTDIR)$(MANDIR)/xxh128sum.1
@echo xxhash installation completed
.PHONY: uninstall
diff --git a/cli/xxhsum.1 b/cli/xxhsum.1
index 27e6808e..715fc4be 100644
--- a/cli/xxhsum.1
+++ b/cli/xxhsum.1
@@ -1,14 +1,14 @@
-.TH "XXHSUM" "1" "November 2021" "xxhsum 0.8.1" "User Commands"
+.TH "XXHSUM" "1" "December 2021" "xxhsum 0.8.1" "User Commands"
.SH "NAME"
\fBxxhsum\fR \- print or check xxHash non\-cryptographic checksums
.SH "SYNOPSIS"
\fBxxhsum [<OPTION>] \|\.\|\.\|\. [<FILE>] \|\.\|\.\|\.\fR \fBxxhsum \-b [<OPTION>] \|\.\|\.\|\.\fR
.P
-\fBxxh32sum\fR is equivalent to \fBxxhsum \-H0\fR \fBxxh64sum\fR is equivalent to \fBxxhsum \-H1\fR \fBxxh128sum\fR is equivalent to \fBxxhsum \-H2\fR
+\fBxxh32sum\fR is equivalent to \fBxxhsum \-H0\fR, \fBxxh64sum\fR is equivalent to \fBxxhsum \-H1\fR, \fBxxh128sum\fR is equivalent to \fBxxhsum \-H2\fR
.SH "DESCRIPTION"
Print or check xxHash (32, 64 or 128 bits) checksums\. When no \fIFILE\fR, read standard input, except if it\'s the console\. When \fIFILE\fR is \fB\-\fR, read standard input even if it\'s the console\.
.P
-\fBxxhsum\fR supports a command line syntax similar but not identical to md5sum(1)\. Differences are: \fBxxhsum\fR doesn\'t have text/binary mode switch (\fB\-b\fR, \fB\-t\fR); \fBxxhsum\fR always treats files as binary file; \fBxxhsum\fR has a hash bit width switch (\fB\-H\fR);
+\fBxxhsum\fR supports a command line syntax similar but not identical to md5sum(1)\. Differences are: \fBxxhsum\fR doesn\'t have text/binary mode switch (\fB\-b\fR, \fB\-t\fR); \fBxxhsum\fR always treats files as binary file; \fBxxhsum\fR has a hash selection switch (\fB\-H\fR);
.P
As xxHash is a fast non\-cryptographic checksum algorithm, \fBxxhsum\fR should not be used for security related purposes\.
.P
@@ -19,7 +19,7 @@ As xxHash is a fast non\-cryptographic checksum algorithm, \fBxxhsum\fR should n
Displays xxhsum version and exits
.TP
\fB\-H\fR\fIHASHTYPE\fR
-Hash selection\. \fIHASHTYPE\fR means \fB0\fR=XXH32, \fB1\fR=XXH64, \fB2\fR=XXH128, \fB3\fR=XXH3\. Alternatively, \fIHASHTYPE\fR \fB32\fR=XXH32, \fB64\fR=XXH64, \fB128\fR=XXH128\. Default value is \fB1\fR (64bits)
+Hash selection\. \fIHASHTYPE\fR means \fB0\fR=XXH32, \fB1\fR=XXH64, \fB2\fR=XXH128, \fB3\fR=XXH3\. Note that \fB\-H3\fR triggers \fB\-\-tag\fR, which can\'t be skipped (this is to reduce risks of confusion with \fB\-H2\fR (\fBXXH64\fR))\. Alternatively, \fIHASHTYPE\fR \fB32\fR=XXH32, \fB64\fR=XXH64, \fB128\fR=XXH128\. Default value is \fB1\fR (64bits)
.TP
\fB\-\-tag\fR
Output in the BSD style\.
diff --git a/cli/xxhsum.1.md b/cli/xxhsum.1.md
index 777d1cae..df2cb914 100644
--- a/cli/xxhsum.1.md
+++ b/cli/xxhsum.1.md
@@ -7,8 +7,8 @@ SYNOPSIS
`xxhsum [<OPTION>] ... [<FILE>] ...`
`xxhsum -b [<OPTION>] ...`
-`xxh32sum` is equivalent to `xxhsum -H0`
-`xxh64sum` is equivalent to `xxhsum -H1`
+`xxh32sum` is equivalent to `xxhsum -H0`,
+`xxh64sum` is equivalent to `xxhsum -H1`,
`xxh128sum` is equivalent to `xxhsum -H2`
@@ -23,7 +23,7 @@ When <FILE> is `-`, read standard input even if it's the console.
Differences are:
`xxhsum` doesn't have text/binary mode switch (`-b`, `-t`);
`xxhsum` always treats files as binary file;
-`xxhsum` has a hash bit width switch (`-H`);
+`xxhsum` has a hash selection switch (`-H`);
As xxHash is a fast non-cryptographic checksum algorithm,
`xxhsum` should not be used for security related purposes.
@@ -38,6 +38,8 @@ OPTIONS
* `-H`<HASHTYPE>:
Hash selection. <HASHTYPE> means `0`=XXH32, `1`=XXH64, `2`=XXH128, `3`=XXH3.
+ Note that `-H3` triggers `--tag`, which can't be skipped
+ (this is to reduce risks of confusion with `-H2` (`XXH64`)).
Alternatively, <HASHTYPE> `32`=XXH32, `64`=XXH64, `128`=XXH128.
Default value is `1` (64bits)

4
_scmsync.obsinfo Normal file
View File

@ -0,0 +1,4 @@
mtime: 1725462627
commit: 679f82e202407e8aea6eb1514bbeb3f5024ded59fc3a4a33a1607268d40dbfb1
url: https://src.opensuse.org/jengelh/xxhash
revision: master

BIN
build.specials.obscpio (Stored with Git LFS) Normal file

Binary file not shown.

32
inline.patch Normal file
View File

@ -0,0 +1,32 @@
From: Jan Engelhardt <jengelh@inai.de>
Date: 2024-09-04 17:08:46.573623857 +0200
References: https://github.com/Cyan4973/xxHash/issues/943
Ditch forced inlining, gcc-14 does not like it when combined with -Og.
(gcc-13 was fine.) And I want everyone to be able to use -Og.
In function 'void XXH3_hashLong_internal_loop(xxh_u64*, const xxh_u8*, size_t, const xxh_u8*, size_t, XXH3_f_accumulate, XXH3_f_scrambleAcc)',
inlined from 'XXH_NAMESPACEXXH128_hash_t XXH3_hashLong_128b_internal(const void*, size_t, const xxh_u8*, size_t, XXH3_f_accumulate, XXH3_f_scrambleAcc)' at /usr/include/xxhash.h:6416:32,
inlined from 'XXH_NAMESPACEXXH128_hash_t XXH3_hashLong_128b_default(const void*, size_t, XXH64_hash_t, const void*, size_t)' at /usr/include/xxhash.h:6442:39:
/usr/include/xxhash.h:5364:18: error: inlining failed in call to 'always_inline' 'void XXH3_accumulate_scalar(xxh_u64*, const xxh_u8*, const xxh_u8*, size_t)': function not considered for inlining
5364 | XXH_FORCE_INLINE XXH3_ACCUMULATE_TEMPLATE(scalar)
/usr/include/xxhash.h:5544:14: note: called from here
5544 | f_acc(acc, input + n*block_len, secret, nbStripesPerBlock);
---
xxhash.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: xxHash-0.8.2/xxhash.h
===================================================================
--- xxHash-0.8.2.orig/xxhash.h
+++ xxHash-0.8.2/xxhash.h
@@ -2107,7 +2107,7 @@ static void* XXH_memcpy(void* dest, cons
# define XXH_NO_INLINE static
/* enable inlining hints */
#elif defined(__GNUC__) || defined(__clang__)
-# define XXH_FORCE_INLINE static __inline__ __attribute__((always_inline, unused))
+# define XXH_FORCE_INLINE static __inline__ __attribute__((unused))
# define XXH_NO_INLINE static __attribute__((noinline))
#elif defined(_MSC_VER) /* Visual Studio */
# define XXH_FORCE_INLINE static __forceinline

View File

@ -0,0 +1,16 @@
From: Bruno Pitrus <brunopitrus@hotmail.com>
Date: 2024-05-05 19:35:03+0000
--- xxHash-0.8.2/Makefile.old 2023-07-21 12:01:35.000000000 +0200
+++ xxHash-0.8.2/Makefile 2024-05-05 21:19:32.265851133 +0200
@@ -450,8 +450,8 @@ test-all: test test32 test-unicode clang
.PHONY: test-tools
test-tools:
- CFLAGS=-Werror $(MAKE) -C tests/bench
- CFLAGS=-Werror $(MAKE) -C tests/collisions
+ $(MAKE) -C tests/bench
+ $(MAKE) -C tests/collisions
.PHONY: test-xxh-nnn-sums
test-xxh-nnn-sums: xxhsum_and_links

BIN
xxHash-0.8.1.tar.gz (Stored with Git LFS)

Binary file not shown.

BIN
xxHash-0.8.2.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -1,13 +0,0 @@
Index: xxHash-0.8.1/xxhash.h
===================================================================
--- xxHash-0.8.1.orig/xxhash.h
+++ xxHash-0.8.1/xxhash.h
@@ -1408,7 +1408,7 @@ XXH3_128bits_reset_withSecretandSeed(XXH
(defined(__INTEL_COMPILER) && !defined(_WIN32)) || \
( \
defined(__GNUC__) && ( \
- (defined(__ARM_ARCH) && __ARM_ARCH >= 7) || \
+ (defined(__ARM_ARCH) && __ARM_ARCH >= 6) || \
( \
defined(__mips__) && \
(__mips <= 5 || __mips_isa_rev < 6) && \

View File

@ -1,3 +1,34 @@
-------------------------------------------------------------------
Tue Sep 3 02:11:09 UTC 2024 - Jan Engelhardt <jengelh@inai.de>
- Add inline.patch to resolve FTBFS on gcc-14 + -Og.
-------------------------------------------------------------------
Sun May 5 19:35:03 UTC 2024 - Bruno Pitrus <brunopitrus@hotmail.com>
- Fix ftbfs with gcc14:
* use correct optflags also in %check
* add test-tools-do-not-override-cflags.patch
- Execute more tests
-------------------------------------------------------------------
Thu Nov 30 14:43:11 UTC 2023 - Guillaume GARDET <guillaume.gardet@opensuse.org>
- Make use of openSUSE build flags
-------------------------------------------------------------------
Fri Nov 3 10:00:32 UTC 2023 - Jan Engelhardt <jengelh@inai.de>
- Update to release 0.8.2
* ARM NEON speed improvements; on M1 Pro it is +20% speed for
XXH3 and XXH128 (from 30.0 GB/s to 36 GB/s).
* Added support for ARM's SVE vector extension.
* Resolved some issues with XXH3's s390x vector implementation.
- Delete xxhash-avoid-armv6-unaligned-access.patch (should be
fixed by c0dd448b), delete 836f4e735cf368542f14005e41d2f84ec29dfd60.patch
(merged), delete 15ce80f9f2760609d8cc68cea76d3f3217ab70e1.patch
(merged)
-------------------------------------------------------------------
Wed Mar 8 21:28:23 UTC 2023 - Michael Gorse <mgorse@suse.com>

View File

@ -1,7 +1,7 @@
#
# spec file for package xxhash
#
# Copyright (c) 2023 SUSE LLC
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -17,18 +17,18 @@
Name: xxhash
Version: 0.8.1
Version: 0.8.2
Release: 0
Summary: Non-cryptographic hash algorithm
License: BSD-2-Clause AND GPL-2.0-only
Group: Productivity/Security
URL: https://github.com/Cyan4973/xxHash
Source0: https://github.com/Cyan4973/xxHash/archive/v%{version}.tar.gz#/xxHash-%{version}.tar.gz
Patch0: xxhash-avoid-armv6-unaligned-access.patch
Patch1: https://github.com/Cyan4973/xxHash/commit/836f4e735cf368542f14005e41d2f84ec29dfd60.patch
Patch2: https://github.com/Cyan4973/xxHash/commit/15ce80f9f2760609d8cc68cea76d3f3217ab70e1.patch
Patch1: test-tools-do-not-override-cflags.patch
Patch2: inline.patch
BuildRequires: gcc-c++
BuildRequires: pkgconfig
BuildRequires: pkg-config
%{?suse_build_hwcaps_libs}
%description
xxHash is a hash algorithm. It completes the SMHasher test suite which
@ -36,43 +36,55 @@ evaluates collision, dispersion and randomness qualities of hash functions.
Hashes are identical on all platforms.
%package -n libxxhash0
Summary: Shared library for xxHash - a non-cryptographic hash algorithm
Summary: Non-cryptographic hash algorithm
License: BSD-2-Clause
Group: System/Libraries
%description -n libxxhash0
Shared library for xxHash - a hash algorithm. It completes the SMHasher test
suite which evaluates collision, dispersion and randomness qualities of hash
functions. Hashes are identical on all platforms.
xxHash is a hash algorithm. It completes the SMHasher test suite which
evaluates collision, dispersion and randomness qualities of hash functions.
Hashes are identical on all platforms.
%package devel
Summary: Development files for xxHash - a non-cryptographic hash algorithm
Summary: Headers for xxHash, a non-cryptographic hash algorithm
License: BSD-2-Clause
Group: Development/Libraries/C and C++
Requires: %{name} = %{version}
Requires: libxxhash0 = %{version}
%description devel
Development files for xxHash - a hash algorithm. It completes the SMHasher test
suite which evaluates collision, dispersion and randomness qualities of hash
functions. Hashes are identical on all platforms.
Headers and other development files for xxHash.
%prep
%autosetup -p1 -n xxHash-%{version}
%build
# ALLOW_AVX just means "we guarantee we policed our %%optflags".
export CFLAGS="%{optflags} -DXXH_X86DISPATCH_ALLOW_AVX=1"
export CXXFLAGS="$CFLAGS"
export LDFLAGS="%{?build_ldflags}"
# DISPATCH=1 if you want AVX2/AVX512. But it does not seem to perform any
# better than the lowest-denomimation code on at least the 1135G7 and 5950X
# CPUs, and for both LP64 as well as ILP32 — it seems to be all within margin
# of error.
%make_build prefix=%{_prefix} libdir=%{_libdir}
%install
export CFLAGS="%{optflags} -DXXH_X86DISPATCH_ALLOW_AVX=1"
export CXXFLAGS="%{optflags}"
export LDFLAGS="%{?build_ldflags}"
%make_install prefix=%{_prefix} libdir=%{_libdir}
rm -rf %{buildroot}%{_libdir}/libxxhash.a
%check
export CFLAGS="%{optflags}"
export CXXFLAGS="%{optflags}"
export LDFLAGS="%{?build_ldflags}"
# not safe for parallel execution as it removes xxhash.o and recreates it with different flags
%make_build -j1 test
# the list is taken from test-all with non-working/irrelevant ones (such as ones that change the toolchain) removed
%make_build -j1 test test-unicode listL120 trailingWhitespace test-xxh-nnn-sums
%post -n libxxhash0 -p /sbin/ldconfig
%postun -n libxxhash0 -p /sbin/ldconfig
%ldconfig_scriptlets -n libxxhash0
%files
%license LICENSE