|
|
385abae |
Description: <short summary of the patch>
|
|
|
385abae |
TODO: Put a short summary on the line above and replace this paragraph
|
|
|
385abae |
with a longer explanation of this change. Complete the meta-information
|
|
|
385abae |
with other relevant fields (see below for details). To make it easier, the
|
|
|
385abae |
information below has been extracted from the changelog. Adjust it or drop
|
|
|
385abae |
it.
|
|
|
385abae |
.
|
|
|
385abae |
gcl (2.6.12-26) unstable; urgency=medium
|
|
|
385abae |
.
|
|
|
385abae |
* Version_2_6_13pre32
|
|
|
385abae |
Author: Camm Maguire <camm@debian.org>
|
|
|
385abae |
|
|
|
385abae |
---
|
|
|
385abae |
The information above should follow the Patch Tagging Guidelines, please
|
|
|
385abae |
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
|
|
|
385abae |
are templates for supplementary fields that you might want to add:
|
|
|
385abae |
|
|
|
385abae |
Origin: <vendor|upstream|other>, <url of original patch>
|
|
|
385abae |
Bug: <url in upstream bugtracker>
|
|
|
385abae |
Bug-Debian: https://bugs.debian.org/<bugnumber>
|
|
|
385abae |
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
|
|
|
385abae |
Forwarded: <no|not-needed|url proving that it has been forwarded>
|
|
|
385abae |
Reviewed-By: <name and email of someone who approved the patch>
|
|
|
385abae |
Last-Update: <YYYY-MM-DD>
|
|
|
385abae |
|
|
|
385abae |
--- gcl-2.6.12.orig/cmpnew/gcl_cmpmain.lsp
|
|
|
385abae |
+++ gcl-2.6.12/cmpnew/gcl_cmpmain.lsp
|
|
|
385abae |
@@ -161,7 +161,7 @@
|
|
|
385abae |
|
|
|
385abae |
|
|
|
385abae |
(defun compile-file1 (input-pathname
|
|
|
385abae |
- &key (output-file input-pathname)
|
|
|
385abae |
+ &key (output-file (truename input-pathname))
|
|
|
385abae |
(o-file t)
|
|
|
385abae |
(c-file *default-c-file*)
|
|
|
385abae |
(h-file *default-h-file*)
|
|
|
385abae |
--- gcl-2.6.12.orig/h/elf64_mips_reloc.h
|
|
|
385abae |
+++ gcl-2.6.12/h/elf64_mips_reloc.h
|
|
|
385abae |
@@ -1,18 +1,28 @@
|
|
|
385abae |
case R_MIPS_JALR:
|
|
|
385abae |
break;
|
|
|
385abae |
- case R_MIPS_64:
|
|
|
385abae |
- if (ELF_R_FTYPE(r->r_info)==R_MIPS_GPREL32) s-=(ul)got;
|
|
|
385abae |
- add_val(where,~0L,s+a);
|
|
|
385abae |
- break;
|
|
|
385abae |
case R_MIPS_GPREL32:
|
|
|
385abae |
+ recurse(s+a-(ul)got);
|
|
|
385abae |
add_val(where,MASK(32),s+a-(ul)got);
|
|
|
385abae |
break;
|
|
|
385abae |
+ case R_MIPS_GPREL16:
|
|
|
385abae |
+ recurse(s+a-(ul)got);
|
|
|
385abae |
+ add_val(where,MASK(16),s+a-(ul)got);
|
|
|
385abae |
+ break;
|
|
|
385abae |
+ case R_MIPS_SUB:
|
|
|
385abae |
+ recurse(-(s+a));
|
|
|
385abae |
+ break;/*???*/
|
|
|
385abae |
+ case R_MIPS_64:
|
|
|
385abae |
+ recurse(s+a);
|
|
|
385abae |
+ add_val(where,~0L,s+a);
|
|
|
385abae |
+ break;
|
|
|
385abae |
case R_MIPS_32:
|
|
|
385abae |
+ recurse(s+a);
|
|
|
385abae |
add_val(where,MASK(32),s+a);
|
|
|
385abae |
break;
|
|
|
385abae |
case R_MIPS_GOT_DISP:
|
|
|
385abae |
case R_MIPS_CALL16:
|
|
|
385abae |
case R_MIPS_GOT_PAGE:
|
|
|
385abae |
+ recurse(s+a);
|
|
|
385abae |
gote=got+(a>>32)-1;
|
|
|
385abae |
a&=MASK(32);
|
|
|
385abae |
store_val(where,MASK(16),((void *)gote-(void *)got));
|
|
|
385abae |
@@ -22,28 +32,27 @@
|
|
|
385abae |
*gote=s+(a&~MASK(16))+((a&0x8000)<<1);
|
|
|
385abae |
break;
|
|
|
385abae |
case R_MIPS_GOT_OFST:
|
|
|
385abae |
+ recurse(s+a);
|
|
|
385abae |
store_val(where,MASK(16),a);
|
|
|
385abae |
break;
|
|
|
385abae |
case R_MIPS_HI16:
|
|
|
385abae |
- s+=a&MASK(32);
|
|
|
385abae |
- if (ELF_R_FTYPE(r->r_info)==R_MIPS_GPREL16) s=(ul)got-s;
|
|
|
385abae |
+ recurse(s+a);
|
|
|
385abae |
if (!hr) hr=(void *)r;
|
|
|
385abae |
- if (a&(1L<<32)) add_vals(where,MASK(16),(s+(a>>32))>>16);
|
|
|
385abae |
+ if (lr)/*==(Rela *)r*/
|
|
|
385abae |
+ add_vals(where,MASK(16),(s+a+la)>>16);
|
|
|
385abae |
break;
|
|
|
385abae |
case R_MIPS_LO16:
|
|
|
385abae |
+ recurse(s+a);
|
|
|
385abae |
s+=a;
|
|
|
385abae |
- if (ELF_R_FTYPE(r->r_info)==R_MIPS_GPREL16) s=(ul)got-s;
|
|
|
385abae |
a=*where&MASK(16);
|
|
|
385abae |
if (a&0x8000) a|=0xffffffffffff0000;
|
|
|
385abae |
a+=s&MASK(16);
|
|
|
385abae |
a+=(a&0x8000)<<1;
|
|
|
385abae |
store_val(where,MASK(16),a);
|
|
|
385abae |
- a&=~MASK(16);
|
|
|
385abae |
- {
|
|
|
385abae |
- Rela *ra=(void *)r;
|
|
|
385abae |
- for (hr=hr ? hr : (void *)ra;--ra>=hr;)
|
|
|
385abae |
- if (ELF_R_TYPE(ra->r_info)==R_MIPS_HI16)
|
|
|
385abae |
- relocate(sym1,ra,ra->r_addend|(1L<<32)|(a<<32),start,got,gote);
|
|
|
385abae |
- }
|
|
|
385abae |
- hr=NULL;
|
|
|
385abae |
+ for (la=a&~MASK(16),lr=(Rela *)r,hr=hr ? hr : lr;--lr>=hr;)
|
|
|
385abae |
+ if (ELF_R_TYPE1(lr->r_info)==R_MIPS_HI16||
|
|
|
385abae |
+ ELF_R_TYPE2(lr->r_info)==R_MIPS_HI16||
|
|
|
385abae |
+ ELF_R_TYPE3(lr->r_info)==R_MIPS_HI16)
|
|
|
385abae |
+ relocate(sym1,lr,lr->r_addend,start,got,gote);
|
|
|
385abae |
+ hr=lr=NULL;
|
|
|
385abae |
break;
|
|
|
385abae |
--- gcl-2.6.12.orig/h/elf64_mips_reloc_special.h
|
|
|
385abae |
+++ gcl-2.6.12/h/elf64_mips_reloc_special.h
|
|
|
385abae |
@@ -1,10 +1,21 @@
|
|
|
385abae |
-static ul ggot,ggote; static Rela *hr;
|
|
|
385abae |
+static ul ggot,ggote,la; static Rela *hr,*lr;
|
|
|
385abae |
|
|
|
385abae |
#undef ELF_R_SYM
|
|
|
385abae |
#define ELF_R_SYM(a_) (a_&0xffffffff)
|
|
|
385abae |
+#define ELF_R_TYPE1(a_) ((a_>>56)&0xff)
|
|
|
385abae |
+#define ELF_R_TYPE2(a_) ((a_>>48)&0xff)
|
|
|
385abae |
+#define ELF_R_TYPE3(a_) ((a_>>40)&0xff)
|
|
|
385abae |
+#define recurse(val) ({ \
|
|
|
385abae |
+ if (ELF_R_TYPE2(r->r_info)) { \
|
|
|
385abae |
+ ul i=r->r_info; \
|
|
|
385abae |
+ r->r_info=(((r->r_info>>32)&MASK(24))<<40)|(r->r_info&MASK(32)); \
|
|
|
385abae |
+ relocate(sym1,r,(val)-s,start,got,gote); \
|
|
|
385abae |
+ r->r_info=i; \
|
|
|
385abae |
+ break; \
|
|
|
385abae |
+ }})
|
|
|
385abae |
+
|
|
|
385abae |
#undef ELF_R_TYPE
|
|
|
385abae |
-#define ELF_R_TYPE(a_) (((a_>>40)&0xff) ? ((a_>>40)&0xff) : (((a_>>48)&0xff) ? ((a_>>48)&0xff) : ((a_>>56)&0xff)))
|
|
|
385abae |
-#define ELF_R_FTYPE(a_) ((a_>>56)&0xff)
|
|
|
385abae |
+#define ELF_R_TYPE(a_) ELF_R_TYPE1(a_)
|
|
|
385abae |
|
|
|
385abae |
typedef struct {
|
|
|
385abae |
ul entry,gotoff;
|
|
|
385abae |
--- gcl-2.6.12.orig/h/object.h
|
|
|
385abae |
+++ gcl-2.6.12/h/object.h
|
|
|
385abae |
@@ -568,6 +568,12 @@ EXTER unsigned plong signals_allowed, si
|
|
|
385abae |
|
|
|
385abae |
#define IMMNIL(x) (is_imm_fixnum(x)||x==Cnil)
|
|
|
385abae |
|
|
|
385abae |
-#define eql(a_,b_) ({register object _a=(a_);register object _b=(b_);_a==_b || (!IMMNIL(_a)&&!IMMNIL(_b)&&eql1(_a,_b));})
|
|
|
385abae |
-#define equal(a_,b_) ({register object _a=(a_);register object _b=(b_);_a==_b || (!IMMNIL(_a)&&!IMMNIL(_b)&&equal1(_a,_b));})
|
|
|
385abae |
-#define equalp(a_,b_) ({register object _a=(a_);register object _b=(b_);_a==_b || (_a!=Cnil&&_b!=Cnil&&equalp1(_a,_b));})
|
|
|
385abae |
+/*gcc boolean expression tail position bug*/
|
|
|
385abae |
+
|
|
|
385abae |
+/* #define eql(a_,b_) ({register object _a=(a_);register object _b=(b_);_a==_b || (!IMMNIL(_a)&&!IMMNIL(_b)&&eql1(_a,_b));}) */
|
|
|
385abae |
+/* #define equal(a_,b_) ({register object _a=(a_);register object _b=(b_);_a==_b || (!IMMNIL(_a)&&!IMMNIL(_b)&&equal1(_a,_b));}) */
|
|
|
385abae |
+/* #define equalp(a_,b_) ({register object _a=(a_);register object _b=(b_);_a==_b || (_a!=Cnil&&_b!=Cnil&&equalp1(_a,_b));}) */
|
|
|
385abae |
+
|
|
|
385abae |
+#define eql(a_,b_) ({register object _a=(a_);register object _b=(b_);_a==_b ? TRUE : (IMMNIL(_a)||IMMNIL(_b) ? FALSE : eql1(_a,_b));})
|
|
|
385abae |
+#define equal(a_,b_) ({register object _a=(a_);register object _b=(b_);_a==_b ? TRUE : (IMMNIL(_a)||IMMNIL(_b) ? FALSE : equal1(_a,_b));})
|
|
|
385abae |
+#define equalp(a_,b_) ({register object _a=(a_);register object _b=(b_);_a==_b ? TRUE : (_a==Cnil||_b==Cnil ? FALSE : equalp1(_a,_b));})
|
|
|
385abae |
--- gcl-2.6.12.orig/o/main.c
|
|
|
385abae |
+++ gcl-2.6.12/o/main.c
|
|
|
385abae |
@@ -443,6 +443,23 @@ gcl_cleanup(int gc) {
|
|
|
385abae |
|
|
|
385abae |
}
|
|
|
385abae |
|
|
|
385abae |
+/*gcc boolean expression tail position bug*/
|
|
|
385abae |
+
|
|
|
385abae |
+void *
|
|
|
385abae |
+cclear_stack(unsigned long size) {
|
|
|
385abae |
+ void *v=alloca(size);
|
|
|
385abae |
+ memset(v,0,size);
|
|
|
385abae |
+ return v;
|
|
|
385abae |
+}
|
|
|
385abae |
+
|
|
|
385abae |
+DEFUN_NEW("EQUAL-TAIL-RECURSION-CHECK",object,fSequal_tail_recursion_check,SI,1,1,NONE,II,OO,OO,OO,(fixnum s),"") {
|
|
|
385abae |
+ object x0=make_list(s/sizeof(object)),x1=make_list(s/sizeof(object));
|
|
|
385abae |
+ char *u=cclear_stack(s),*w;
|
|
|
385abae |
+ fLequal(x0,x1);
|
|
|
385abae |
+ for (w=u;w
|
|
|
385abae |
+ RETURN1((object)(w-u));
|
|
|
385abae |
+}
|
|
|
385abae |
+
|
|
|
385abae |
|
|
|
385abae |
int
|
|
|
385abae |
main(int argc, char **argv, char **envp) {
|
|
|
385abae |
--- gcl-2.6.12.orig/o/predicate.c
|
|
|
385abae |
+++ gcl-2.6.12/o/predicate.c
|
|
|
385abae |
@@ -446,23 +446,9 @@ equal1(register object x, register objec
|
|
|
385abae |
|
|
|
385abae |
/*x and y are not == and not Cnil and not immfix*/
|
|
|
385abae |
|
|
|
385abae |
-#ifdef __MINGW32__ /*FIXME mingw compiler cannot do tail recursion and blows out stack*/
|
|
|
385abae |
- BEGIN:
|
|
|
385abae |
- if (valid_cdr(x)) {
|
|
|
385abae |
- if (valid_cdr(y)&&equal(x->c.c_car,y->c.c_car)) {
|
|
|
385abae |
- x=x->c.c_cdr;
|
|
|
385abae |
- y=y->c.c_cdr;
|
|
|
385abae |
- if (x==y) return TRUE;
|
|
|
385abae |
- if (IMMNIL(x)||IMMNIL(y)) return FALSE;
|
|
|
385abae |
- goto BEGIN;
|
|
|
385abae |
- } else
|
|
|
385abae |
- return FALSE;
|
|
|
385abae |
- }
|
|
|
385abae |
-#else
|
|
|
385abae |
-
|
|
|
385abae |
- if (valid_cdr(x)) return valid_cdr(y)&&equal(x->c.c_car,y->c.c_car)&&equal(x->c.c_cdr,y->c.c_cdr);
|
|
|
385abae |
-
|
|
|
385abae |
-#endif
|
|
|
385abae |
+ /*gcc boolean expression tail position bug*/
|
|
|
385abae |
+ /* if (valid_cdr(x)) return valid_cdr(y)&&equal(x->c.c_car,y->c.c_car)&&equal(x->c.c_cdr,y->c.c_cdr); */
|
|
|
385abae |
+ if (valid_cdr(x)) return !valid_cdr(y)||!equal(x->c.c_car,y->c.c_car) ? FALSE : equal(x->c.c_cdr,y->c.c_cdr);
|
|
|
385abae |
|
|
|
385abae |
if (valid_cdr(y)) return FALSE;
|
|
|
385abae |
|
|
|
385abae |
@@ -524,7 +510,9 @@ equalp1(register object x, register obje
|
|
|
385abae |
|
|
|
385abae |
/*x and y are not == and not Cnil*/
|
|
|
385abae |
|
|
|
385abae |
- if (listp(x)) return listp(y)&&equalp(x->c.c_car,y->c.c_car)&&equalp(x->c.c_cdr,y->c.c_cdr);
|
|
|
385abae |
+ /*gcc boolean expression tail position bug*/
|
|
|
385abae |
+ /* if (listp(x)) return listp(y)&&equalp(x->c.c_car,y->c.c_car)&&equalp(x->c.c_cdr,y->c.c_cdr); */
|
|
|
385abae |
+ if (listp(x)) return !listp(y)||!equalp(x->c.c_car,y->c.c_car) ? FALSE : equalp(x->c.c_cdr,y->c.c_cdr);
|
|
|
385abae |
|
|
|
385abae |
if (listp(y)) return FALSE;
|
|
|
385abae |
|
|
|
385abae |
--- gcl-2.6.12.orig/unixport/sys_init.lsp.in
|
|
|
385abae |
+++ gcl-2.6.12/unixport/sys_init.lsp.in
|
|
|
385abae |
@@ -79,3 +79,7 @@
|
|
|
385abae |
|
|
|
385abae |
#+ansi-cl (use-package :pcl :user)
|
|
|
385abae |
#+ansi-cl (import 'si::(clines defentry defcfun object void int double quit bye gbc system) :user)
|
|
|
385abae |
+
|
|
|
385abae |
+(let* ((i 4096)(j (si::equal-tail-recursion-check i)))
|
|
|
385abae |
+ (unless (eql i j)
|
|
|
385abae |
+ (warn "equal is not tail recursive ~s ~s" i j)))
|