<short summary of the patch>
authorCamm Maguire <camm@debian.org>
Sun, 13 Nov 2022 12:55:14 +0000 (12:55 +0000)
committerCamm Maguire <camm@debian.org>
Sun, 13 Nov 2022 12:55:14 +0000 (12:55 +0000)
Bug-Debian: https://bugs.debian.org/803214

TODO: Put a short summary on the line above and replace this paragraph
with a longer explanation of this change. Complete the meta-information
with other relevant fields (see below for details). To make it easier, the
information below has been extracted from the changelog. Adjust it or drop
it.

gcl (2.6.12-29) unstable; urgency=medium

  * Version_2_6_13pre35; support latest binutils
  * Bug fix: "gcl ftbfs on amd64 and i386 with binutils from
    experimental", thanks to Matthias Klose (Closes: #803214).

Gbp-Pq: Name Version_2_6_13pre38

cmpnew/gcl_cmpvs.lsp
configure
configure.in
o/alloc.c
o/file.d
o/main.c
o/nsocket.c
o/prelink.c
o/sfasli.c

index d95b5f84ef1dfaa24ab30271f8fd302446ce8808..38e6aa7e85ef8166d656523c979fe198c6864943 100755 (executable)
@@ -75,8 +75,8 @@
 (defun wt-vs* (vs)
   (wt "(" )(wt-vs vs) (wt "->c.c_car)"))
 
-(defun wt-ccb-vs (ccb-vs)
-  (wt "(fun->cc.cc_turbo[" (- *initial-ccb-vs* ccb-vs) "]->c.c_car)"))
+(defun wt-ccb-vs (ccb-vs);;FIXME harmonize *closure-p* with *clink*
+  (wt "(" (if *closure-p* "fun->cc.cc_turbo" "base0") "[" (- *initial-ccb-vs* ccb-vs) "]->c.c_car)"))
 
 (defun clink (vs) (setq *clink* vs))
 
index ca9431ea8294f8748c56d2a2e4d68c5a921f41fa..a0b79b1052c1f137bc5c5f1d0473494cddeff0fa 100755 (executable)
--- a/configure
+++ b/configure
@@ -7663,7 +7663,7 @@ fi
 if test "${enable_ansi+set}" = set; then :
   enableval=$enable_ansi;
 else
-  enable_ansi="no"
+  enable_ansi="yes"
 fi
 
 
index e9ce5e60f6ac0026dd4b940f256f9d39174cecfd..0a285c3fefef37f6b50bf6ad7bb1b167813cbd9b 100644 (file)
@@ -2133,7 +2133,7 @@ AC_ARG_ENABLE(readline,
 
 # ansi lisp
 AC_ARG_ENABLE(ansi,[--enable-ansi builds a large gcl aiming for ansi compliance, 
-                   --disable-ansi builds the smaller traditional CLtL1 image],,enable_ansi="no")
+                   --disable-ansi builds the smaller traditional CLtL1 image],,enable_ansi="yes")
 
 if test "$enable_ansi" = "yes" ; then
        SYSTEM=ansi_gcl
index 8518d2b7addceaee739a986843cf997e1f92281b..5f21529a0fb4603023c338a4ce5149515098ff6c 100644 (file)
--- a/o/alloc.c
+++ b/o/alloc.c
@@ -1241,7 +1241,7 @@ gcl_init_alloc(void *cs_start) {
 
     massert(!getrlimit(RLIMIT_STACK, &rl));
     if (rl.rlim_cur!=RLIM_INFINITY && (rl.rlim_max == RLIM_INFINITY || rl.rlim_max > rl.rlim_cur)) {
-      rl.rlim_cur = rl.rlim_max == RLIM_INFINITY ? rl.rlim_max : rl.rlim_max/64;
+      rl.rlim_cur = rl.rlim_max;
       massert(!setrlimit(RLIMIT_STACK,&rl));
     }
     cssize = rl.rlim_cur/sizeof(*cs_org) - sizeof(*cs_org)*CSGETA;
index 4df7f54fa527059e9b0c87ef5702e2d35e2a93bd..95c0204941255a74e50628cf6c3d147bb88c0003 100755 (executable)
--- a/o/file.d
+++ b/o/file.d
@@ -2407,17 +2407,18 @@ object x=Cnil;
    inPort = (myport == Cnil ? 0 : fix(Iis_fixnum(myport)));
    
 #ifdef BSD
+
   if (isServer && daemon != Cnil) {
 
     long pid,i;
     struct rlimit r;
-    struct sigaction sa;
+    struct sigaction sa,osa;
 
     sa.sa_handler=SIG_IGN;
     sa.sa_flags=SA_NOCLDWAIT;
     sigemptyset(&sa.sa_mask);
 
-    sigaction(SIGCHLD,&sa,NULL);
+    massert(!sigaction(SIGCHLD,&sa,&osa));
 
     switch((pid=pfork())) {
     case -1:
@@ -2425,8 +2426,7 @@ object x=Cnil;
       break;
     case 0:
 
-      if (setsid()<0)
-       FEerror("setsid error", 0);
+      massert(setsid()>=0);
 
       if (daemon == sKpersistent)
        switch(pfork()) {
@@ -2440,23 +2440,17 @@ object x=Cnil;
          break;
        }
       
+      massert(!chdir("/"));
+
       memset(&r,0,sizeof(r));
-      if (getrlimit(RLIMIT_NOFILE,&r))
-       FEerror("Cannot get resourse usage",0);
+      massert(!getrlimit(RLIMIT_NOFILE,&r));
       
       for (i=0;i<r.rlim_cur;i++)
-       close(i);
-      errno=0;
-      
-      if ((i=open("/dev/null",O_RDWR))==-1)
-       FEerror("Can't open /dev/null for stdin",0);
-      if ((i=dup(i))==-1)
-       FEerror("Can't dup",0);
-      if ((i=dup(i))==-1)
-       FEerror("Can't dup twice",0);
+       close(i);/*FIXME some of this will return error*/
       
-      if (chdir("/"))
-       FEerror("Cannot chdir to /",0);
+      massert((i=open("/dev/null",O_RDWR))>=0);
+      massert((i=dup(i))>=0);
+      massert((i=dup(i))>=0);
       
       umask(0);
       
@@ -2473,16 +2467,14 @@ object x=Cnil;
        
        FD_ZERO(&fds);
        FD_SET(fd,&fds);
-       i=select(fd+1,&fds,NULL,NULL,NULL);
        
-       if (i>0) {
+       if (select(fd+1,&fds,NULL,NULL,NULL)>0) {
          
          y=maccept(x);
          
-         sigaction(SIGCHLD,&sa,NULL);
-         
          switch((pid=pfork())) {
          case 0:
+           massert(!sigaction(SIGCHLD,&osa,NULL));
            ifuncall1(server,y);
            exit(0);
            break;
@@ -2506,6 +2498,8 @@ object x=Cnil;
       break;
     }
 
+    massert(!sigaction(SIGCHLD,&osa,NULL));
+
   } else 
 
 #endif
index 454bfe7818d2a65ab089ac53ebf8240cac1c8272..203c40a237f4cbc4bf55e8da9fb374eb3dbbb2ea 100755 (executable)
--- a/o/main.c
+++ b/o/main.c
@@ -227,9 +227,9 @@ get_phys_pages1(char freep) {
 static void
 get_gc_environ(void) {
 
-  const char *e;;
+  const char *e;
   
-  mem_multiple=1.0;
+  mem_multiple=0.85;
   if ((e=getenv("GCL_MEM_MULTIPLE"))) {
     massert(sscanf(e,"%lf",&mem_multiple)==1);
     massert(mem_multiple>=0.0);
index 9fc7360fca18cc3330d24769e3ff568461c25b32..eab76055dcafa6d6053b9d039cb40d3eea89a96d 100644 (file)
@@ -630,50 +630,43 @@ doReverse(char *s, int n)
   of the buffer may be changed.
  */
 int
-getCharGclSocket(object strm, object block)
-{
-  object bufp = SOCKET_STREAM_BUFFER(strm);
-  if (bufp->ust.ust_fillp > 0) {
-    dprintf("getchar returns (%c)\n",bufp->ust.ust_self[-1+(bufp->ust.ust_fillp)]);
+getCharGclSocket(object strm, object block) {
+
+  object bufp=SOCKET_STREAM_BUFFER(strm);
+  int fd=SOCKET_STREAM_FD(strm);
+
+  if (bufp->ust.ust_fillp > 0)
     return bufp->ust.ust_self[--(bufp->ust.ust_fillp)];
-  }
-  else {
+
+  if (fd>=0) {
+
     fd_set readfds;
-    struct timeval timeout;
-    int fd = SOCKET_STREAM_FD(strm);
-    if (1)
-      { int high;
-      AGAIN:      
-      /* under cygwin a too large timout like (1<<30) does not work */
-      timeout.tv_sec = 0;
-      timeout.tv_usec = 10000;
-      FD_ZERO(&readfds);
-      FD_SET(fd,&readfds);
-      high = select(fd+1,&readfds,NULL,NULL,block==Ct ? NULL : &timeout);
-      if (high > 0)
-       { object bufp = SOCKET_STREAM_BUFFER(strm);
-       int n;
-       n = SAFE_READ(fd,bufp->st.st_self ,bufp->ust.ust_dim);
+    struct timeval t,t1={0,10000},*tp=block==Ct ? NULL : &t;
+    int high,n;
+
+    FD_ZERO(&readfds);
+    FD_SET(fd,&readfds);
+
+    for (;(errno=0,t=t1,high=select(fd+1,&readfds,NULL,NULL,tp))==-1 && !tp && errno==EINTR;);
+
+    if (high > 0) {
+
+      massert((n=SAFE_READ(fd,bufp->st.st_self,bufp->ust.ust_dim))>=0);
+
+      if (n) {
        doReverse(bufp->st.st_self,n);
        bufp->ust.ust_fillp=n;
-       if (n > 0)
-         {
-           dprintf("getchar returns (%c)\n",bufp->ust.ust_self[-1+(bufp->ust.ust_fillp)]);
-           return bufp->ust.ust_self[--(bufp->ust.ust_fillp)];
-         }
-       else
-         {
-           SOCKET_STREAM_FD(strm)=-1;
-           return EOF;
-           FEerror("select said there was stuff there but there was not",0);
-         }
-       }
-      /* probably a signal interrupted us.. */
-      if (block == Ct)
-       goto AGAIN;
-      return EOF;
-      }
+      } else
+       SOCKET_STREAM_FD(strm)=-1;
+
+      return getCharGclSocket(strm,block);
+
+    }
+
   }
+
+  return EOF;
+
 }
 
 #else
index 9ce197d7a62b34ae55dbccd7188bafb0046de21a..83918a3e1012c60226c12c511e34ee6de2b5fa6f 100644 (file)
@@ -7,6 +7,7 @@ extern FILE *stdin __attribute__((weak));
 extern FILE *stderr __attribute__((weak));
 extern FILE *stdout __attribute__((weak));
 
+#ifdef HAVE_READLINE
 #if RL_READLINE_VERSION < 0x0600
 extern Function                *rl_completion_entry_function __attribute__((weak));
 extern char            *rl_readline_name __attribute__((weak));
@@ -15,6 +16,7 @@ extern rl_compentry_func_t *rl_completion_entry_function __attribute__((weak));
 extern const char *rl_readline_name __attribute__((weak));
 #endif
 #endif
+#endif
 
 void
 prelink_init(void) {
index bced5424c79da2de50ce8c269d60f9e4e41ef07f..5e0f5970efe7351b2e70c15817400a04822a5fc3 100755 (executable)
@@ -116,14 +116,20 @@ int
 use_symbols(double d,...) {
 
 #ifndef DARWIN
+
   extern void sincos(double,double *,double *);
+  double d2;
+
+  sincos(d,&d,&d2);
 
-  sincos(d,&d,&d);
 #else
+
   d=sin(d)+cos(d);
+  d2=sin(d)+cos(d);
+
 #endif
 
-  return (int)d;
+  return (int)(d+d2);
 
 }
 #endif