Hi dear g'forthers,
I have checked out the CVS repository and - as announced - it didn't
compile.
Well, now it does better :) Below is the patch. Not a big deal, I have
renamed clist as "gforth_clist" and "engine" as "gforth_engine"
everywhere it had to, and added a file that lacked (stamp-h.in).
At some moment the script BUILD-FROM-SCRATCH hangs. I just kill it and
type "make", and it do go away.
That it hangs may be related to a lot of warning messages from my
installed gforth (I mean the one to be found in PATH).
By example : "Primitive 4407, 7 of group 2 used in this image at
$401972cc (offset $10a3) is not implemented by this
engine (0.6.2); executing this code will crash." The curious thing is
that at this moment of the script, the local gforth binary is already
compiled and executes. So what is the need of using the installed gforth
? I must admit I have not yet understood everything.
Note, "make docdist" doesn't work.
... makeinfo gforth.texi
/tmp/gforth/doc//gforth.texi:17496: Prev field of node `Callbacks' not
pointed to.
/tmp/gforth/doc//gforth.texi:17456: This node (Declaring C Functions)
has the bad Next.
/tmp/gforth/doc//gforth.texi:17456: Prev field of node `Declaring C
Functions' not pointed to.
/tmp/gforth/doc//gforth.texi:17389: This node (Calling C Functions) has
the bad Next.
/tmp/gforth/doc//gforth.texi:17392: Cross reference to nonexistent node
`Declaring C functions' (perhaps incorrect sectioning?).
BTW I have two questions:
1) does anybody knows if/how one can skip CVS directories while diff'ing ?
2) How do I test a new gforth build ? ( playing sokoban is not quite
enough, I guess :)
Hope it helps,
Cheers,
Sylvain Nahas
>>----------------------- BEGIN OF PATCH
diff -Naur gforth/engine/engine.c gforth2/engine/engine.c
--- gforth/engine/engine.c 2006-01-05 02:37:32.000000000 +0100
+++ gforth2/engine/engine.c 2006-03-11 19:43:15.604170128 +0100
@@ -255,7 +255,7 @@
#elif ENGINE==2
/* variant with padding between VM instructions for finding out
cross-inst jumps (for dynamic code) */
-#define engine engine2
+#define gforth_engine gforth_engine2
#define VARIANT(v) (v)
#define JUMP(target) goto I_noop
#define LABEL(name) H_##name: SKIP16; I_##name:
@@ -263,7 +263,7 @@
#elif ENGINE==3
/* variant with different immediate arguments for finding out
immediate arguments (for native code) */
-#define engine engine3
+#define gforth_engine gforth_engine3
#define VARIANT(v) ((v)^0xffffffff)
#define JUMP(target) goto K_lit
#define LABEL(name) H_##name: asm(""); I_##name:
@@ -275,7 +275,7 @@
#define LABEL2(name) K_##name: asm("");
#define LABEL3(name) J_##name: asm("");
-Label *engine(Xt *ip0, Cell *sp0, Cell *rp0, Float *fp0, Address lp0)
+Label *gforth_engine(Xt *ip0, Cell *sp0, Cell *rp0, Float *fp0, Address
lp0)
/* executes code at ip, if ip!=NULL
returns array of machine code labels (for use in a loader), if ip==NULL
*/
@@ -296,7 +296,7 @@
#endif
#ifdef HAS_FFCALL
av_alist alist;
- extern va_alist clist;
+ extern va_alist gforth_clist;
float frv;
int irv;
double drv;
@@ -305,7 +305,7 @@
#endif
#ifdef HAS_LIBFFI
extern void * ritem;
- extern void ** clist;
+ extern void ** gforth_clist;
extern void ffi_callback(ffi_cif * cif, void * resp, void ** args, Xt
* ip);
#endif
register Address up UPREG = gforth_UP;
diff -Naur gforth/engine/forth.h gforth2/engine/forth.h
--- gforth/engine/forth.h 2006-01-05 02:37:33.000000000 +0100
+++ gforth2/engine/forth.h 2006-03-11 19:43:10.772904592 +0100
@@ -310,9 +310,9 @@
#define IOR(flag) ((flag)? -512-errno : 0)
-Label *engine(Xt *ip, Cell *sp, Cell *rp, Float *fp, Address lp);
-Label *engine2(Xt *ip, Cell *sp, Cell *rp, Float *fp, Address lp);
-Label *engine3(Xt *ip, Cell *sp, Cell *rp, Float *fp, Address lp);
+Label *gforth_engine(Xt *ip, Cell *sp, Cell *rp, Float *fp, Address lp);
+Label *gforth_engine2(Xt *ip, Cell *sp, Cell *rp, Float *fp, Address lp);
+Label *gforth_engine3(Xt *ip, Cell *sp, Cell *rp, Float *fp, Address lp);
/* engine/prim support routines */
Address gforth_alloc(Cell size);
diff -Naur gforth/engine/main.c gforth2/engine/main.c
--- gforth/engine/main.c 2006-01-05 02:37:33.000000000 +0100
+++ gforth2/engine/main.c 2006-03-11 19:43:05.464711560 +0100
@@ -94,7 +94,7 @@
#include <ffi.h>
-void ** clist;
+void ** gforth_clist;
void * ritem;
void gforth_callback(ffi_cif * cif, void * resp, void ** args, Xt * ip)
@@ -104,10 +104,10 @@
Float *fp = gforth_FP;
Address lp = gforth_LP;
- clist = args;
+ gforth_clist = args;
ritem = resp;
- engine(ip, sp, rp, fp, lp);
+ gforth_engine(ip, sp, rp, fp, lp);
/* restore global variables */
gforth_RP = rp;
@@ -663,12 +663,12 @@
#endif /* !defined(GFORTH_DEBUGGING) */
/* fprintf(stderr, "rp=$%x\n",rp0);*/
- return((int)(Cell)engine(image_header->throw_entry,
signal_data_stack+15,
+ return((int)(Cell)gforth_engine(image_header->throw_entry,
signal_data_stack+15,
rp0, signal_fp_stack, 0));
}
#endif
- return((int)(Cell)engine(ip0,sp0,rp0,fp0,lp0));
+ return((int)(Cell)gforth_engine(ip0,sp0,rp0,fp0,lp0));
}
#ifndef INCLUDE_IMAGE
@@ -863,9 +863,9 @@
#ifndef NO_DYNAMIC
if (no_dynamic)
return;
- symbols2=engine2(0,0,0,0,0);
+ symbols2=gforth_engine2(0,0,0,0,0);
#if NO_IP
- symbols3=engine3(0,0,0,0,0);
+ symbols3=gforth_engine3(0,0,0,0,0);
#else
symbols3=symbols1;
#endif
@@ -1700,7 +1700,7 @@
#endif
;
- vm_prims = engine(0,0,0,0,0);
+ vm_prims = gforth_engine(0,0,0,0,0);
check_prims(vm_prims);
prepare_super_table();
#ifndef DOUBLY_INDIRECT
@@ -2130,7 +2130,7 @@
set_stack_sizes((ImageHeader *)image);
if(((ImageHeader *)image)->base != image)
gforth_relocate(image, reloc_bits, ((ImageHeader *)image)->image_size,
- (Label*)engine(0, 0, 0, 0, 0));
+ (Label*)gforth_engine(0, 0, 0, 0, 0));
alloc_stacks((ImageHeader *)image);
#else
image_file = open_image_file(imagename, path);
diff -Naur gforth/prim gforth2/prim
--- gforth/prim 2006-02-19 18:27:12.000000000 +0100
+++ gforth2/prim 2006-03-11 19:42:58.014844112 +0100
@@ -2587,69 +2587,69 @@
c_addr = (char *)alloc_callback(gforth_callback, (Xt *)a_ip);
va-start-void ( -- ) gforth va_start_void
-va_start_void(clist);
+va_start_void(gforth_clist);
va-start-int ( -- ) gforth va_start_int
-va_start_int(clist);
+va_start_int(gforth_clist);
va-start-longlong ( -- ) gforth va_start_longlong
-va_start_longlong(clist);
+va_start_longlong(gforth_clist);
va-start-ptr ( -- ) gforth va_start_ptr
-va_start_ptr(clist, (char *));
+va_start_ptr(gforth_clist, (char *));
va-start-float ( -- ) gforth va_start_float
-va_start_float(clist);
+va_start_float(gforth_clist);
va-start-double ( -- ) gforth va_start_double
-va_start_double(clist);
+va_start_double(gforth_clist);
va-arg-int ( -- w ) gforth va_arg_int
-w = va_arg_int(clist);
+w = va_arg_int(gforth_clist);
va-arg-longlong ( -- d ) gforth va_arg_longlong
#ifdef BUGGY_LONG_LONG
-DLO_IS(d, va_arg_longlong(clist));
+DLO_IS(d, va_arg_longlong(gforth_clist));
DHI_IS(d, 0);
#else
-d = va_arg_longlong(clist);
+d = va_arg_longlong(gforth_clist);
#endif
va-arg-ptr ( -- c_addr ) gforth va_arg_ptr
-c_addr = (char *)va_arg_ptr(clist,char*);
+c_addr = (char *)va_arg_ptr(gforth_clist,char*);
va-arg-float ( -- r ) gforth va_arg_float
-r = va_arg_float(clist);
+r = va_arg_float(gforth_clist);
va-arg-double ( -- r ) gforth va_arg_double
-r = va_arg_double(clist);
+r = va_arg_double(gforth_clist);
va-return-void ( -- ) gforth va_return_void
-va_return_void(clist);
+va_return_void(gforth_clist);
return 0;
va-return-int ( w -- ) gforth va_return_int
-va_return_int(clist, w);
+va_return_int(gforth_clist, w);
return 0;
va-return-ptr ( c_addr -- ) gforth va_return_ptr
-va_return_ptr(clist, void *, c_addr);
+va_return_ptr(gforth_clist, void *, c_addr);
return 0;
va-return-longlong ( d -- ) gforth va_return_longlong
#ifdef BUGGY_LONG_LONG
-va_return_longlong(clist, d.lo);
+va_return_longlong(gforth_clist, d.lo);
#else
-va_return_longlong(clist, d);
+va_return_longlong(gforth_clist, d);
#endif
return 0;
va-return-float ( r -- ) gforth va_return_float
-va_return_float(clist, r);
+va_return_float(gforth_clist, r);
return 0;
va-return-double ( r -- ) gforth va_return_double
-va_return_double(clist, r);
+va_return_double(gforth_clist, r);
return 0;
\+
@@ -2699,24 +2699,24 @@
#endif
ffi-arg-int ( -- w ) gforth ffi_arg_int
-w = *(int *)(*clist++);
+w = *(int *)(*gforth_clist++);
ffi-arg-longlong ( -- d ) gforth ffi_arg_longlong
#ifdef BUGGY_LONG_LONG
-DLO_IS(d, (Cell*)(*clist++));
+DLO_IS(d, (Cell*)(*gforth_clist++));
DHI_IS(d, 0);
#else
-d = *(DCell*)(*clist++);
+d = *(DCell*)(*gforth_clist++);
#endif
ffi-arg-ptr ( -- c_addr ) gforth ffi_arg_ptr
-c_addr = *(char **)(*clist++);
+c_addr = *(char **)(*gforth_clist++);
ffi-arg-float ( -- r ) gforth ffi_arg_float
-r = *(float*)(*clist++);
+r = *(float*)(*gforth_clist++);
ffi-arg-double ( -- r ) gforth ffi_arg_double
-r = *(double*)(*clist++);
+r = *(double*)(*gforth_clist++);
ffi-ret-void ( -- ) gforth ffi_ret_void
return 0;
diff -Naur gforth/stamp-h.in gforth2/stamp-h.in
--- gforth/stamp-h.in 1970-01-01 01:00:00.000000000 +0100
+++ gforth2/stamp-h.in 2006-03-11 19:42:48.629270936 +0100
@@ -0,0 +1 @@
+timestamp
>>----------------------- END OF PATCH
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]