[haveged/f16] fix compile on s390(x)

Dan Horák sharkcz at fedoraproject.org
Sat Nov 26 15:56:31 UTC 2011


commit 44f3581d553203b7e87ec5ec2d210c60ef911597
Author: Dan Horák <dan at danny.cz>
Date:   Sat Nov 26 16:56:02 2011 +0100

    fix compile on s390(x)
    
    Conflicts:
    
    	.gitignore

 .gitignore             |    1 -
 haveged-1.3_ppc.patch  |   49 ++++++++++++++++++++++++++++++++++++++++++++++++
 haveged-1.3_s390.patch |   43 ++++++++++++++++++++++++++++++++++++++++++
 haveged.spec           |    9 ++++++-
 sources                |    1 -
 5 files changed, 99 insertions(+), 4 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 720283c..9548116 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,2 @@
 /haveged-1.2.tar.gz
-/haveged-1.3_ppc.patch
 /haveged-1.3.tar.gz
diff --git a/haveged-1.3_ppc.patch b/haveged-1.3_ppc.patch
new file mode 100644
index 0000000..7a08f39
--- /dev/null
+++ b/haveged-1.3_ppc.patch
@@ -0,0 +1,49 @@
+diff -rupN haveged-1.3/configure haveged-1.3_patch/configure
+--- haveged-1.3/configure	2011-10-25 01:06:27.000000000 +0200
++++ haveged-1.3_patch/configure	2011-11-05 19:42:58.122471139 +0100
+@@ -4564,7 +4564,7 @@ case "$host" in
+     HA_CPPFLAGS="-DHAVE_ISA_IA64"
+  ;;
+ 
+- powerpc-*|pcc-*|powerpc64|ppc64)
++ powerpc-*|ppc-*|powerpc64-*|ppc64-*)
+     HA_CPPFLAGS="-DHAVE_ISA_PPC"
+  ;;
+ 
+diff -rupN haveged-1.3/configure.ac haveged-1.3_patch/configure.ac
+--- haveged-1.3/configure.ac	2011-10-25 01:06:27.000000000 +0200
++++ haveged-1.3_patch/configure.ac	2011-11-05 19:42:34.956557994 +0100
+@@ -81,7 +81,7 @@ case "$host" in
+     HA_CPPFLAGS="-DHAVE_ISA_IA64"
+  ;;
+ 
+- powerpc-*|pcc-*|powerpc64|ppc64)
++ powerpc-*|ppc-*|powerpc64-*|ppc64-*)
+     HA_CPPFLAGS="-DHAVE_ISA_PPC"
+  ;;
+ 
+diff -rupN haveged-1.3/ent/test.sh haveged-1.3_patch/ent/test.sh
+--- haveged-1.3/ent/test.sh	2011-10-25 01:06:27.000000000 +0200
++++ haveged-1.3_patch/ent/test.sh	2011-11-05 20:31:24.368879277 +0100
+@@ -1,5 +1,9 @@
+ #!/bin/sh
+ cd ent
++echo "./entest -t"
+ ./entest -t
++echo "../src/haveged -n 16384k -v 1 $*"
+ ../src/haveged -n 16384k -v 1 $*
++echo "./entest -vf sample"
+ ./entest -vf sample
++
+diff -rupN haveged-1.3/src/havege.c haveged-1.3_patch/src/havege.c
+--- haveged-1.3/src/havege.c	2011-10-25 01:06:28.000000000 +0200
++++ haveged-1.3_patch/src/havege.c	2011-11-06 01:20:49.054095370 +0100
+@@ -74,7 +74,7 @@ static int cache_configure(void)
+    else p[0]  = 0;
+    if (!strcmp(info.vendor,"amd") && configure_amd())
+       ;
+-   else if (configure_intel(p[0]))
++   else if (!strcmp(info.vendor,"intel") && configure_intel(p[0]))
+       ;
+    else {
+       info.generic = 1;
diff --git a/haveged-1.3_s390.patch b/haveged-1.3_s390.patch
new file mode 100644
index 0000000..4e998a9
--- /dev/null
+++ b/haveged-1.3_s390.patch
@@ -0,0 +1,43 @@
+diff -up haveged-1.3/configure.ac.s390 haveged-1.3/configure.ac
+--- haveged-1.3/configure.ac.s390	2011-11-25 10:33:44.784760266 -0500
++++ haveged-1.3/configure.ac	2011-11-25 10:34:02.044760923 -0500
+@@ -93,6 +93,10 @@ case "$host" in
+     HA_CPPFLAGS="-DHAVE_ISA_SPARC"
+  ;;
+ 
++ s390*-*)
++    HA_CPPFLAGS="-DHAVE_ISA_S390"
++ ;;
++
+  *)
+     echo "Unsupported host: $host";
+     exit 1
+diff -up haveged-1.3/configure.s390 haveged-1.3/configure
+--- haveged-1.3/configure.s390	2011-11-25 10:49:45.334762435 -0500
++++ haveged-1.3/configure	2011-11-25 10:37:49.964754934 -0500
+@@ -4585,6 +4585,10 @@ case "$host" in
+     HA_CPPFLAGS="-DHAVE_ISA_SPARC"
+  ;;
+ 
++ s390*-*)
++    HA_CPPFLAGS="-DHAVE_ISA_S390"
++ ;;
++
+  *)
+     echo "Unsupported host: $host";
+     exit 1
+diff -up haveged-1.3/src/havegecollect.h.s390 haveged-1.3/src/havegecollect.h
+--- haveged-1.3/src/havegecollect.h.s390	2011-11-25 10:34:13.574761327 -0500
++++ haveged-1.3/src/havegecollect.h	2011-11-25 10:35:30.934753116 -0500
+@@ -122,6 +122,11 @@ unsigned int havege_collect(volatile H_P
+ #define HARDCLOCK(x) ASM("mftb %0":"=r"(x)) /* eq. to mftb %0, 268 */
+ #endif
+ 
++#ifdef HAVE_ISA_S390
++#define ARCH "s390"
++#define HARDCLOCK(x) ASM("stck %0":"=Q"(x))
++#endif
++
+ #ifdef HAVE_ISA_IA64
+ #define ARCH "ia64"
+ #define CPUID(op,reg) ASM("mov %0=cpuid[%1]"\
diff --git a/haveged.spec b/haveged.spec
index b65cfc8..2502423 100644
--- a/haveged.spec
+++ b/haveged.spec
@@ -1,7 +1,7 @@
 Summary:        A Linux entropy source using the HAVEGE algorithm
 Name:           haveged
 Version:        1.3
-Release:        2%{?dist}
+Release:        3%{?dist}
 License:        GPLv3+
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 Group:          System Environment/Daemons
@@ -9,6 +9,7 @@ URL:            http://www.irisa.fr/caps/projects/hipsor/
 Source0:        http://www.issihosts.com/haveged/haveged-1.3.tar.gz
 #Source1:       test.gdb
 Patch0:         haveged-1.3_ppc.patch
+Patch1:         haveged-1.3_s390.patch
 #Source2:       cpuid-20110305.src.tar.gz
 # Patch represents changes planed for the version 1.3:
 # - changed run levels:
@@ -38,7 +39,8 @@ attempt to select appropriate values from internal tables.
 
 %prep
 %setup -q
-%patch0 -p1
+%patch0 -p1 -b .ppc
+%patch1 -p1 -b .s390
 
 %build
 autoreconf -fiv
@@ -102,6 +104,9 @@ fi
 %doc COPYING README ChangeLog AUTHORS
 
 %changelog
+* Fri Nov 25 2011 Dan Horák <dan[at]danny.cz> - 1.3-3
+- fix compile on s390(x)
+
 * Sat Nov 06 2011 Jirka Hladky <hladky.jiri at gmail.com> - 1.3-2
 - Fixed a bug on non x86 systems
 * Sat Nov 05 2011 Jirka Hladky <hladky.jiri at gmail.com> - 1.3-1
diff --git a/sources b/sources
index 7328ab7..ab6c78f 100644
--- a/sources
+++ b/sources
@@ -1,2 +1 @@
-99550e63b07ceb1924cdfca81e65c916  haveged-1.3_ppc.patch
 7e7fed038fa45f455610ed430ca30a5e  haveged-1.3.tar.gz


More information about the scm-commits mailing list