SHA256
3
0
forked from pool/cmake

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
This commit is contained in:
Dirk Mueller 2021-10-13 13:58:16 +00:00 committed by Git OBS Bridge
parent e7b9462dd9
commit b9fb0278b0
3 changed files with 58 additions and 0 deletions

View File

@ -0,0 +1,50 @@
From 28d0120b5ac62b56cd858bd46480c73730d044b4 Mon Sep 17 00:00:00 2001
From: "Bernhard M. Wiedemann" <bwiedemann@suse.de>
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

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Oct 13 12:34:11 UTC 2021 - Guillaume GARDET <guillaume.gardet@opensuse.org>
- 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 <andreas.stieger@gmx.de>

View File

@ -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