see
) hangs on Ubuntusee +into Gforth, nothing happens (you can get out of this state by pressing Ctrl-D).
sudo sysctl kernel.yama.ptrace_scope=0To make this permanent, edit (with superuser privileges)
/etc/sysctl.d/10-ptrace.conf
, and change the
line setting kernel.yama.ptrace_scope
to set it to 0:
kernel.yama.ptrace_scope = 0
' dump is discodeThis means that now
dump
is the "disassembler". While
the output is not as nice as the output of gdb when it works, it is
still better than a hanging gdb.
./prim:2309: error: aggregate value used where an integer was expected ./prim:2309: error: aggregate value used where an integer was expected ./prim:2328: error: aggregate value used where an integer was expected ./prim:2328: error: aggregate value used where an integer was expected ./prim:2360: error: incompatible types in assignment
wget http://www.complang.tuwien.ac.at/forth/gforth/Patches/0.6.2-ffcall-64bit.diff && patch -p0 <0.6.2-ffcall-64bit.diff && sleep 1 && touch engine/*.i kernel/aliases.fs kernel/prim.fs && configure && make
GFORTHD="./gforth-ditc -p .:." GFORTH="./gforth-ditc --die-on-signal -p .:. -i kernl32l.fi -e 3 exboot.fs startup.fs arch/386/asm.fs arch/386/disasm.fs" ./gforthmi gforth.fi --die-on-signal -p ".:~+:." -i kernl32l.fi -e 3 exboot.fs startup.fs arch/386/asm.fs arch/386/disasm.fs data offset=32D0E0 code in file included from *the terminal*:0 *evaluated string*:-1: images produced by different engines ...
Index: comp-i.fs =================================================================== RCS file: /usr/local/lib/cvs-repository/src-master/gforth/comp-i.fs,v retrieving revision 1.14 diff -u -r1.14 comp-i.fs --- comp-i.fs 2003/08/25 14:17:43 1.14 +++ comp-i.fs 2004/03/10 16:26:46 @@ -43,7 +43,7 @@ if ." : images have the same base address; producing only a data-relocatable image" cr else - offset abs expected-offset <> abort" images produced by different engines" + \ offset abs expected-offset <> abort" images produced by different engines" ." offset=" offset . cr 0 image1 i-field + ! 0 image2 i-field + ! endif
mmap()
was broken on Windows 9x/ME. See this Cygwin bug
report.
./configure no_dynamic_default=yes ./configure CC="gcc -DNDEBUG" ./configure CC="gcc -fno-reorder-blocks"Or compile with a different compiler (gcc-2.95.* produces the best code).
./prim:2309: aggregate value used where an integer was expected ./prim:2328: aggregate value used where an integer was expected ./prim:2360: incompatible types in assignment ./prim:2393: incompatible types in assignment ./prim:2417: incompatible types in assignment
./configure ac_cv_sizeof_long_long=8
./configure ac_cv_lib_avcall___builtin_avcall=no
. Note
that this reduces the ability to call dynamically linked C functions.
SYSTEM
and SH
do not work as expected
on Windows and MS-DOSs" dir" system \ file not found on W98SE s" edit" system \ file not found on W98SE s" edit.com" system \ works on W98SE s" xcopy" system \ works (but complains about missing parameters)
s" command /c dir" system s" command /c edit" system
wget http://www.complang.tuwien.ac.at/forth/gforth/Patches/0.6.2-debug.diff patch <0.6.2-debug.diff make make installNow you can use the debugger when using the gforth-itc engine (the debugger still does not work for gforth or gforth-fast).
patch -p0
Index: engine/main.c =================================================================== RCS file: /usr/local/lib/cvs-repository/src-master/gforth/engine/main.c,v retrieving revision 1.139 retrieving revision 1.140 diff -u -r1.139 -r1.140 --- engine/main.c.old 2004/01/20 19:07:41 1.139 +++ engine/main.c 2004/04/10 00:16:55 1.140 @@ -70,8 +70,21 @@ void engine_callback(Xt* fcall, void * alist) { + /* save global valiables */ + Cell *rp = RP; + Cell *sp = SP; + Float *fp = FP; + Address lp = LP; + clist = (va_alist)alist; - engine(fcall, SP, RP, FP, LP); + + engine(fcall, sp, rp, fp, lp); + + /* restore global variables */ + RP = rp; + SP = sp; + FP = fp; + LP = lp; } #endif
make install
, install-info complains
about a non-existing directory or somesuch, and then installation
stops. Such things happen with the Debian install-info, and (in a
different way) with install-info from texinfo 3.9.
make install infodir=/usr/share/infoThis means that all the gforth info files are installed there, which may lead to problems if you install them elsewhere in the next Gforth release.
Or (if you have texinfo 4.2) recreate the doc/gforth.ps file with
make doc DVI2PS="dvips -t letterSize -Z"
./gforth --die-on-signal -m 4M -p ".:~+:." -i kernl32l.fi -e 3 exboot.fs -e 'fpath= .|~+|.' -e 's" mach16b.fs"' ./kernel/main.fs -e "save-cross kernl16b.fi- /usr/local/bin/gforth-0.6.1 bye" make: *** [kernl16b.fi-] Segmentation fault
Alternatively, use the following configure call when building Gforth:
configure CC="gcc -fno-reorder-blocks -fno-inline" --enable-force-reg
in file included from *the terminal*:0 in file included from ../gforth-0.6.0/kernel/main.fs:92 in file included from ../gforth-0.6.0/kernel/kernel.fs:24 ../gforth-0.6.0/kernel/int.fs:733: CROSS: forward ['] cr catch if ^^ ...
make FORTHB='$(BUILDFORTH) -e 3 exboot.fs -e "128 allocate 2drop" -e "fpath= .|~+|$(srcdir)"'If another instance of the same problem occurs, switch back to normal make, or try varying the 128 above.
CC="gcc -fno-gcse" ./configure --enable-force-reg --enable-indirect-threadedThis has been tested and works on gcc version 2.96 20000731 (Red Hat Linux 7.1 2.96-81).
Alternatively, use the binary package.
Alternatively, use kgcc (in the compat-egcs package on Redhat 7.1) to
compile gforth (configure with CC=kgcc configure
). Using
gcc-2.95.3 (compiled from the source) is also known to work.
We used a trick in implementing non-primitives in direct threaded code (in particular constants); this trick pushes (through CALL) and pops a value on the stack, and the compiler, being unaware of this, must not use esp between these two instructions; this worked up to gcc-2.95, either because the compiler allocated registers well enough that it did not need the stack there, or because it did not schedule its spill code up across asm statements. In gcc-3.0.4, however (and presumably starting at gcc-2.96), these assumptions do not hold in general, and Gforth breaks.
./configure --enable-force-regand/or use another gcc version (gcc-2.95 recommended)
Alternatively, Jorge Acereda Maciá has produced a Gforth package for the Fink project.
-O0
when building
engine-ditc.o. Or install gcc from the sources (from a GNU
mirror, not the source RPM).
-O0
when building
engine-ditc.o.
-0e f. -0. ok 1e 0e f/ f. inf ok 1e -0e f/ f. -in ok 0e 0e f/ f. nan ok
strtod
for input and ecvt
for
output).
strtod
and
ecvt
that are not up to par with all the subtleties of
IEEE FP numbers.