|
|
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-14) unstable; urgency=medium
|
|
|
385abae |
.
|
|
|
385abae |
* Version_2_6_13pre17
|
|
|
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 |
@@ -82,7 +82,7 @@
|
|
|
385abae |
|
|
|
385abae |
(defun safe-system (string)
|
|
|
385abae |
(multiple-value-bind
|
|
|
385abae |
- (code result) (system (ts string))
|
|
|
385abae |
+ (code result) (system (mysub (ts string) "$" "\\$"))
|
|
|
385abae |
(unless (and (zerop code) (zerop result))
|
|
|
385abae |
(cerror "Continues anyway."
|
|
|
385abae |
"(SYSTEM ~S) returned a non-zero value ~D."
|
|
|
385abae |
--- gcl-2.6.12.orig/configure
|
|
|
385abae |
+++ gcl-2.6.12/configure
|
|
|
385abae |
@@ -715,6 +715,7 @@ infodir
|
|
|
385abae |
docdir
|
|
|
385abae |
oldincludedir
|
|
|
385abae |
includedir
|
|
|
385abae |
+runstatedir
|
|
|
385abae |
localstatedir
|
|
|
385abae |
sharedstatedir
|
|
|
385abae |
sysconfdir
|
|
|
385abae |
@@ -821,6 +822,7 @@ datadir='${datarootdir}'
|
|
|
385abae |
sysconfdir='${prefix}/etc'
|
|
|
385abae |
sharedstatedir='${prefix}/com'
|
|
|
385abae |
localstatedir='${prefix}/var'
|
|
|
385abae |
+runstatedir='${localstatedir}/run'
|
|
|
385abae |
includedir='${prefix}/include'
|
|
|
385abae |
oldincludedir='/usr/include'
|
|
|
385abae |
docdir='${datarootdir}/doc/${PACKAGE}'
|
|
|
385abae |
@@ -1073,6 +1075,15 @@ do
|
|
|
385abae |
| -silent | --silent | --silen | --sile | --sil)
|
|
|
385abae |
silent=yes ;;
|
|
|
385abae |
|
|
|
385abae |
+ -runstatedir | --runstatedir | --runstatedi | --runstated \
|
|
|
385abae |
+ | --runstate | --runstat | --runsta | --runst | --runs \
|
|
|
385abae |
+ | --run | --ru | --r)
|
|
|
385abae |
+ ac_prev=runstatedir ;;
|
|
|
385abae |
+ -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
|
|
|
385abae |
+ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
|
|
|
385abae |
+ | --run=* | --ru=* | --r=*)
|
|
|
385abae |
+ runstatedir=$ac_optarg ;;
|
|
|
385abae |
+
|
|
|
385abae |
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
|
|
|
385abae |
ac_prev=sbindir ;;
|
|
|
385abae |
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
|
|
|
385abae |
@@ -1210,7 +1221,7 @@ fi
|
|
|
385abae |
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
|
|
|
385abae |
datadir sysconfdir sharedstatedir localstatedir includedir \
|
|
|
385abae |
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
|
|
|
385abae |
- libdir localedir mandir
|
|
|
385abae |
+ libdir localedir mandir runstatedir
|
|
|
385abae |
do
|
|
|
385abae |
eval ac_val=\$$ac_var
|
|
|
385abae |
# Remove trailing slashes.
|
|
|
385abae |
@@ -1363,6 +1374,7 @@ Fine tuning of the installation director
|
|
|
385abae |
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
|
|
|
385abae |
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
|
|
|
385abae |
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
|
|
|
385abae |
+ --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
|
|
|
385abae |
--libdir=DIR object code libraries [EPREFIX/lib]
|
|
|
385abae |
--includedir=DIR C header files [PREFIX/include]
|
|
|
385abae |
--oldincludedir=DIR C header files for non-gcc [/usr/include]
|
|
|
385abae |
@@ -4423,6 +4435,7 @@ case $use in
|
|
|
385abae |
# if test "$enable_debug" != "yes" ; then TO2FLAGS="-O" ; fi
|
|
|
385abae |
;;
|
|
|
385abae |
mips*)
|
|
|
385abae |
+ TCFLAGS="$TCFLAGS -mplt"
|
|
|
385abae |
# if test "$enable_debug" != "yes" ; then TO3FLAGS="-O0" ; fi #FIXME needed asof gcc 4.6.2
|
|
|
385abae |
;;
|
|
|
385abae |
ia64*)
|
|
|
385abae |
--- gcl-2.6.12.orig/configure.in
|
|
|
385abae |
+++ gcl-2.6.12/configure.in
|
|
|
385abae |
@@ -640,6 +640,7 @@ case $use in
|
|
|
385abae |
# if test "$enable_debug" != "yes" ; then TO2FLAGS="-O" ; fi
|
|
|
385abae |
;;
|
|
|
385abae |
mips*)
|
|
|
385abae |
+ TCFLAGS="$TCFLAGS -mplt"
|
|
|
385abae |
# if test "$enable_debug" != "yes" ; then TO3FLAGS="-O0" ; fi #FIXME needed asof gcc 4.6.2
|
|
|
385abae |
;;
|
|
|
385abae |
ia64*)
|
|
|
385abae |
--- gcl-2.6.12.orig/h/elf32_mips_reloc.h
|
|
|
385abae |
+++ gcl-2.6.12/h/elf32_mips_reloc.h
|
|
|
385abae |
@@ -19,10 +19,7 @@
|
|
|
385abae |
case R_MIPS_CALL16:
|
|
|
385abae |
gote=got+sym->st_size-1;
|
|
|
385abae |
store_val(where,MASK(16),((void *)gote-(void *)got));
|
|
|
385abae |
- if (s>=ggot && s
|
|
|
385abae |
- massert(!write_stub(s,got,gote));
|
|
|
385abae |
- } else
|
|
|
385abae |
- *gote=s;
|
|
|
385abae |
+ *gote=s;
|
|
|
385abae |
break;
|
|
|
385abae |
case R_MIPS_HI16:
|
|
|
385abae |
if (sym->st_other) s=gpd=(ul)got-(sym->st_other==2 ? 0 : (ul)where);
|
|
|
385abae |
@@ -37,7 +34,8 @@
|
|
|
385abae |
a+=(a&0x8000)<<1;
|
|
|
385abae |
store_val(where,MASK(16),a);
|
|
|
385abae |
a=0x10000|(a>>16);
|
|
|
385abae |
- for (hr=hr ? hr : r;--r>=hr && ELF_R_TYPE(r->r_info)==R_MIPS_HI16;)
|
|
|
385abae |
- relocate(sym1,r,a,start,got,gote);
|
|
|
385abae |
+ for (hr=hr ? hr : r;--r>=hr;)
|
|
|
385abae |
+ if (ELF_R_TYPE(r->r_info)==R_MIPS_HI16)
|
|
|
385abae |
+ relocate(sym1,r,a,start,got,gote);
|
|
|
385abae |
hr=NULL;gpd=0;
|
|
|
385abae |
break;
|
|
|
385abae |
--- gcl-2.6.12.orig/h/elf32_mips_reloc_special.h
|
|
|
385abae |
+++ gcl-2.6.12/h/elf32_mips_reloc_special.h
|
|
|
385abae |
@@ -1,65 +1,9 @@
|
|
|
385abae |
-static ul gpd,ggot,ggote; static Rel *hr;
|
|
|
385abae |
-
|
|
|
385abae |
-static int
|
|
|
385abae |
-write_stub(ul s,ul *got,ul *gote) {
|
|
|
385abae |
-
|
|
|
385abae |
- *gote=(ul)(gote+2);
|
|
|
385abae |
- *++gote=s;
|
|
|
385abae |
- s=((void *)gote-(void *)got);
|
|
|
385abae |
- *++gote=(0x23<<26)|(0x1c<<21)|(0x19<<16)|s;
|
|
|
385abae |
- *++gote=(0x23<<26)|(0x19<<21)|(0x19<<16)|0;
|
|
|
385abae |
- *++gote=0x03200008;
|
|
|
385abae |
- *++gote=0x00200825;
|
|
|
385abae |
-
|
|
|
385abae |
- return 0;
|
|
|
385abae |
-
|
|
|
385abae |
-}
|
|
|
385abae |
-
|
|
|
385abae |
-static int
|
|
|
385abae |
-make_got_room_for_stub(Shdr *sec1,Shdr *sece,Sym *sym,const char *st1,ul *gs) {
|
|
|
385abae |
-
|
|
|
385abae |
- Shdr *ssec=sec1+sym->st_shndx;
|
|
|
385abae |
- struct node *a;
|
|
|
385abae |
- if ((ssec>=sece || !ALLOC_SEC(ssec)) &&
|
|
|
385abae |
- (a=find_sym_ptable(st1+sym->st_name)) &&
|
|
|
385abae |
- a->address>=ggot && a->address
|
|
|
385abae |
- (*gs)+=5;
|
|
|
385abae |
-
|
|
|
385abae |
- return 0;
|
|
|
385abae |
-
|
|
|
385abae |
-}
|
|
|
385abae |
+static ul gpd; static Rel *hr;
|
|
|
385abae |
|
|
|
385abae |
static int
|
|
|
385abae |
find_special_params(void *v,Shdr *sec1,Shdr *sece,const char *sn,
|
|
|
385abae |
const char *st1,Sym *ds1,Sym *dse,Sym *sym,Sym *syme) {
|
|
|
385abae |
|
|
|
385abae |
- Shdr *sec;
|
|
|
385abae |
- ul *q,gotsym=0,locgotno=0,stub,stube;
|
|
|
385abae |
- void *p,*pe;
|
|
|
385abae |
-
|
|
|
385abae |
- massert(sec=get_section(".dynamic",sec1,sece,sn));
|
|
|
385abae |
- for (p=(void *)sec->sh_addr,pe=p+sec->sh_size;p<pe;p+=sec->sh_entsize) {
|
|
|
385abae |
- q=p;
|
|
|
385abae |
- if (q[0]==DT_MIPS_GOTSYM)
|
|
|
385abae |
- gotsym=q[1];
|
|
|
385abae |
- if (q[0]==DT_MIPS_LOCAL_GOTNO)
|
|
|
385abae |
- locgotno=q[1];
|
|
|
385abae |
-
|
|
|
385abae |
- }
|
|
|
385abae |
- massert(gotsym && locgotno);
|
|
|
385abae |
-
|
|
|
385abae |
- massert(sec=get_section(".MIPS.stubs",sec1,sece,sn));
|
|
|
385abae |
- stub=sec->sh_addr;
|
|
|
385abae |
- stube=sec->sh_addr+sec->sh_size;
|
|
|
385abae |
-
|
|
|
385abae |
- massert(sec=get_section(".got",sec1,sece,sn));
|
|
|
385abae |
- ggot=sec->sh_addr+locgotno*sec->sh_entsize;
|
|
|
385abae |
- ggote=sec->sh_addr+sec->sh_size;
|
|
|
385abae |
-
|
|
|
385abae |
- for (ds1+=gotsym,sym=ds1;sym
|
|
|
385abae |
- if (!sym->st_value || (sym->st_value>=stub && sym->st_value
|
|
|
385abae |
- sym->st_value=ggot+(sym-ds1)*sec->sh_entsize;
|
|
|
385abae |
-
|
|
|
385abae |
return 0;
|
|
|
385abae |
|
|
|
385abae |
}
|
|
|
385abae |
@@ -74,7 +18,7 @@ label_got_symbols(void *v1,Shdr *sec1,Sh
|
|
|
385abae |
ul q;
|
|
|
385abae |
|
|
|
385abae |
for (q=0,sym=sym1;sym
|
|
|
385abae |
- char *s=st1+sym->st_name;
|
|
|
385abae |
+ const char *s=st1+sym->st_name;
|
|
|
385abae |
if ((sym->st_other=strcmp(s,"_gp_disp") ? (strcmp(s,"__gnu_local_gp") ? 0 : 2) : 1)) {
|
|
|
385abae |
q++;
|
|
|
385abae |
sym->st_info=ELF_ST_INFO(STB_LOCAL,ELF_ST_TYPE(sym->st_info));
|
|
|
385abae |
@@ -94,10 +38,8 @@ label_got_symbols(void *v1,Shdr *sec1,Sh
|
|
|
385abae |
|
|
|
385abae |
sym=sym1+ELF_R_SYM(r->r_info);
|
|
|
385abae |
|
|
|
385abae |
- if (!sym->st_size) {
|
|
|
385abae |
+ if (!sym->st_size)
|
|
|
385abae |
sym->st_size=++*gs;
|
|
|
385abae |
- massert(!make_got_room_for_stub(sec1,sece,sym,st1,gs));
|
|
|
385abae |
- }
|
|
|
385abae |
|
|
|
385abae |
}
|
|
|
385abae |
|
|
|
385abae |
--- gcl-2.6.12.orig/h/elf64_mips_reloc.h
|
|
|
385abae |
+++ gcl-2.6.12/h/elf64_mips_reloc.h
|
|
|
385abae |
@@ -15,10 +15,7 @@
|
|
|
385abae |
gote=got+(a>>32)-1;
|
|
|
385abae |
a&=MASK(32);
|
|
|
385abae |
store_val(where,MASK(16),((void *)gote-(void *)got));
|
|
|
385abae |
- if (s>=ggot && s
|
|
|
385abae |
- massert(!write_stub(s,got,gote));
|
|
|
385abae |
- } else
|
|
|
385abae |
- *gote=s+(a&~MASK(16))+((a&0x8000)<<1);
|
|
|
385abae |
+ *gote=s+(a&~MASK(16))+((a&0x8000)<<1);
|
|
|
385abae |
break;
|
|
|
385abae |
case R_MIPS_GOT_OFST:
|
|
|
385abae |
store_val(where,MASK(16),a);
|
|
|
385abae |
@@ -40,8 +37,9 @@
|
|
|
385abae |
a&=~MASK(16);
|
|
|
385abae |
{
|
|
|
385abae |
Rela *ra=(void *)r;
|
|
|
385abae |
- for (hr=hr ? hr : (void *)ra;--ra>=hr && ELF_R_TYPE(ra->r_info)==R_MIPS_HI16;)
|
|
|
385abae |
- relocate(sym1,ra,ra->r_addend|(1L<<32)|(a<<32),start,got,gote);
|
|
|
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 |
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,4 +1,4 @@
|
|
|
385abae |
-static ul ggot,ggote; static Rela *hr;
|
|
|
385abae |
+static Rela *hr;
|
|
|
385abae |
|
|
|
385abae |
#undef ELF_R_SYM
|
|
|
385abae |
#define ELF_R_SYM(a_) (a_&0xffffffff)
|
|
|
385abae |
@@ -7,68 +7,9 @@ static ul ggot,ggote; static Rela *hr;
|
|
|
385abae |
#define ELF_R_FTYPE(a_) ((a_>>56)&0xff)
|
|
|
385abae |
|
|
|
385abae |
static int
|
|
|
385abae |
-write_stub(ul s,ul *got,ul *gote) {
|
|
|
385abae |
-
|
|
|
385abae |
- int *goti;
|
|
|
385abae |
-
|
|
|
385abae |
-
|
|
|
385abae |
- *gote=(ul)(goti=(void *)(gote+2));
|
|
|
385abae |
- *++gote=s;
|
|
|
385abae |
- s=((void *)gote-(void *)got);
|
|
|
385abae |
- *goti++=(0x37<<26)|(0x1c<<21)|(0x19<<16)|s;
|
|
|
385abae |
- *goti++=(0x37<<26)|(0x19<<21)|(0x19<<16)|0;
|
|
|
385abae |
- *goti++=0x03200008;
|
|
|
385abae |
- *goti++=0x00200825;
|
|
|
385abae |
-
|
|
|
385abae |
- return 0;
|
|
|
385abae |
-
|
|
|
385abae |
-}
|
|
|
385abae |
-
|
|
|
385abae |
-static int
|
|
|
385abae |
-make_got_room_for_stub(Shdr *sec1,Shdr *sece,Sym *sym,const char *st1,ul *gs) {
|
|
|
385abae |
-
|
|
|
385abae |
- Shdr *ssec=sec1+sym->st_shndx;
|
|
|
385abae |
- struct node *a;
|
|
|
385abae |
- if ((ssec>=sece || !ALLOC_SEC(ssec)) &&
|
|
|
385abae |
- (a=find_sym_ptable(st1+sym->st_name)) &&
|
|
|
385abae |
- a->address>=ggot && a->address
|
|
|
385abae |
- (*gs)+=3;
|
|
|
385abae |
-
|
|
|
385abae |
- return 0;
|
|
|
385abae |
-
|
|
|
385abae |
-}
|
|
|
385abae |
-
|
|
|
385abae |
-static int
|
|
|
385abae |
find_special_params(void *v,Shdr *sec1,Shdr *sece,const char *sn,
|
|
|
385abae |
const char *st1,Sym *ds1,Sym *dse,Sym *sym,Sym *syme) {
|
|
|
385abae |
|
|
|
385abae |
- Shdr *sec;
|
|
|
385abae |
- ul *q,gotsym=0,locgotno=0,stub,stube;
|
|
|
385abae |
- void *p,*pe;
|
|
|
385abae |
-
|
|
|
385abae |
- massert(sec=get_section(".dynamic",sec1,sece,sn));
|
|
|
385abae |
- for (p=(void *)sec->sh_addr,pe=p+sec->sh_size;p<pe;p+=sec->sh_entsize) {
|
|
|
385abae |
- q=p;
|
|
|
385abae |
- if (q[0]==DT_MIPS_GOTSYM)
|
|
|
385abae |
- gotsym=q[1];
|
|
|
385abae |
- if (q[0]==DT_MIPS_LOCAL_GOTNO)
|
|
|
385abae |
- locgotno=q[1];
|
|
|
385abae |
-
|
|
|
385abae |
- }
|
|
|
385abae |
- massert(gotsym && locgotno);
|
|
|
385abae |
-
|
|
|
385abae |
- massert(sec=get_section(".MIPS.stubs",sec1,sece,sn));
|
|
|
385abae |
- stub=sec->sh_addr;
|
|
|
385abae |
- stube=sec->sh_addr+sec->sh_size;
|
|
|
385abae |
-
|
|
|
385abae |
- massert(sec=get_section(".got",sec1,sece,sn));
|
|
|
385abae |
- ggot=sec->sh_addr+locgotno*sec->sh_entsize;
|
|
|
385abae |
- ggote=sec->sh_addr+sec->sh_size;
|
|
|
385abae |
-
|
|
|
385abae |
- for (ds1+=gotsym,sym=ds1;sym
|
|
|
385abae |
- if (!sym->st_value || (sym->st_value>=stub && sym->st_value
|
|
|
385abae |
- sym->st_value=ggot+(sym-ds1)*sec->sh_entsize;
|
|
|
385abae |
-
|
|
|
385abae |
return 0;
|
|
|
385abae |
|
|
|
385abae |
}
|
|
|
385abae |
@@ -104,8 +45,6 @@ label_got_symbols(void *v1,Shdr *sec1,Sh
|
|
|
385abae |
sym->st_size|=(q<<(a*16));
|
|
|
385abae |
}
|
|
|
385abae |
|
|
|
385abae |
- massert(!make_got_room_for_stub(sec1,sece,sym,st1,gs));
|
|
|
385abae |
-
|
|
|
385abae |
}
|
|
|
385abae |
|
|
|
385abae |
b=sizeof(r->r_addend)*4;
|
|
|
385abae |
--- gcl-2.6.12.orig/h/mips-linux.h
|
|
|
385abae |
+++ gcl-2.6.12/h/mips-linux.h
|
|
|
385abae |
@@ -21,5 +21,4 @@
|
|
|
385abae |
#define SPECIAL_RELOC_H "elf64_mips_reloc_special.h"
|
|
|
385abae |
#endif
|
|
|
385abae |
|
|
|
385abae |
-/*Remove when .MIPS.stubs are replaced with callable .plt entries*/
|
|
|
385abae |
-#define LD_BIND_NOW
|
|
|
385abae |
+#define NEED_STACK_CHK_GUARD
|
|
|
385abae |
--- gcl-2.6.12.orig/lsp/gcl_iolib.lsp
|
|
|
385abae |
+++ gcl-2.6.12/lsp/gcl_iolib.lsp
|
|
|
385abae |
@@ -38,26 +38,24 @@
|
|
|
385abae |
|
|
|
385abae |
|
|
|
385abae |
(defmacro with-input-from-string ((var string &key index start end) . body)
|
|
|
385abae |
- (if index
|
|
|
385abae |
- (multiple-value-bind (ds b)
|
|
|
385abae |
- (find-declarations body)
|
|
|
385abae |
- `(let ((,var (make-string-input-stream ,string ,start ,end)))
|
|
|
385abae |
- ,@ds
|
|
|
385abae |
- (unwind-protect
|
|
|
385abae |
- (progn ,@b)
|
|
|
385abae |
- (setf ,index (si:get-string-input-stream-index ,var)))))
|
|
|
385abae |
- `(let ((,var (make-string-input-stream ,string ,start ,end)))
|
|
|
385abae |
- ,@body)))
|
|
|
385abae |
+ (multiple-value-bind (ds b)
|
|
|
385abae |
+ (find-declarations body)
|
|
|
385abae |
+ `(let ((,var (make-string-input-stream ,string ,start ,end)))
|
|
|
385abae |
+ ,@ds
|
|
|
385abae |
+ (unwind-protect
|
|
|
385abae |
+ (progn ,@b)
|
|
|
385abae |
+ (when ,index (setf ,index (si:get-string-input-stream-index ,var)))
|
|
|
385abae |
+ (when ,var (close ,var))))))
|
|
|
385abae |
|
|
|
385abae |
+(defmacro with-output-to-string ((var &optional string &key element-type) . body)
|
|
|
385abae |
+ (multiple-value-bind (ds b)
|
|
|
385abae |
+ (find-declarations body)
|
|
|
385abae |
+ `(let ((,var ,(if string `(make-string-output-stream-from-string ,string) `(make-string-output-stream))))
|
|
|
385abae |
+ ,@ds
|
|
|
385abae |
+ (unwind-protect
|
|
|
385abae |
+ (progn ,@b ,@(unless string `((get-output-stream-string ,var))))
|
|
|
385abae |
+ (when ,var (close ,var))))))
|
|
|
385abae |
|
|
|
385abae |
-(defmacro with-output-to-string ((var &optional string) . body)
|
|
|
385abae |
- (if string
|
|
|
385abae |
- `(let ((,var (make-string-output-stream-from-string ,string)))
|
|
|
385abae |
- ,@body)
|
|
|
385abae |
- `(let ((,var (make-string-output-stream)))
|
|
|
385abae |
- ,@body
|
|
|
385abae |
- (get-output-stream-string ,var))))
|
|
|
385abae |
-
|
|
|
385abae |
|
|
|
385abae |
(defun read-from-string (string
|
|
|
385abae |
&optional (eof-error-p t) eof-value
|
|
|
385abae |
--- gcl-2.6.12.orig/lsp/gcl_numlib.lsp
|
|
|
385abae |
+++ gcl-2.6.12/lsp/gcl_numlib.lsp
|
|
|
385abae |
@@ -71,29 +71,53 @@
|
|
|
385abae |
|
|
|
385abae |
(defun cis (x) (exp (* imag-one x)))
|
|
|
385abae |
|
|
|
385abae |
-(defun asin (x)
|
|
|
385abae |
- (let ((c (- (* imag-one
|
|
|
385abae |
- (log (+ (* imag-one x)
|
|
|
385abae |
- (sqrt (- 1.0d0 (* x x)))))))))
|
|
|
385abae |
- (if (or (and (not (complexp x))
|
|
|
385abae |
- (<= x 1.0d0)
|
|
|
385abae |
- (>= x -1.0d0)
|
|
|
385abae |
- )
|
|
|
385abae |
- (zerop (imagpart c)))
|
|
|
385abae |
- (realpart c)
|
|
|
385abae |
- c)))
|
|
|
385abae |
-
|
|
|
385abae |
-(defun acos (x)
|
|
|
385abae |
- (let ((c (- (* imag-one
|
|
|
385abae |
- (log (+ x (* imag-one
|
|
|
385abae |
- (sqrt (- 1.0d0 (* x x))))))))))
|
|
|
385abae |
- (if (or (and (not (complexp x))
|
|
|
385abae |
- (<= x 1.0d0)
|
|
|
385abae |
- (>= x -1.0d0)
|
|
|
385abae |
- )
|
|
|
385abae |
- (zerop (imagpart c)))
|
|
|
385abae |
- (realpart c)
|
|
|
385abae |
- c)))
|
|
|
385abae |
+(defun real-asinh (x)
|
|
|
385abae |
+ (declare (real x))
|
|
|
385abae |
+ (float (log (+ x (sqrt (+ 1.0 (* x x))))) (float x)))
|
|
|
385abae |
+
|
|
|
385abae |
+(defun asin (z)
|
|
|
385abae |
+ (declare (optimize (safety 1)))
|
|
|
385abae |
+ (check-type z number)
|
|
|
385abae |
+ (if (unless (complexp z) (<= -1 z 1))
|
|
|
385abae |
+ (atan z (sqrt (- 1 (* z z))))
|
|
|
385abae |
+ (let* ((a (sqrt (- 1 z)))
|
|
|
385abae |
+ (b (sqrt (+ 1 z))))
|
|
|
385abae |
+ (complex (atan (realpart z) (realpart (* a b)))
|
|
|
385abae |
+ (real-asinh (imagpart (* (conjugate a) b)))))))
|
|
|
385abae |
+
|
|
|
385abae |
+(defun acos (z)
|
|
|
385abae |
+ (declare (optimize (safety 1)))
|
|
|
385abae |
+ (check-type z number)
|
|
|
385abae |
+ (if (unless (complexp z) (<= -1 z 1))
|
|
|
385abae |
+ (* 2 (atan (- 1 z) (sqrt (- 1 (* z z)))))
|
|
|
385abae |
+ (let* ((a (sqrt (- 1 z)))
|
|
|
385abae |
+ (b (sqrt (+ 1 z))))
|
|
|
385abae |
+ (complex (* 2 (atan (realpart a) (realpart b)))
|
|
|
385abae |
+ (real-asinh (imagpart (* (conjugate b) a)))))))
|
|
|
385abae |
+
|
|
|
385abae |
+(defun asinh (x)
|
|
|
385abae |
+ (declare (optimize (safety 1)))
|
|
|
385abae |
+ (check-type x number)
|
|
|
385abae |
+ (if (realp x)
|
|
|
385abae |
+ (real-asinh x)
|
|
|
385abae |
+ (let* ((r (asin (complex (- (imagpart x)) (realpart x)))))
|
|
|
385abae |
+ (complex (imagpart r) (- (realpart r))))))
|
|
|
385abae |
+
|
|
|
385abae |
+(defun acosh (z)
|
|
|
385abae |
+ (declare (optimize (safety 1)))
|
|
|
385abae |
+ (check-type z number)
|
|
|
385abae |
+ (if (unless (complexp z) (>= z 1))
|
|
|
385abae |
+ (real-asinh (sqrt (- (* z z) 1)))
|
|
|
385abae |
+ (let* ((a (sqrt (- z 1)))
|
|
|
385abae |
+ (b (sqrt (+ z 1))))
|
|
|
385abae |
+ (complex (real-asinh (realpart (* (conjugate a) b))) (* 2 (atan (imagpart a) (realpart b)))))))
|
|
|
385abae |
+
|
|
|
385abae |
+(defun atanh (x)
|
|
|
385abae |
+ (declare (optimize (safety 1)))
|
|
|
385abae |
+ (check-type x number)
|
|
|
385abae |
+ (if (unless (complexp x) (< -1 x 1))
|
|
|
385abae |
+ (/ (log (/ (+ 1 x) (- 1 x))) 2)
|
|
|
385abae |
+ (/ (- (log (+ 1 x)) (log (- 1 x))) 2)))
|
|
|
385abae |
|
|
|
385abae |
|
|
|
385abae |
(defun sinh (z)
|
|
|
385abae |
@@ -140,27 +164,6 @@
|
|
|
385abae |
;(defun cosh (x) (/ (+ (exp x) (exp (- x))) 2.0d0))
|
|
|
385abae |
(defun tanh (x) (/ (sinh x) (cosh x)))
|
|
|
385abae |
|
|
|
385abae |
-(defun asinh (x) (log (+ x (sqrt (+ 1.0d0 (* x x))))))
|
|
|
385abae |
-;(defun acosh (x)
|
|
|
385abae |
-; (log (+ x
|
|
|
385abae |
-; (* (1+ x)
|
|
|
385abae |
-; (sqrt (/ (1- x) (1+ x)))))))
|
|
|
385abae |
-;(defun acosh (x)
|
|
|
385abae |
-; (log (+ x
|
|
|
385abae |
-; (sqrt (* (1- x) (1+ x))))))
|
|
|
385abae |
-(defun acosh (x)
|
|
|
385abae |
- (* 2 (log (+ (sqrt (/ (1+ x) 2)) (sqrt (/ (1- x) 2))))))
|
|
|
385abae |
-(defun atanh (x)
|
|
|
385abae |
- (when (or (= x 1.0d0) (= x -1.0d0))
|
|
|
385abae |
- (error "The argument, ~s, is a logarithmic singularity.~
|
|
|
385abae |
- ~%Don't be foolish, GLS."
|
|
|
385abae |
- x))
|
|
|
385abae |
- (log (/ (1+ x) (sqrt (- 1 (* x x))))))
|
|
|
385abae |
-;; (let ((y (log (/ (1+ x) (sqrt (- 1 (* x x)))))))
|
|
|
385abae |
-;; (if (and (= (imagpart x) 0) (complexp y))
|
|
|
385abae |
-;; (complex (realpart y) (- (imagpart y)))
|
|
|
385abae |
-;; y)))
|
|
|
385abae |
-
|
|
|
385abae |
|
|
|
385abae |
(defun rational (x)
|
|
|
385abae |
(etypecase x
|
|
|
385abae |
--- gcl-2.6.12.orig/o/file.d
|
|
|
385abae |
+++ gcl-2.6.12/o/file.d
|
|
|
385abae |
@@ -523,7 +523,41 @@ object if_exists, if_does_not_exist;
|
|
|
385abae |
|
|
|
385abae |
static void
|
|
|
385abae |
gclFlushSocket(object);
|
|
|
385abae |
-/*
|
|
|
385abae |
+
|
|
|
385abae |
+
|
|
|
385abae |
+DEFUN_NEW("OPEN-STREAM-P",object,fLopen_stream_p,LISP,1,1,NONE,OO,OO,OO,OO,(object x),"") {
|
|
|
385abae |
+
|
|
|
385abae |
+ check_type_stream(&x);
|
|
|
385abae |
+
|
|
|
385abae |
+ switch(x->sm.sm_mode) {
|
|
|
385abae |
+ case smm_output:
|
|
|
385abae |
+ case smm_input:
|
|
|
385abae |
+ case smm_io:
|
|
|
385abae |
+ case smm_probe:
|
|
|
385abae |
+ case smm_socket:
|
|
|
385abae |
+ case smm_string_input:
|
|
|
385abae |
+ case smm_string_output:
|
|
|
385abae |
+ return x->d.tt==1 ? Cnil : Ct;
|
|
|
385abae |
+ case smm_synonym:
|
|
|
385abae |
+ return FFN(fLopen_stream_p)(symbol_value(x->sm.sm_object0));
|
|
|
385abae |
+ case smm_broadcast:
|
|
|
385abae |
+ case smm_concatenated:
|
|
|
385abae |
+ for (x=x->sm.sm_object0;!endp(x);x=x->c.c_cdr)
|
|
|
385abae |
+ if (!FFN(fLopen_stream_p(x)))
|
|
|
385abae |
+ return Cnil;
|
|
|
385abae |
+ return Ct;
|
|
|
385abae |
+ case smm_two_way:
|
|
|
385abae |
+ case smm_echo:
|
|
|
385abae |
+ if (FFN(fLopen_stream_p(STREAM_INPUT_STREAM(x)))==Cnil)
|
|
|
385abae |
+ return Cnil;
|
|
|
385abae |
+ return FFN(fLopen_stream_p(STREAM_OUTPUT_STREAM(x)));
|
|
|
385abae |
+ default:
|
|
|
385abae |
+ error("illegal stream mode");
|
|
|
385abae |
+ return Cnil;
|
|
|
385abae |
+ }
|
|
|
385abae |
+
|
|
|
385abae |
+}
|
|
|
385abae |
+ /*
|
|
|
385abae |
Close_stream(strm) closes stream strm.
|
|
|
385abae |
The abort_flag is not used now.
|
|
|
385abae |
*/
|
|
|
385abae |
@@ -535,6 +569,8 @@ object strm;
|
|
|
385abae |
object x;
|
|
|
385abae |
|
|
|
385abae |
BEGIN:
|
|
|
385abae |
+ strm->d.tt=1;
|
|
|
385abae |
+
|
|
|
385abae |
switch (strm->sm.sm_mode) {
|
|
|
385abae |
case smm_output:
|
|
|
385abae |
if (strm->sm.sm_fp == stdout)
|
|
|
385abae |
--- gcl-2.6.12.orig/o/main.c
|
|
|
385abae |
+++ gcl-2.6.12/o/main.c
|
|
|
385abae |
@@ -471,12 +471,6 @@ main(int argc, char **argv, char **envp)
|
|
|
385abae |
#include "unrandomize.h"
|
|
|
385abae |
#endif
|
|
|
385abae |
|
|
|
385abae |
-#ifdef LD_BIND_NOW
|
|
|
385abae |
-#include <stdio.h>
|
|
|
385abae |
-#include <stdlib.h>
|
|
|
385abae |
-#include "ld_bind_now.h"
|
|
|
385abae |
-#endif
|
|
|
385abae |
-
|
|
|
385abae |
setbuf(stdin, stdin_buf);
|
|
|
385abae |
setbuf(stdout, stdout_buf);
|
|
|
385abae |
#ifdef _WIN32
|
|
|
385abae |
--- gcl-2.6.12.orig/o/print.d
|
|
|
385abae |
+++ gcl-2.6.12/o/print.d
|
|
|
385abae |
@@ -349,7 +349,7 @@ truncate_double(char *b,double d,int dp)
|
|
|
385abae |
for (p=c;*p && *p!='e';p++);
|
|
|
385abae |
if (p[-1]!='.' && char_inc(c,p-1) && COMP(c,&pp,d,dp)) {
|
|
|
385abae |
j=truncate_double(c,d,dp);
|
|
|
385abae |
- if (j
|
|
|
385abae |
+ if (j<=k) {
|
|
|
385abae |
k=j;
|
|
|
385abae |
n=c;
|
|
|
385abae |
}
|