From b9fb0278b0954a2b72a4761f6ecb974d2f68d35948c7b8dd5d6e43b168f5f993 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Wed, 13 Oct 2021 13:58:16 +0000 Subject: [PATCH] Accepting request 925091 from home:Guillaume_G:branches:devel:tools:building - Fix bundled zstd to avoid a crash on armv6 - boo#1191588: * cmake-fix-zstd-armv6.patch OBS-URL: https://build.opensuse.org/request/show/925091 OBS-URL: https://build.opensuse.org/package/show/devel:tools:building/cmake?expand=0&rev=474 --- cmake-fix-zstd-armv6.patch | 50 ++++++++++++++++++++++++++++++++++++++ cmake.changes | 6 +++++ cmake.spec | 2 ++ 3 files changed, 58 insertions(+) create mode 100644 cmake-fix-zstd-armv6.patch diff --git a/cmake-fix-zstd-armv6.patch b/cmake-fix-zstd-armv6.patch new file mode 100644 index 0000000..331c63e --- /dev/null +++ b/cmake-fix-zstd-armv6.patch @@ -0,0 +1,50 @@ +From 28d0120b5ac62b56cd858bd46480c73730d044b4 Mon Sep 17 00:00:00 2001 +From: "Bernhard M. Wiedemann" +Date: Tue, 11 May 2021 17:46:55 +0200 +Subject: [PATCH] Avoid SIGBUS on armv6 + +When running armv6 userspace on armv8 hardware with a 64 bit Linux kernel, +the mode 2 caused SIGBUS (unaligned memory access). +Running all our arm builds in the build farm +only on armv8 simplifies administration a lot. + +Depending on compiler and environment, this change might slow down +memory accesses (did not benchmark it). The original analysis is 6 years old. + +Fixes #2632 +[Guillaume: Add Utilities/cmzstd/ prefix to apply in cmake +--- + /Utilities/cmzstd/lib/common/mem.h | 4 +--- + Utilities/cmzstd/lib/common/xxhash.c | 4 +--- + 2 files changed, 2 insertions(+), 6 deletions(-) + +diff --git a/Utilities/cmzstd/lib/common/mem.h b/Utilities/cmzstd/lib/common/mem.h +index dc6667c68b..9f3b81ab9d 100644 +--- a/Utilities/cmzstd/lib/common/mem.h ++++ b/Utilities/cmzstd/lib/common/mem.h +@@ -143,9 +143,7 @@ MEM_STATIC size_t MEM_swapST(size_t in); + * Prefer these methods in priority order (0 > 1 > 2) + */ + #ifndef MEM_FORCE_MEMORY_ACCESS /* can be defined externally, on command line for example */ +-# if defined(__GNUC__) && ( defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__) || defined(__ARM_ARCH_6T2__) ) +-# define MEM_FORCE_MEMORY_ACCESS 2 +-# elif defined(__INTEL_COMPILER) || defined(__GNUC__) || defined(__ICCARM__) ++# if defined(__INTEL_COMPILER) || defined(__GNUC__) || defined(__ICCARM__) + # define MEM_FORCE_MEMORY_ACCESS 1 + # endif + #endif +diff --git a/Utilities/cmzstd/lib/common/xxhash.c b/Utilities/cmzstd/lib/common/xxhash.c +index 0ddbf13a39..926b33604e 100644 +--- a/Utilities/cmzstd/lib/common/xxhash.c ++++ b/Utilities/cmzstd/lib/common/xxhash.c +@@ -30,9 +30,7 @@ + * Prefer these methods in priority order (0 > 1 > 2) + */ + #ifndef XXH_FORCE_MEMORY_ACCESS /* can be defined externally, on command line for example */ +-# if defined(__GNUC__) && ( defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__) || defined(__ARM_ARCH_6T2__) ) +-# define XXH_FORCE_MEMORY_ACCESS 2 +-# elif (defined(__INTEL_COMPILER) && !defined(WIN32)) || \ ++# if (defined(__INTEL_COMPILER) && !defined(WIN32)) || \ + (defined(__GNUC__) && ( defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7S__) )) || \ + defined(__ICCARM__) + # define XXH_FORCE_MEMORY_ACCESS 1 diff --git a/cmake.changes b/cmake.changes index 19b933f..1e2c81a 100644 --- a/cmake.changes +++ b/cmake.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Oct 13 12:34:11 UTC 2021 - Guillaume GARDET + +- Fix bundled zstd to avoid a crash on armv6 - boo#1191588: + * cmake-fix-zstd-armv6.patch + ------------------------------------------------------------------- Tue Sep 21 20:36:02 UTC 2021 - Andreas Stieger diff --git a/cmake.spec b/cmake.spec index b74f432..169c86b 100644 --- a/cmake.spec +++ b/cmake.spec @@ -55,6 +55,8 @@ Patch0: cmake-fix-ruby-test.patch # Search for python interpreters from newest to oldest rather then picking up /usr/bin/python as first choice Patch1: feature-suse-python-interp-search-order.patch Patch2: cmake-fix-png-include-dir.patch +# PATCH-FIX-UPSTREAM - https://gitlab.kitware.com/cmake/cmake/-/issues/22754 +Patch3: cmake-fix-zstd-armv6.patch BuildRequires: fdupes BuildRequires: gcc-c++ BuildRequires: pkgconfig