The package rpms/xxhash.git has added or updated architecture specific content in its
spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s):
https://src.fedoraproject.org/cgit/rpms/xxhash.git/commit/?id=e2be4a9aef3....
Change:
+%ifarch %{ix86} x86_64
Thanks.
Full change:
============
commit e2be4a9aef3466d064de1e86644e808aaf516d62
Author: Mattias Ellert <mattias.ellert(a)physics.uu.se>
Date: Sat Jun 27 21:12:43 2020 +0200
Update to version 0.7.4
Enable runtime detection of sse2/avx2/avx512 on intel architectures
Fix compiler warning for 32 bit architectures
diff --git a/sources b/sources
index c0fd621..aa0bc5d 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (xxhash-0.7.3.tar.gz) =
72949010a267f063768241b182464c386005b4078f56902fee2f7804bd01f6c27878a6a4ec2a266cd59162934a7e471264ac5757dba570a97a2b5dad7703c664
+SHA512 (xxhash-0.7.4.tar.gz) =
9dbf8424b355d6551c18cff7ed7dbd26d4e5735b9a07fe54911b7438d6ffed3a3c2429ac09b616de630ea16cf32ff73529b6c3fad4af78ae0cb2b06155086aea
diff --git a/xxhash-compiler-warning-32-bit.patch b/xxhash-compiler-warning-32-bit.patch
new file mode 100644
index 0000000..a96ffee
--- /dev/null
+++ b/xxhash-compiler-warning-32-bit.patch
@@ -0,0 +1,29 @@
+From 3a262b04ab139c7ba728b4fa6b3525437a298066 Mon Sep 17 00:00:00 2001
+From: Mattias Ellert <mattias.ellert(a)physics.uu.se>
+Date: Sat, 27 Jun 2020 20:05:58 +0200
+Subject: [PATCH] Fix compiler warning for 32 bit architectures
+
+In file included from xxhash.h:2065,
+ from xxhash.c:43:
+xxh3.h: In function 'XXH3_len_9to16_128b':
+xxh3.h:2278: warning: integer constant is too large for 'long' type
+---
+ xxh3.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/xxh3.h b/xxh3.h
+index 07cd911..9b547db 100644
+--- a/xxh3.h
++++ b/xxh3.h
+@@ -2275,7 +2275,7 @@ XXH3_len_9to16_128b(const xxh_u8* input, size_t len, const xxh_u8*
secret, XXH64
+ * On 32-bit, it removes an ADC and delays a dependency between the two
+ * halves of m128.high64, but it generates an extra mask on 64-bit.
+ */
+- m128.high64 += (input_hi & 0xFFFFFFFF00000000) +
XXH_mult32to64((xxh_u32)input_hi, XXH_PRIME32_2);
++ m128.high64 += (input_hi & 0xFFFFFFFF00000000ULL) +
XXH_mult32to64((xxh_u32)input_hi, XXH_PRIME32_2);
+ } else {
+ /*
+ * 64-bit optimized (albeit more confusing) version.
+--
+2.26.2
+
diff --git a/xxhash.spec b/xxhash.spec
index 4b7abb7..c8a2549 100644
--- a/xxhash.spec
+++ b/xxhash.spec
@@ -1,5 +1,5 @@
Name: xxhash
-Version: 0.7.3
+Version: 0.7.4
Release: 1%{?dist}
Summary: Extremely fast hash algorithm
@@ -8,6 +8,9 @@ Summary: Extremely fast hash algorithm
License: BSD and GPLv2+
URL:
http://www.xxhash.com/
Source0:
https://github.com/Cyan4973/xxHash/archive/v%{version}/%{name}-%{version}...
+# Fix compiler warning for 32 bit architectures
+#
https://github.com/Cyan4973/xxHash/pull/411
+Patch0: %{name}-compiler-warning-32-bit.patch
BuildRequires: gcc
@@ -39,12 +42,26 @@ Development files for the xxhash library
%prep
%setup -q -n xxHash-%{version}
+%patch0 -p1
%build
-make %{?_smp_mflags} CFLAGS="%{optflags}" MOREFLAGS="%{?__global_ldflags}
-fPIC"
+# Enable runtime detection of sse2/avx2/avx512 on intel architectures
+%ifarch %{ix86} x86_64
+# The compiler version in EPEL 6 and 7 does not support avx
+%if %{?rhel}%{!?rhel:0} == 6 || %{?rhel}%{!?rhel:0} == 7
+%global dispatch 0
+%else
+%global dispatch 1
+%endif
+%else
+%global dispatch 0
+%endif
+
+%make_build MOREFLAGS="%{__global_cflags} %{?__global_ldflags}" \
+ DISPATCH=%{dispatch}
%install
-make install DESTDIR=%{buildroot} PREFIX=%{_prefix} LIBDIR=%{_libdir}
+%make_install PREFIX=%{_prefix} LIBDIR=%{_libdir}
rm %{buildroot}/%{_libdir}/libxxhash.a
%check
@@ -71,6 +88,11 @@ make test-xxhsum-c
%{_libdir}/pkgconfig/libxxhash.pc
%changelog
+* Sat Jun 27 2020 Mattias Ellert <mattias.ellert(a)physics.uu.se> - 0.7.4-1
+- Update to version 0.7.4
+- Enable runtime detection of sse2/avx2/avx512 on intel architectures
+- Fix compiler warning for 32 bit architectures
+
* Fri Mar 06 2020 Mattias Ellert <mattias.ellert(a)physics.uu.se> - 0.7.3-1
- Update to version 0.7.3
- Drop patch xxhash-gcc10-altivec.patch (accepted upstream)