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.
 .
 gcl27 (2.7.0-5) unstable; urgency=medium
 .
   * Version_2_7_0pre8
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: 2023-12-21

--- gcl27-2.7.0.orig/git.tag
+++ gcl27-2.7.0/git.tag
@@ -1,2 +1,2 @@
-"Version_2_7_0pre7"
+"Version_2_7_0pre8"
 
--- gcl27-2.7.0.orig/makefile
+++ gcl27-2.7.0/makefile
@@ -96,23 +96,23 @@ $(PORTDIR)/saved_pre_gcl: $(HDIR)cmpincl
 	(cd $(ODIR); $(MAKE) all)
 	$(MAKE) $<
 	rm -f o/cmpinclude.h ; cp h/cmpinclude.h o
-#	(cd $(ODIR); $(MAKE) all)
 	cd $(@D) && $(MAKE) $(@F)
-	cd $(@D) && echo '(time (let ((*features* (cons :pre-gcl *features*)))(load "boot.lisp")(si::save-system "$(@F)_temp")))' | ./$(@F)
-	[ "$(X_LIBS)" == "" ] || (cd xgcl-2 && $(MAKE) LISP=$$(pwd)/../$(@)_temp)
-#	cd $(ODIR) && rm -f boot.h && echo "#define LISP_BOOT" > boot.h && $(MAKE) all
-	cd $(@D) && $(MAKE) saved_gcl && mv saved_gcl $(@F)
 	touch $< $@
 
 $(PORTDIR)/saved_gcl0: $(PORTDIR)/saved_pre_gcl $(HDIR)cmpinclude.h
-	cd $(@D) && echo '(time (load "boot.lisp"))' | ./$(<F)
+	cd $(@D) && echo '(time (let ((*features* (cons :pre-gcl *features*)))(load "boot.lisp")(si::save-system "$(@F)_temp")))' | ../$<
+	[ "$(X_LIBS)" == "" ] || (cd xgcl-2 && $(MAKE) LISP=$$(pwd)/../$(@)_temp)#FIXME
 	cd $(@D) && $(MAKE) saved_gcl && mv saved_gcl $(@F)
 
 $(PORTDIR)/saved_gcl1: $(PORTDIR)/saved_gcl0 $(HDIR)cmpinclude.h
 	cd $(@D) && echo '(time (load "boot.lisp"))' | ./$(<F)
 	cd $(@D) && $(MAKE) saved_gcl && mv saved_gcl $(@F)
 
-$(PORTDIR)/saved_gcl: $(PORTDIR)/saved_gcl1 $(HDIR)cmpinclude.h
+$(PORTDIR)/saved_gcl2: $(PORTDIR)/saved_gcl1 $(HDIR)cmpinclude.h
+	cd $(@D) && echo '(time (load "boot.lisp"))' | ./$(<F)
+	cd $(@D) && $(MAKE) saved_gcl && mv saved_gcl $(@F)
+
+$(PORTDIR)/saved_gcl: $(PORTDIR)/saved_gcl2 $(HDIR)cmpinclude.h
 	cd $(@D) && echo '(time (load "boot.lisp"))' | ./$(<F) && $(MAKE) $(@F)
 	echo '(si::do-recomp)' | $@ && cd $(@D) && $(MAKE) $(@F)
 
--- gcl27-2.7.0.orig/o/assignment.c
+++ gcl27-2.7.0/o/assignment.c
@@ -335,7 +335,7 @@ setf(object place, object form)
 	args = place->c.c_cdr;
 
 	{
-	  object p=find_package(make_simple_string("COMMON-LISP"));
+	  object p=lisp_package;
 	  char *s;
 
 	  if (fun->s.s_hpack==p && fun->s.s_name->st.st_self[0]=='C' && fun->s.s_name->st.st_self[VLEN(fun->s.s_name)-1]=='R' && VLEN(fun->s.s_name)!=3) {
--- gcl27-2.7.0.orig/o/main.c
+++ gcl27-2.7.0/o/main.c
@@ -423,7 +423,9 @@ init_boot(void) {
   void *v,*q;
   char *z,*s="libboot.so";
   size_t m=sysd ? strlen(sysd) : dir_name_length(kcl_self),n=m+strlen(s)+1;
+  object omp=sSAoptimize_maximum_pagesA->s.s_dbind;
 
+  sSAoptimize_maximum_pagesA->s.s_dbind=Cnil;
   z=alloca(n);
   snprintf(z,n,"%-*.*s%s",(int)m,(int)m,d,s);
   if (!(v=dlopen(z,RTLD_LAZY|RTLD_GLOBAL)))
@@ -431,6 +433,7 @@ init_boot(void) {
   if (!(q=dlsym(v,"gcl_init_boot")))
     printf("%s\n",dlerror());
   ((void (*)())q)();
+  sSAoptimize_maximum_pagesA->s.s_dbind=omp;
 
 }
 
--- gcl27-2.7.0.orig/o/print.d
+++ gcl27-2.7.0/o/print.d
@@ -579,14 +579,16 @@ flush_queue(int force,struct printContex
       if (flush_queue_indent(force,p)) return;
       break;
     case CURRENT: case BLOCK:
-      short sh=p->b.p_queue[mod(p->b.p_qh+1)];
-      if (p->b.p_qc<2) return;
-      sh<<=1;sh>>=1;
-      sh+=(c==CURRENT ? p->b.p_col : p->b.p_indent_stack[p->b.p_isp-1]);/*lb*/
-      sh=sh<0 ? 0 : sh;
-      p->b.p_indent_stack[p->b.p_isp] = sh;
-      flush_queue_flush(force,2,p);
-      break;
+      {
+	short sh=p->b.p_queue[mod(p->b.p_qh+1)];
+	if (p->b.p_qc<2) return;
+	sh<<=1;sh>>=1;
+	sh+=(c==CURRENT ? p->b.p_col : p->b.p_indent_stack[p->b.p_isp-1]);/*lb*/
+	sh=sh<0 ? 0 : sh;
+	p->b.p_indent_stack[p->b.p_isp] = sh;
+	flush_queue_flush(force,2,p);
+	break;
+      }
     case LINE:case SECTION:case LINE_RELATIVE:case SECTION_RELATIVE:
       if (p->b.p_qc<3) return;
       flush_queue_flush(force,3,p);
--- gcl27-2.7.0.orig/unixport/boot.lisp
+++ gcl27-2.7.0/unixport/boot.lisp
@@ -1,6 +1,6 @@
 (in-package :compiler)(cdebug)(setq *compile-print* nil si::*notify-gbc* t *annotate* nil)
 
-(si::set-log-maxpage-bound 30);FIXME oom bootstrap less, bss shrank dump error when unrestricted
+#+pre-gcl(si::set-log-maxpage-bound 30);FIXME oom bootstrap less, bss shrank dump error when unrestricted
 
 #+pre-gcl
 (progn
