[packages/redis] patch to make arm arch check more consistent

atler atler at pld-linux.org
Sat Sep 3 20:26:54 CEST 2022


commit 34f87d6a75db82024bf63dda4f048b2ab80d0ba5
Author: Jan Palus <atler at pld-linux.org>
Date:   Sat Sep 3 18:35:16 2022 +0200

    patch to make arm arch check more consistent

 arm-arch-check.patch | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 redis.spec           |  2 ++
 2 files changed, 58 insertions(+)
---
diff --git a/redis.spec b/redis.spec
index 7d9a888..3ee5a25 100644
--- a/redis.spec
+++ b/redis.spec
@@ -25,6 +25,7 @@ Source3:	%{name}.tmpfiles
 Patch0:		%{name}.conf.patch
 Patch1:		%{name}-tcl.patch
 Patch2:		0001-1st-man-pageis-for-redis-cli-redis-benchmark-redis-c.patch
+Patch3:		arm-arch-check.patch
 URL:		http://www.redis.io/
 %{?with_perftools:BuildRequires:    gperftools-devel}
 BuildRequires:	jemalloc-static
@@ -77,6 +78,7 @@ disk.
 %patch0 -p1
 %patch1 -p1
 %patch2 -p1
+%patch3 -p1
 
 # Remove integration tests
 %{__sed} -i -e '/    integration\/replication/d' tests/test_helper.tcl
diff --git a/arm-arch-check.patch b/arm-arch-check.patch
new file mode 100644
index 0000000..be45bc9
--- /dev/null
+++ b/arm-arch-check.patch
@@ -0,0 +1,56 @@
+From 2ad19f9492fa21ea733f191a38b379ca31f4657d Mon Sep 17 00:00:00 2001
+From: Jan Palus <jpalus at fastmail.com>
+Date: Sat, 3 Sep 2022 18:27:24 +0200
+Subject: [PATCH] Make ARM arch check more consistent
+
+There are three different type of checks if build is for ARM:
+- exact (ifneq0 match for only armv6 and armv7 (arm < 6 not being
+  included)
+- filter match (broken due to lack of wildcard)
+- substring match
+
+Unifiy them all and settle for $(filter armv%,$(uname_M)) as most
+generic and correct.
+---
+ src/Makefile | 10 ++++------
+ 1 file changed, 4 insertions(+), 6 deletions(-)
+
+diff --git a/src/Makefile b/src/Makefile
+index fdfef2b3c..7334ab9d8 100644
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -57,19 +57,17 @@ endif
+ 
+ # Default allocator defaults to Jemalloc if it's not an ARM
+ MALLOC=libc
+-ifneq ($(uname_M),armv6l)
+-ifneq ($(uname_M),armv7l)
++ifeq (,$(filter armv%,$(uname_M)))
+ ifeq ($(uname_S),Linux)
+ 	MALLOC=jemalloc
+ endif
+ endif
+-endif
+ 
+ # To get ARM stack traces if Redis crashes we need a special C flag.
+-ifneq (,$(filter aarch64 armv,$(uname_M)))
++ifneq (,$(filter aarch64 armv%,$(uname_M)))
+         CFLAGS+=-funwind-tables
+ else
+-ifneq (,$(findstring armv,$(uname_M)))
++ifneq (,$(filter armv%,$(uname_M)))
+         CFLAGS+=-funwind-tables
+ endif
+ endif
+@@ -121,7 +119,7 @@ FINAL_LIBS=-lm
+ DEBUG=-g -ggdb
+ 
+ # Linux ARM32 needs -latomic at linking time
+-ifneq (,$(findstring armv,$(uname_M)))
++ifneq (,$(filter armv%,$(uname_M)))
+         FINAL_LIBS+=-latomic
+ endif
+ 
+-- 
+2.37.3
+
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/redis.git/commitdiff/d3c8224c535a54a3951166cdb0e91bf7beb2bda4



More information about the pld-cvs-commit mailing list