[packages/crcutil] fix ftbfs on i686
glen
glen at pld-linux.org
Mon Jul 4 09:27:26 CEST 2016
commit 454580373e9403c4e1ae3bf9eaa64cf0df89bf58
Author: Elan Ruusamäe <glen at delfi.ee>
Date: Mon Jul 4 10:22:27 2016 +0300
fix ftbfs on i686
build-unclobber.patch | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++
crcutil.spec | 2 ++
2 files changed, 53 insertions(+)
---
diff --git a/crcutil.spec b/crcutil.spec
index 02b4064..992af5a 100644
--- a/crcutil.spec
+++ b/crcutil.spec
@@ -15,6 +15,7 @@ Patch0: detect-mcrc32.patch
Patch1: build-fix-tests.patch
Patch2: automake.patch
Patch3: library.patch
+Patch4: build-unclobber.patch
URL: https://code.google.com/archive/p/crcutil/
BuildRequires: autoconf
BuildRequires: automake
@@ -73,6 +74,7 @@ Dokumentacja API biblioteki %{name}.
%patch1 -p1
%patch2 -p1
%patch3 -p1
+%patch4 -p1
%build
%{__libtoolize}
diff --git a/build-unclobber.patch b/build-unclobber.patch
new file mode 100644
index 0000000..a44e656
--- /dev/null
+++ b/build-unclobber.patch
@@ -0,0 +1,51 @@
+Last-Update: 2015-01-26
+Forwarded: https://code.google.com/p/crcutil/issues/detail?id=6
+Author: Dmitry Smirnov <onlyjob at member.fsf.org>
+Description: Fix FTBFS by introducing <cpuid.h> which should be universally
+ available as part of GCC 4.4 and above. Please review.
+~~~~
+ libtool: compile: g++ -DHAVE_CONFIG_H -I. -D_FORTIFY_SOURCE=2 -mcrc32 -msse2 -DCRCUTIL_USE_ASM=0 -DCRCUTIL_USE_MM_CRC32=1 -Wall -msse2 -Icode -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -c code/multiword_128_64_gcc_amd64_sse2.cc -fPIE -o code/multiword_128_64_gcc_amd64_sse2.o >/dev/null 2>&1
+ code/crc32c_sse4.cc: In static member function 'static bool crcutil::Crc32cSSE4::IsSSE42Available()':
+ code/crc32c_sse4.cc:331:4: error: PIC register clobbered by '%ebx' in 'asm'
+ );
+ ^
+ Makefile:685: recipe for target 'code/crc32c_sse4.lo' failed
+~~~~
+
+--- a/code/crc32c_sse4.cc
++++ b/code/crc32c_sse4.cc
+@@ -18,8 +18,9 @@
+
+ #include "crc32c_sse4.h"
+
+ #if HAVE_I386 || HAVE_AMD64
++#include <cpuid.h>
+
+ namespace crcutil {
+
+ #define UPDATE_STRIPE_CRCS(index, block_size, num_stripes) do { \
+@@ -310,8 +311,14 @@
+ #if defined(_MSC_VER)
+ int cpu_info[4];
+ __cpuid(cpu_info, 1);
+ return ((cpu_info[3] & (1 << 20)) != 0);
++#else
++ unsigned int eax, ebx, ecx;
++ unsigned int cpuid_edx=0;
++ __get_cpuid(1, &eax, &ebx, &ecx, &cpuid_edx);
++ return ((ecx & (1 << 20)) != 0);
++/*
+ #elif defined(__GNUC__) && (HAVE_AMD64 || HAVE_I386)
+ // Not using "cpuid.h" intentionally: it is missing from
+ // too many installations.
+ uint32 eax;
+@@ -331,8 +338,9 @@
+ );
+ return ((ecx & (1 << 20)) != 0);
+ #else
+ return false;
++*/
+ #endif
+ }
+
+
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/crcutil.git/commitdiff/454580373e9403c4e1ae3bf9eaa64cf0df89bf58
More information about the pld-cvs-commit
mailing list