Blob Blame Raw
Description: <short summary of the patch>
 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-85) unstable; urgency=medium
 .
   * Version_2_6_13pre82
Author: Camm Maguire <camm@debian.org>

---
The information above should follow the Patch Tagging Guidelines, please
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: <vendor|upstream|other>, <url of original patch>
Bug: <url in upstream bugtracker>
Bug-Debian: https://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: <no|not-needed|url proving that it has been forwarded>
Reviewed-By: <name and email of someone who approved the patch>
Last-Update: 2019-04-02

--- gcl-2.6.12.orig/configure
+++ gcl-2.6.12/configure
@@ -6375,7 +6375,7 @@ main ()
 		FILE *f;
 		if (!(f=fopen("conftest1","w")))
 		   return -1;
-		   fprintf(f,"%u",sbrk(0));
+		   fprintf(f,"%p",sbrk(0));
 
   ;
   return 0;
@@ -6591,7 +6591,7 @@ else
 			#endif
 			if (!(f=fopen("conftest1","w")))
 			   return -1;
-			   fprintf(f,"%u",sbrk(0));
+			   fprintf(f,"%p",sbrk(0));
 			   return 0;
 		    }
 
@@ -6625,7 +6625,7 @@ else
 			#include "h/unrandomize.h"
 			#endif
 			if (!(f=fopen("conftest1","w"))) return -1;
-			   fprintf(f,"%u",sbrk(0));
+			   fprintf(f,"%p",sbrk(0));
 			   return 0;
 		    }
 
@@ -6653,8 +6653,9 @@ $as_echo "no" >&6; }
 	as_fn_error $? "exiting" "$LINENO" 5
     fi
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking CSTACK_ADDRESS" >&5
-$as_echo_n "checking CSTACK_ADDRESS... " >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking CSTACK_DIRECTION" >&5
+$as_echo_n "checking CSTACK_DIRECTION... " >&6; }
 if test "$cross_compiling" = yes; then :
   { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
@@ -6666,14 +6667,61 @@ else
 
 		#include <stdio.h>
 		#include <stdlib.h>
-		void *
-		foo() {
+
+		unsigned long w;
+
+		void
+		foo(void) {
 		    int i;
-		    return (void *)&i;
+		    w=(unsigned long)&i;
 		}
 
 		int
 		main(int argc,char **argv,char **envp) {
+		    void *b;
+		    FILE *fp = fopen("conftest1","w");
+		    #ifdef CAN_UNRANDOMIZE_SBRK
+		    #include "h/unrandomize.h"
+		    #endif
+		    foo();
+		    fprintf(fp,"%d",((unsigned long) &b) > w ? -1 : 1);
+		    fclose(fp);
+		    return 0;
+		}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+  cstack_direction=`cat conftest1`
+else
+  cstack_direction=0
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+cat >>confdefs.h <<_ACEOF
+#define CSTACK_DIRECTION $cstack_direction
+_ACEOF
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cstack_direction" >&5
+$as_echo "$cstack_direction" >&6; }
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking CSTACK_ADDRESS" >&5
+$as_echo_n "checking CSTACK_ADDRESS... " >&6; }
+if test "$cross_compiling" = yes; then :
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run test program while cross compiling
+See \`config.log' for more details" "$LINENO" 5; }
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+		#include <stdio.h>
+		#include <stdlib.h>
+		int
+		main(int argc,char **argv,char **envp) {
 		    void *v ;
 		    FILE *fp = fopen("conftest1","w");
 		    unsigned long i,j;
@@ -6685,13 +6733,13 @@ else
 		    j<<=$PAGEWIDTH;
 		    j<<=16;
 		    i=(unsigned long)&v;
-		    if (foo()>i) i-=j;
-		       j--;
-		       i+=j;
-		       i&=~j;
-		       fprintf(fp,"0x%lx",i-1);
-		       fclose(fp);
-		       return 0;
+		    if ($cstack_direction==1) i-=j;
+		    j--;
+		    i+=j;
+		    i&=~j;
+		    fprintf(fp,"0x%lx",i-1);
+		    fclose(fp);
+		    return 0;
 		}
 _ACEOF
 if ac_fn_c_try_run "$LINENO"; then :
@@ -6724,12 +6772,6 @@ else
 
 		#include <stdio.h>
 		#include <stdlib.h>
-		void *
-		foo() {
-		    int i;
-		    return (void *)&i;
-		}
-
 		int
 		main(int argc,char **argv,char **envp) {
 		    void *v ;
@@ -6743,14 +6785,14 @@ else
 		    j<<=$PAGEWIDTH;
 		    j<<=16;
 		    i=(unsigned long)&v;
-		    if (foo()>i) i-=j;
-		       j--;
-		       i+=j;
-		       i&=~j;
-		       for (j=0;(i>>j)!=(i>>(sizeof(long)*8-1));j++);
-			   fprintf(fp,"%d",j);
-			   fclose(fp);
-			   return 0;
+		    if ($cstack_direction==1) i-=j;
+		    j--;
+		    i+=j;
+		    i&=~j;
+		    for (j=0;(i>>j)!=(i>>(sizeof(long)*8-1));j++);
+		    fprintf(fp,"%ld",j);
+		    fclose(fp);
+		    return 0;
 		}
 _ACEOF
 if ac_fn_c_try_run "$LINENO"; then :
@@ -6854,54 +6896,6 @@ _ACEOF
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cstack_alignment" >&5
 $as_echo "$cstack_alignment" >&6; }
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking CSTACK_DIRECTION" >&5
-$as_echo_n "checking CSTACK_DIRECTION... " >&6; }
-if test "$cross_compiling" = yes; then :
-  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot run test program while cross compiling
-See \`config.log' for more details" "$LINENO" 5; }
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-		#include <stdio.h>
-		#include <stdlib.h>
-		void *
-		foo(void) {
-		    int i;
-		    return (void *)&i;
-		}
-
-		int
-		main(int argc,char **argv,char **envp) {
-		    char *b;
-		    FILE *fp = fopen("conftest1","w");
-		    #ifdef CAN_UNRANDOMIZE_SBRK
-		    #include "h/unrandomize.h"
-		    #endif
-		    fprintf(fp,"%d",((long) &b) > ((long) foo()) ? -1 : 1);
-		    fclose(fp);
-		    return 0;
-		}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  cstack_direction=`cat conftest1`
-else
-  cstack_direction=0
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-
-cat >>confdefs.h <<_ACEOF
-#define CSTACK_DIRECTION $cstack_direction
-_ACEOF
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cstack_direction" >&5
-$as_echo "$cstack_direction" >&6; }
-
 # Check whether --enable-immfix was given.
 if test "${enable_immfix+set}" = set; then :
   enableval=$enable_immfix;
@@ -7050,8 +7044,7 @@ int
 main ()
 {
 
-		void *v;
-		unsigned long i,j,k,l,m;
+		unsigned long i,j,k,l;
 		FILE *fp = fopen("conftest1","w");
 
 		for (i=2,k=1;i;k=i,i<<=1);
--- gcl-2.6.12.orig/configure.in
+++ gcl-2.6.12/configure.in
@@ -1049,7 +1049,7 @@ AC_RUN_IFELSE(
 		FILE *f;
 		if (!(f=fopen("conftest1","w")))
 		   return -1;
-		   fprintf(f,"%u",sbrk(0));
+		   fprintf(f,"%p",sbrk(0));
 	    ]])],
     [HAVE_SBRK=1;AC_MSG_RESULT([yes])],
     AC_MSG_RESULT([no: WARNING you must be able to emulate sbrk: as on mingw or macosx]),
@@ -1145,7 +1145,7 @@ if test "$HAVE_SBRK" = "1" ; then
 			#endif
 			if (!(f=fopen("conftest1","w")))
 			   return -1;
-			   fprintf(f,"%u",sbrk(0));
+			   fprintf(f,"%p",sbrk(0));
 			   return 0;
 		    }
 		]])],[SBRK=`cat conftest1`])
@@ -1165,7 +1165,7 @@ if test "$HAVE_SBRK" = "1" ; then
 			#include "h/unrandomize.h"
 			#endif
 			if (!(f=fopen("conftest1","w"))) return -1;
-			   fprintf(f,"%u",sbrk(0));
+			   fprintf(f,"%p",sbrk(0));
 			   return 0;
 		    }
 		]])],[SBRK1=`cat conftest1`])
@@ -1183,20 +1183,47 @@ if test "$HAVE_SBRK" = "1" ; then
 	AC_MSG_ERROR([exiting])
     fi
 fi
-AC_MSG_CHECKING(CSTACK_ADDRESS)
+
+AC_MSG_CHECKING(CSTACK_DIRECTION)
 AC_RUN_IFELSE(
     [AC_LANG_SOURCE(
 	    [[
 		#include <stdio.h>
 		#include <stdlib.h>
-		void *
-		foo() {
+
+		unsigned long w;
+
+		void
+		foo(void) {
 		    int i;
-		    return (void *)&i;
+		    w=(unsigned long)&i;
 		}
 		
 		int
 		main(int argc,char **argv,char **envp) {
+		    void *b;
+		    FILE *fp = fopen("conftest1","w");
+		    #ifdef CAN_UNRANDOMIZE_SBRK
+		    #include "h/unrandomize.h"
+		    #endif
+		    foo();
+		    fprintf(fp,"%d",((unsigned long) &b) > w ? -1 : 1);
+		    fclose(fp);
+		    return 0;
+		}]])],
+    [cstack_direction=`cat conftest1`],[cstack_direction=0])
+AC_DEFINE_UNQUOTED(CSTACK_DIRECTION,$cstack_direction,[whether C stack grows up or down])
+AC_MSG_RESULT($cstack_direction)
+
+
+AC_MSG_CHECKING(CSTACK_ADDRESS)
+AC_RUN_IFELSE(
+    [AC_LANG_SOURCE(
+	    [[
+		#include <stdio.h>
+		#include <stdlib.h>
+		int
+		main(int argc,char **argv,char **envp) {
 		    void *v ;
 		    FILE *fp = fopen("conftest1","w");
 		    unsigned long i,j;
@@ -1208,13 +1235,13 @@ AC_RUN_IFELSE(
 		    j<<=$PAGEWIDTH;
 		    j<<=16;
 		    i=(unsigned long)&v;
-		    if (foo()>i) i-=j;
-		       j--;
-		       i+=j;
-		       i&=~j;
-		       fprintf(fp,"0x%lx",i-1);
-		       fclose(fp);
-		       return 0;
+		    if ($cstack_direction==1) i-=j;
+		    j--;
+		    i+=j;
+		    i&=~j;
+		    fprintf(fp,"0x%lx",i-1);
+		    fclose(fp);
+		    return 0;
 		}]])],
     [cstack_address=`cat conftest1`],[cstack_address=0])
 AC_DEFINE_UNQUOTED(CSTACK_ADDRESS,$cstack_address,[starting C stack address])
@@ -1226,12 +1253,6 @@ AC_RUN_IFELSE(
 	    [[
 		#include <stdio.h>
 		#include <stdlib.h>
-		void *
-		foo() {
-		    int i;
-		    return (void *)&i;
-		}
-		
 		int
 		main(int argc,char **argv,char **envp) {
 		    void *v ;
@@ -1245,14 +1266,14 @@ AC_RUN_IFELSE(
 		    j<<=$PAGEWIDTH;
 		    j<<=16;
 		    i=(unsigned long)&v;
-		    if (foo()>i) i-=j;
-		       j--;
-		       i+=j;
-		       i&=~j;
-		       for (j=0;(i>>j)!=(i>>(sizeof(long)*8-1));j++);
-			   fprintf(fp,"%d",j);
-			   fclose(fp);
-			   return 0;
+		    if ($cstack_direction==1) i-=j;
+		    j--;
+		    i+=j;
+		    i&=~j;
+		    for (j=0;(i>>j)!=(i>>(sizeof(long)*8-1));j++);
+		    fprintf(fp,"%ld",j);
+		    fclose(fp);
+		    return 0;
 		}]])],
     [cstack_bits=`cat conftest1`],[cstack_bits=0])
 AC_DEFINE_UNQUOTED(CSTACK_BITS,$cstack_bits,[log starting C stack address])
@@ -1302,33 +1323,6 @@ AC_RUN_IFELSE(
 AC_DEFINE_UNQUOTED(CSTACK_ALIGNMENT,$cstack_alignment,[C stack alignment])
 AC_MSG_RESULT($cstack_alignment)
 
-AC_MSG_CHECKING(CSTACK_DIRECTION)
-AC_RUN_IFELSE(
-    [AC_LANG_SOURCE(
-	    [[
-		#include <stdio.h>
-		#include <stdlib.h>
-		void *
-		foo(void) {
-		    int i;
-		    return (void *)&i;
-		}
-		
-		int
-		main(int argc,char **argv,char **envp) {
-		    char *b;
-		    FILE *fp = fopen("conftest1","w");
-		    #ifdef CAN_UNRANDOMIZE_SBRK
-		    #include "h/unrandomize.h"
-		    #endif
-		    fprintf(fp,"%d",((long) &b) > ((long) foo()) ? -1 : 1);
-		    fclose(fp);
-		    return 0;
-		}]])],
-    [cstack_direction=`cat conftest1`],[cstack_direction=0])
-AC_DEFINE_UNQUOTED(CSTACK_DIRECTION,$cstack_direction,[whether C stack grows up or down])
-AC_MSG_RESULT($cstack_direction)
-
 AC_ARG_ENABLE([immfix],[  --enable-immfix will enable an immediate fixnum table above the C stack])
 
 AC_ARG_ENABLE([fastimmfix],[  --enable-fastimmfix=XXXX will reject low immediate fixnums unless 2^XXX can be attained],,[enable_fastimmfix=64])
@@ -1429,8 +1423,7 @@ AC_RUN_IFELSE(
 		#include <stdio.h>
 	    ]],
 	    [[
-		void *v;
-		unsigned long i,j,k,l,m;
+		unsigned long i,j,k,l;
 		FILE *fp = fopen("conftest1","w");
 		
 		for (i=2,k=1;i;k=i,i<<=1);
--- gcl-2.6.12.orig/h/unrandomize.h
+++ gcl-2.6.12/h/unrandomize.h
@@ -14,7 +14,7 @@
     long pers = personality(READ_IMPLIES_EXEC|personality(0xffffffffUL));
     long flag = ADDR_NO_RANDOMIZE;
 
-    if (sizeof(long)==4) flag|=ADDR_LIMIT_3GB|ADDR_COMPAT_LAYOUT;
+    if (sizeof(long)==4) flag|=ADDR_LIMIT_3GB/* |ADDR_COMPAT_LAYOUT */;
 
     if (pers==-1) {printf("personality failure %d\n",errno);exit(-1);}
     if ((pers & flag)!=flag && !getenv("GCL_UNRANDOMIZE")) {