<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)
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-93) unstable; urgency=medium

  * Version_2_6_13pre90

Gbp-Pq: Name Version_2_6_13pre90

configure
configure.in
o/main.c
o/unixfsys.c

index 2dcc88736cc2df4cba010f7985f93eee43824041..cb2d6b7257a5c1d285a1a27bbc0920c338ffe72e 100755 (executable)
--- a/configure
+++ b/configure
@@ -3974,7 +3974,7 @@ $as_echo "removing $1 from LDFLAGS" >&6; }
 
 }
 
-add_args_to_cflags -fsigned-char -pipe \
+add_args_to_cflags -fsigned-char -pipe -fcommon \
                     -fno-builtin-malloc -fno-builtin-free \
                     -fno-PIE -fno-pie -fno-PIC -fno-pic \
                    -Wall \
index 1a9193e84cfa8080c5caee3606367318b7cae4f2..9bfd2bc628cb4e819a4089002e8f55afd39c119b 100644 (file)
@@ -258,7 +258,7 @@ remove_arg_from_ldflags() {
     
 }
 
-add_args_to_cflags -fsigned-char -pipe \
+add_args_to_cflags -fsigned-char -pipe -fcommon \
                     -fno-builtin-malloc -fno-builtin-free \
                     -fno-PIE -fno-pie -fno-PIC -fno-pic \
                    -Wall \
index dfdfa1b427754a78b922ef883fb7971d6ca34a2f..ae4a144a87c6798715e779778188675ce0eac6bc 100755 (executable)
--- a/o/main.c
+++ b/o/main.c
@@ -445,20 +445,21 @@ gcl_cleanup(int gc) {
 }
 
 /*gcc boolean expression tail position bug*/
+static char *stack_to_be_allocated;
 
-void *
-cclear_stack(unsigned long size) {
-  void *v=alloca(size);
-  memset(v,0,size);
-  return v;
+void
+get_stack_to_be_allocated(unsigned long size) {
+  stack_to_be_allocated=alloca(size);
 }
 
 DEFUN_NEW("EQUAL-TAIL-RECURSION-CHECK",object,fSequal_tail_recursion_check,SI,1,1,NONE,II,OO,OO,OO,(fixnum s),"") {
   object x0=make_list(s/sizeof(object)),x1=make_list(s/sizeof(object));
-  char *u=cclear_stack(s),*w;
+  char *w;
+  get_stack_to_be_allocated(s);
+  memset(stack_to_be_allocated,0,s);
   fLequal(x0,x1);
-  for (w=u;w<u+s && !*w;w++);
-  RETURN1((object)(w-u));
+  for (w=stack_to_be_allocated;w<stack_to_be_allocated+s && !*w;w++);
+  RETURN1((object)(w-stack_to_be_allocated));
 }
 
 static int
index 69546a023b3535c66d65f5b8f5e149bd493ece1e..100c44586f7f38c60c31df57ebeafa646d7f0068 100755 (executable)
@@ -537,7 +537,7 @@ un_mmap(void *v1,void *ve) {
 /* export these for AXIOM */
 int gcl_putenv(char *s) {return putenv(s);}
 char *gcl_strncpy(char *d,const char *s,size_t z) {return strncpy(d,s,z);}
-char *gcl_strncpy_chk(size_t z) {char a[10],b[10];return strncpy(a,b,z);}/*compile in __strncpy_chk with FORTIFY_SOURCE*/
+int gcl_strncpy_chk(char *a1,char *b1,size_t z) {char a[10],b[10];strncpy(a,a1,z);strncpy(b,b1,z);return strncmp(a,b,z);}/*compile in __strncpy_chk with FORTIFY_SOURCE*/
 #ifdef __MINGW32__
 #define uid_t int
 #endif