[gforth] fix build on s390

Dan Horák sharkcz at fedoraproject.org
Mon Mar 21 14:00:44 UTC 2011


commit 11ca6710265523c09ffea8c7ceb3f42b243849f2
Author: Dan Horák <dan at danny.cz>
Date:   Mon Mar 21 15:00:14 2011 +0100

    fix build on s390

 gforth-0.7.0-compile-fix.patch |   31 +++++++++++++++++++++++++++++++
 gforth.spec                    |    8 +++++++-
 2 files changed, 38 insertions(+), 1 deletions(-)
---
diff --git a/gforth-0.7.0-compile-fix.patch b/gforth-0.7.0-compile-fix.patch
new file mode 100644
index 0000000..b71f3c7
--- /dev/null
+++ b/gforth-0.7.0-compile-fix.patch
@@ -0,0 +1,31 @@
+diff -up gforth-0.7.0/engine/support.c.orig gforth-0.7.0/engine/support.c
+--- gforth-0.7.0/engine/support.c.orig	2008-11-01 23:06:35.000000000 +0100
++++ gforth-0.7.0/engine/support.c	2011-03-21 14:53:52.000000000 +0100
+@@ -724,16 +724,21 @@ DCell smdiv (DCell num, Cell denom)
+   DCell res;
+ #if defined(sdiv_qrnnd)
+   /* #warning "using sdiv_qrnnd" */
+-  Cell u1,q,r
++  Cell u1,q,r;
+   UCell u0;
+   UCell MAYBE_UNUSED lz;
+   
+-  vm_d2twoCell(u,u0,u1);
+-  if (v==0)
++  vm_d2twoCell(num,u0,u1);
++  if (denom==0)
+     throw(BALL_DIVZERO);
+-  if (u1>=v)
+-    throw(BALL_RESULTRANGE);
+-  sdiv_qrnnd(q,r,u1,u0,v);
++  sdiv_qrnnd(q,r,u1,u0,denom);
++  if ((u1^denom)<0) {
++    if (q>0)
++      throw(BALL_RESULTRANGE);
++  } else {
++    if (q<0)
++      throw(BALL_RESULTRANGE);
++  }
+   vm_twoCell2d(q,r,res);
+ #else
+   UDCell ures;
diff --git a/gforth.spec b/gforth.spec
index ac6d22b..ccc8821 100644
--- a/gforth.spec
+++ b/gforth.spec
@@ -1,6 +1,6 @@
 Name:           gforth
 Version:        0.7.0
-Release:        4%{?dist}
+Release:        5%{?dist}
 Summary:        Fast and portable implementation of the ANS Forth language
 
 Group:          Development/Languages
@@ -9,6 +9,8 @@ URL:            http://www.jwdt.com/~paysan/gforth.html
 Source:         http://www.complang.tuwien.ac.at/forth/gforth/gforth-0.7.0.tar.gz
 Patch0:		gforth-0.7.0-buildpath.patch
 Patch1:		gforth-0.7.0-shebang.patch
+# s390 build fix from Debian (http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=544827)
+Patch2:		gforth-0.7.0-compile-fix.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires:  m4
 BuildRequires:  libffi-devel
@@ -36,6 +38,7 @@ you can also use a traditional-style indirect threaded interpreter.
 %setup -q
 %patch0 -p1
 %patch1 -p1
+%patch2 -p1
 #sed -i 's/-fforce-mem//' configure
 iconv -f latin1 -t utf8 AUTHORS > AUTHORS.new
 mv -f AUTHORS.new AUTHORS
@@ -131,6 +134,9 @@ fi
 
 
 %changelog
+* Mon Mar 21 2011 Dan Horák <dan[at]danny.cz> - 0.7.0-5
+- fix build on s390
+
 * Fri Jul 24 2009 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.7.0-4
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
 


More information about the scm-commits mailing list