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.14-19) unstable; urgency=medium
 .
   * Version_2_6_15pre18
Author: Camm Maguire <camm@debian.org>

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

Origin: (upstream|backport|vendor|other), (<patch-url>|commit:<commit-id>)
Bug: <upstream-bugtracker-url>
Bug-Debian: https://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: (no|not-needed|<patch-forwarded-url>)
Applied-Upstream: <version>, (<commit-url>|commit:<commid-id>)
Reviewed-By: <name and email of someone who approved/reviewed the patch>
Last-Update: 2025-03-25

--- gcl-2.6.14.orig/configure
+++ gcl-2.6.14/configure
@@ -4550,7 +4550,7 @@ add_args_to_cflags  -fsigned-char -pipe
 	            -std=gnu17 \
 	            -Wall \
 	            -Wno-builtin-requires-header -Wno-empty-body -Wno-self-assign \
-	            -Wno-unused-but-set-variable
+	            -Wno-unused-but-set-variable -Wno-tautological-compare
 
 add_args_to_ldflags -no-pie # -Wl,-z,lazy
 
@@ -6571,7 +6571,7 @@ printf "%s\n" "$ac_cv_sizeof_time_t" >&6
 printf "%s\n" "#define SIZEOF_TIME_T $ac_cv_sizeof_time_t" >>confdefs.h
 
 
-if test "$use" != "mingw" ; then
+if test "$use" != "mingw" && test "$use" != "386-gnu" ; then
    if test "$ac_cv_sizeof_time_t" != "8" ; then
       as_fn_error $? "Cannot define a 64 bit time_t" "$LINENO" 5
    fi
@@ -6941,9 +6941,9 @@ rm -f core *.core core.conftest.* gmon.o
 fi
 
 
-if test "$use" = "386-macosx" ; then
-    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: emulating sbrk for mac" >&5
-printf "%s\n" "emulating sbrk for mac" >&6; };
+if test "$use" = "386-macosx" || test "$use" = "386-gnu" || test "$use" = "gnuwin95" || test "$use" = "mingw" ; then
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: special sbrk handling" >&5
+printf "%s\n" "special sbrk handling" >&6; };
     HAVE_SBRK=0
 fi
 
--- gcl-2.6.14.orig/configure.in
+++ gcl-2.6.14/configure.in
@@ -261,7 +261,7 @@ add_args_to_cflags  -fsigned-char -pipe
 	            -std=gnu17 \
 	            -Wall \
 	            -Wno-builtin-requires-header -Wno-empty-body -Wno-self-assign \
-	            -Wno-unused-but-set-variable
+	            -Wno-unused-but-set-variable -Wno-tautological-compare
 
 add_args_to_ldflags -no-pie # -Wl,-z,lazy
 
@@ -959,7 +959,7 @@ fi
 AC_CHECK_HEADERS([time.h sys/time.h])
 
 AC_CHECK_SIZEOF(time_t,[0],[#include <time.h>])
-if test "$use" != "mingw" ; then
+if test "$use" != "mingw" && test "$use" != "386-gnu" ; then
    if test "$ac_cv_sizeof_time_t" != "8" ; then
       AC_MSG_ERROR([Cannot define a 64 bit time_t])
    fi
@@ -1121,8 +1121,8 @@ AC_RUN_IFELSE(
     AC_MSG_RESULT([no: WARNING you must be able to emulate sbrk: as on mingw or macosx]),
     AC_MSG_RESULT([no: WARNING you must be able to emulate sbrk: as on mingw or macosx]))
 
-if test "$use" = "386-macosx" ; then
-    AC_MSG_RESULT([emulating sbrk for mac]);
+if test "$use" = "386-macosx" || test "$use" = "386-gnu" || test "$use" = "gnuwin95" || test "$use" = "mingw" ; then
+    AC_MSG_RESULT([special sbrk handling]);
     HAVE_SBRK=0
 fi
 
--- gcl-2.6.14.orig/git.tag
+++ gcl-2.6.14/git.tag
@@ -1 +1 @@
-"Version_2_6_15pre17"
+"Version_2_6_15pre18"
--- gcl-2.6.14.orig/h/386-gnu.h
+++ gcl-2.6.14/h/386-gnu.h
@@ -62,7 +62,7 @@
 
 #undef HAVE_D_TYPE /*FIXME defined, but not implemented in readdir*/
 /* #define NO_FILE_LOCKING */ /*FIXME*/
-
+#define ROUNDUP(x_,y_) (((unsigned long)(x_)+(y_ -1)) & ~(y_ -1))/*FIXME double eval*/
 #define INITIALIZE_BRK							\
   massert(!brk(gcl_alloc_initialized ? core_end :			\
 	       ({extern ufixnum _end;(void *)ROUNDUP((ufixnum)&_end,PAGESIZE);})))
--- gcl-2.6.14.orig/o/alloc.c
+++ gcl-2.6.14/o/alloc.c
@@ -120,8 +120,12 @@ expand_contblock_array(void) {
 static void
 contblock_array_push(void *p) {
 
+  ufixnum f=contblock_array==Cnil ? 0 : contblock_array->v.v_fillp;/*FIXME*/
+
   expand_contblock_array();
-  contblock_array->v.v_self[contblock_array->v.v_fillp]=p;
+  memmove(contblock_array->v.v_self+f+1,contblock_array->v.v_self+f,
+	  (contblock_array->v.v_fillp-f)*sizeof(*contblock_array->v.v_self));
+  contblock_array->v.v_self[f]=p;
   contblock_array->v.v_fillp++;
 
 }
--- gcl-2.6.14.orig/o/main.c
+++ gcl-2.6.14/o/main.c
@@ -1251,7 +1251,7 @@ init_main(void) {
   
 }
 
-#ifdef HAVE_DIS_ASM_H
+#if defined(HAVE_DIS_ASM_H) && defined(OUTPUT_ARCH)
 
 #include "dis-asm.h"
 
