forked from pool/cmake
Dirk Mueller
b9fb0278b0
- 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
51 lines
2.6 KiB
Diff
51 lines
2.6 KiB
Diff
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
|