[gforth] added patches from Andrew Haley to fix build with -O2

Adrian Reber adrian at fedoraproject.org
Wed Apr 18 07:40:18 UTC 2012


commit fd1e66c0cb8ad2a85802f5434a2507b02dfd66ea
Author: Adrian Reber <adrian at lisas.de>
Date:   Wed Apr 18 09:40:14 2012 +0200

    added patches from Andrew Haley to fix build with -O2

 gforth-broken-disassembler.patch      |   11 +++++++++++
 gforth-newline-null-local-array.patch |   11 +++++++++++
 gforth.spec                           |   13 +++++++++----
 3 files changed, 31 insertions(+), 4 deletions(-)
---
diff --git a/gforth-broken-disassembler.patch b/gforth-broken-disassembler.patch
new file mode 100644
index 0000000..b0a5f1a
--- /dev/null
+++ b/gforth-broken-disassembler.patch
@@ -0,0 +1,11 @@
+--- a/dis-gdb.fs        Thu Apr 12 14:42:46 2012 +0100
++++ b/dis-gdb.fs        Thu Apr 12 14:51:21 2012 +0100
+@@ -25,7 +25,7 @@
+ : disasm-gdb { addr u -- }
+     base @ >r hex
+     s\" type mktemp >/dev/null && type gdb >/dev/null && file=`mktemp -t gforthdis.XXXXXXXXXX` && file2=`mktemp -t gforthdis.XXXXXXXXXX` && echo \"set verbose off\nset logging file $file\nset logging on\ndisas " save-mem ( addr u addr1 u1 )
+-    addr 0 <<# bl hold # #s 'x hold # #> append-extend-string #>>
++    addr 0 <<# bl hold ',' hold # #s 'x hold # #> append-extend-string #>>
+     addr u + 0 <<# # #s 'x hold # #> append-extend-string #>>
+     r> base ! cr
+     s\" \nset logging off\nquit\n\" >$file2 && gdb -nx -q -p `ps -p $$ -o ppid=` -x $file2 2>/dev/null >/dev/null && rm $file2 && grep -v \"of assembler\" $file && rm $file" append-extend-string
diff --git a/gforth-newline-null-local-array.patch b/gforth-newline-null-local-array.patch
new file mode 100644
index 0000000..5da7476
--- /dev/null
+++ b/gforth-newline-null-local-array.patch
@@ -0,0 +1,11 @@
+--- a/prim.old	2012-04-18 09:37:15.656620436 +0200
++++ b/prim	2012-04-18 09:37:19.177624128 +0200
+@@ -1950,7 +1950,7 @@
+ 
+ newline	( -- c_addr u )	gforth
+ ""String containing the newline sequence of the host OS""
+-char newline[] = {
++static const char newline[] = {
+ #if DIRSEP=='/'
+ /* Unix */
+ '\n'
diff --git a/gforth.spec b/gforth.spec
index 6710a8d..f241e90 100644
--- a/gforth.spec
+++ b/gforth.spec
@@ -1,6 +1,6 @@
 Name:           gforth
 Version:        0.7.0
-Release:        8%{?dist}
+Release:        9%{?dist}
 Summary:        Fast and portable implementation of the ANS Forth language
 
 Group:          Development/Languages
@@ -11,6 +11,8 @@ 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
+Patch3:		gforth-broken-disassembler.patch
+Patch4:		gforth-newline-null-local-array.patch
 BuildRequires:  m4 libtool-ltdl-devel
 BuildRequires:  libffi-devel
 Requires(post): /sbin/install-info
@@ -38,15 +40,15 @@ you can also use a traditional-style indirect threaded interpreter.
 %patch0 -p1
 %patch1 -p1
 %patch2 -p1
+%patch3 -p1
+%patch4 -p1
 #sed -i 's/-fforce-mem//' configure
 iconv -f latin1 -t utf8 AUTHORS > AUTHORS.new
 mv -f AUTHORS.new AUTHORS
 
 
 %build
-# -O1 and -O2 breaks the binary, all '\n' are replaced with '\0'
-# using -O0 to build it
-CFLAGS="${RPM_OPT_FLAGS} `pkg-config libffi --cflags` -O0" %configure
+CFLAGS="${RPM_OPT_FLAGS} `pkg-config libffi --cflags`" %configure
 # %{_smp_mflags} breaks the build
 make libdir=%{_libdir}
 
@@ -130,6 +132,9 @@ fi
 
 
 %changelog
+* Wed Apr 18 2012 Adrian Reber <adrian at lisas.de> - 0.7.0-9
+- added patches from Andrew Haley to fix build with -O2
+
 * Thu Apr 05 2012 Adrian Reber <adrian at lisas.de> - 0.7.0-8
 - build with -O0 until bug with -O2 is found
 


More information about the scm-commits mailing list