[packages/sheepdog] - up to 0.9.2 - add upstream fix for ix86 targets

baggins baggins at pld-linux.org
Sun Aug 9 11:50:39 CEST 2015


commit 5f5b4b33fedf95d1c2c1f8e901da0bd94a077a98
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Sun Aug 9 11:50:14 2015 +0200

    - up to 0.9.2
    - add upstream fix for ix86 targets

 32bits-targets.patch | 99 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 ix86-cpus.patch      | 15 --------
 sheepdog.spec        |  6 ++--
 3 files changed, 102 insertions(+), 18 deletions(-)
---
diff --git a/sheepdog.spec b/sheepdog.spec
index c6835a2..cf7bcd4 100644
--- a/sheepdog.spec
+++ b/sheepdog.spec
@@ -6,13 +6,13 @@
 Summary:	Sheepdog - distributed storage system for QEMU/KVM
 Summary(pl.UTF-8):	Sheepdog - rozproszony system przechowywania danych dla QEMU/KVM
 Name:		sheepdog
-Version:	0.9.0
+Version:	0.9.2
 Release:	1
 License:	GPL v2
 Group:		Applications/System
 Source0:	https://github.com/collie/sheepdog/tarball/v%{version}/%{name}-%{version}.tar.gz
-# Source0-md5:	47f2381734a2e3f9ed4b10ef38254ba9
-Patch0:		ix86-cpus.patch
+# Source0-md5:	f00856d60425202cb9d3c1c834d7d9ec
+Patch0:		32bits-targets.patch
 URL:		http://www.osrg.net/sheepdog/
 BuildRequires:	autoconf >= 2.61
 BuildRequires:	automake
diff --git a/32bits-targets.patch b/32bits-targets.patch
new file mode 100644
index 0000000..c54f746
--- /dev/null
+++ b/32bits-targets.patch
@@ -0,0 +1,99 @@
+From 1b0dafa7a6920dd2e9ce97a1c8c084e4c8fc5f68 Mon Sep 17 00:00:00 2001
+From: Alexander Evseev <aevseev at mirantis.com>
+Date: Wed, 29 Jul 2015 16:13:32 +0300
+Subject: [PATCH] Fix build for 32 bit targets
+
+  * Define CPU flags for non-x86_64 targets
+  * Use non-SSE version of ec_encode_data for non-x86_64 targets
+  * Add make variable "arch" as it should be used in isa-l
+
+Signed-off-by: Alexander Evseev <aevseev at mirantis.com>
+---
+ configure.ac       |  1 +
+ include/compiler.h |  6 ++++++
+ lib/Makefile.am    | 14 ++++++++++++--
+ lib/fec.c          |  5 ++++-
+ 4 files changed, 23 insertions(+), 3 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index e637f42..66b733b 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -199,6 +199,7 @@ LINT_FLAGS="-weak -unrecog +posixlib +ignoresigns -fcnuse \
+ 	-badflag -D__gnuc_va_list=va_list -D__attribute\(x\)="
+ 
+ AM_CONDITIONAL(BUILD_SHA1_HW, [[[[ $host = *x86_64* ]]]])
++AM_CONDITIONAL(X86_64,        [[[[ $host = *x86_64* ]]]])
+ 
+ AC_ARG_ENABLE([fatal-warnings],
+ 	[  --enable-fatal-warnings : enable fatal warnings. ],
+diff --git a/include/compiler.h b/include/compiler.h
+index 3c68b75..64ab6b4 100644
+--- a/include/compiler.h
++++ b/include/compiler.h
+@@ -155,6 +155,12 @@ static inline uint64_t xgetbv(uint32_t idx)
+ #define cpu_has_avx		cpu_has(X86_FEATURE_AVX)
+ #define cpu_has_osxsave		cpu_has(X86_FEATURE_OSXSAVE)
+ 
++#else  /* __x86_64__ */
++
++#define cpu_has_ssse3   0
++#define cpu_has_avx     0
++#define cpu_has_osxsave 0
++
+ #endif /* __x86_64__ */
+ 
+ #endif	/* SD_COMPILER_H */
+diff --git a/lib/Makefile.am b/lib/Makefile.am
+index dec81c7..dfb2fb0 100644
+--- a/lib/Makefile.am
++++ b/lib/Makefile.am
+@@ -38,7 +38,7 @@ libsd_a_SOURCES		= event.c logger.c net.c util.c rbtree.c strbuf.c \
+ 			  sha1.c option.c work.c sockfd_cache.c fec.c \
+ 			  sd_inode.c common.c
+ 
+-libsd_a_LIBADD		= isa-l/bin/ec_base.o \
++libsd_a_LIBADD_		= isa-l/bin/ec_base.o \
+ 			  isa-l/bin/ec_highlevel_func.o \
+ 			  isa-l/bin/ec_multibinary.o \
+ 			  isa-l/bin/gf_2vect_dot_prod_sse.o \
+@@ -50,6 +50,16 @@ libsd_a_LIBADD		= isa-l/bin/ec_base.o \
+ 			  isa-l/bin/gf_vect_mul_avx.o \
+ 			  isa-l/bin/gf_vect_mul_sse.o
+ 
++libsd_a_LIBADD_32	= isa-l/bin/ec_base.o \
++			  isa-l/bin/ec_highlevel_func.o \
++			  isa-l/bin/ec_multibinary.o
++
++if !X86_64
++arch = 32
++endif
++
++libsd_a_LIBADD		= $(libsd_a_LIBADD_$(arch))
++
+ if BUILD_SHA1_HW
+ libsd_a_SOURCES		+= sha1_ssse3.S
+ endif
+@@ -74,7 +84,7 @@ check-style:
+ 	@$(CHECK_STYLE) $(libsd_a_SOURCES)
+ 
+ libisa.a:
+-	cd isa-l/ && $(MAKE) && cd ..
++	cd isa-l/ && $(MAKE) arch=$(arch) && cd ..
+ 
+ clean-local:
+ 	rm -f *.o gmon.out *.da *.bb *.bbg
+diff --git a/lib/fec.c b/lib/fec.c
+index e0908bc..e2d5cd1 100644
+--- a/lib/fec.c
++++ b/lib/fec.c
+@@ -739,5 +739,8 @@ void isa_decode_buffer(struct fec *ctx, uint8_t *input[], const int in_idx[],
+ 
+ 	lost[0] = (unsigned char *)buf;
+ 	ec_init_tables(ed, 1, cm, ec_tbl);
+-	ec_encode_data_sse(len, ed, 1, ec_tbl, input, lost);
++	if (cpu_has_ssse3)
++		ec_encode_data_sse(len, ed, 1, ec_tbl, input, lost);
++	else
++		ec_encode_data(len, ed, 1, ec_tbl, input, lost);
+ }
diff --git a/ix86-cpus.patch b/ix86-cpus.patch
deleted file mode 100644
index 7c339c8..0000000
--- a/ix86-cpus.patch
+++ /dev/null
@@ -1,15 +0,0 @@
---- sheepdog-sheepdog-c648986/include/compiler.h~	2014-10-31 07:32:03.000000000 +0100
-+++ sheepdog-sheepdog-c648986/include/compiler.h	2015-07-25 13:14:37.507366860 +0200
-@@ -164,6 +164,12 @@
- #define cpu_has_avx		cpu_has(X86_FEATURE_AVX)
- #define cpu_has_osxsave		cpu_has(X86_FEATURE_OSXSAVE)
- 
-+#else
-+
-+#define cpu_has_ssse3           0
-+#define cpu_has_avx		0
-+#define cpu_has_osxsave		0
-+
- #endif /* __x86_64__ */
- 
- #endif	/* SD_COMPILER_H */
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/sheepdog.git/commitdiff/5f5b4b33fedf95d1c2c1f8e901da0bd94a077a98



More information about the pld-cvs-commit mailing list