From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Camm Maguire <camm@debian.org>
Date: May, 16 2026 13:00:24 +0000
Subject: [PATCH] <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.

Bug-Debian: https://bugs.debian.org/1135720
---
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-<Vendor>: <vendor-bugtracker-url>
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>

--- gcl27-2.7.1.orig/Makefile.am
+++ gcl27-2.7.1/Makefile.am
@@ -271,7 +271,10 @@ unixport/raw_%: unixport/lib%.a $(FF) $(
 		( echo Relinking raw image for mac arm && \
 		  $(CC) \
                      $$(otool -l $@ | bin/mac_arm_relink ps=$(SEGMENT_ALIGNMENT_BITS) base=$(TEXT_BASE)) \
-                     $(AM_LDFLAGS) -rdynamic $(LDFLAGS) -o $@ $(FF) $< $(LF) $(LIBS))
+                     $(AM_LDFLAGS) -rdynamic $(LDFLAGS) -o $@ $(FF) $< $(LF) $(LIBS) && \
+		  ("$$(printf '%s\n1167\n' $$(ld -v  2>&1 | head -n 1 | awk '{print $$2}' | cut -f2 -d: | cut -d- -f2 | cut -d\. -f1) | sort -V |head -n 1)"  != "1167" || \
+			( printf '\x00\x00\x00\x00\x01\x00\x00\x00' | dd of=$@ bs=1 seek=64 conv=notrunc && \
+			  codesign -s - --force $@ )))
 
 unixport/gcl_cmpnopt_gcl_gprof.lsp unixport/gcl_cmpnopt_ansi_gcl_gprof.lsp:\
 unixport/gcl_cmpnopt_%_gprof.lsp: unixport/gcl_cmpnopt_%.lsp
--- gcl27-2.7.1.orig/Makefile.in
+++ gcl27-2.7.1/Makefile.in
@@ -4583,7 +4583,10 @@ unixport/raw_%: unixport/lib%.a $(FF) $(
 		( echo Relinking raw image for mac arm && \
 		  $(CC) \
                      $$(otool -l $@ | bin/mac_arm_relink ps=$(SEGMENT_ALIGNMENT_BITS) base=$(TEXT_BASE)) \
-                     $(AM_LDFLAGS) -rdynamic $(LDFLAGS) -o $@ $(FF) $< $(LF) $(LIBS))
+                     $(AM_LDFLAGS) -rdynamic $(LDFLAGS) -o $@ $(FF) $< $(LF) $(LIBS) && \
+		  ("$$(printf '%s\n1167\n' $$(ld -v  2>&1 | head -n 1 | awk '{print $$2}' | cut -f2 -d: | cut -d- -f2 | cut -d\. -f1) | sort -V |head -n 1)"  != "1167" || \
+			( printf '\x00\x00\x00\x00\x01\x00\x00\x00' | dd of=$@ bs=1 seek=64 conv=notrunc && \
+			  codesign -s - --force $@ )))
 
 unixport/gcl_cmpnopt_gcl_gprof.lsp unixport/gcl_cmpnopt_ansi_gcl_gprof.lsp:\
 unixport/gcl_cmpnopt_%_gprof.lsp: unixport/gcl_cmpnopt_%.lsp
--- gcl27-2.7.1.orig/cmpnew/gcl_cmpeval.lsp
+++ gcl27-2.7.1/cmpnew/gcl_cmpeval.lsp
@@ -88,9 +88,7 @@
 		    (or 
 		     (c1constant-value val nil)
 		     (when (functionp val)
-		       (multiple-value-bind (s c n) (fle val)
-			 (declare (ignore c))
-			 (c1function (list (or n s)))))
+		       (c1function (list (fle val))))
 		     `(location ,(make-info :type (object-type val)) (VV ,(add-constant form))))))
 					;                 ((c1var form))))
                  ((c1expr-avct (c1var form))))) ;FIXME pcl
--- gcl27-2.7.1.orig/configure
+++ gcl27-2.7.1/configure
@@ -7342,7 +7342,7 @@ if test ${enable_saved_pre_image_span+y}
 then :
   enableval=$enable_saved_pre_image_span; SAVED_PRE_IMAGE_SPAN=$enableval
 else case e in #(
-  e) SAVED_PRE_IMAGE_SPAN=0x100000000 ;;
+  e) SAVED_PRE_IMAGE_SPAN=0xFFF00000 ;;
 esac
 fi
 
--- gcl27-2.7.1.orig/configure.ac
+++ gcl27-2.7.1/configure.ac
@@ -360,7 +360,7 @@ case $use in
 
 	#Support libboot option
 	AC_ARG_ENABLE([saved_pre_image_span],[  --enable-saved_pre_image_span=0x.... set address span for saved pre images],
-          [SAVED_PRE_IMAGE_SPAN=$enableval],[SAVED_PRE_IMAGE_SPAN=0x100000000])
+          [SAVED_PRE_IMAGE_SPAN=$enableval],[SAVED_PRE_IMAGE_SPAN=0xFFF00000])
 	AC_DEFINE_UNQUOTED(SAVED_PRE_IMAGE_SPAN,$SAVED_PRE_IMAGE_SPAN,[address span for saved pre images])
 
 	AC_ARG_ENABLE([saved_image_span],[  --enable-saved_image_span=0x.... set address span for saved images],
--- gcl27-2.7.1.orig/git.tag
+++ gcl27-2.7.1/git.tag
@@ -1 +1 @@
-"Version_2_7_2pre21"
+"Version_2_7_2pre22"
--- gcl27-2.7.1.orig/lsp/gcl_fpe.lsp
+++ gcl27-2.7.1/lsp/gcl_fpe.lsp
@@ -2,7 +2,7 @@
 (in-package :fpe)
 
 (import 'si::(disassemble-instruction feenableexcept fedisableexcept fld *fixnum *float *double
-				      fetestexcept feclearexcept
+				      fetestexcept feclearexcept address
 				      *fixnum *ushort *uint fun-name
 				      si-class-direct-subclasses si-class-name si-find-class
 				      +fe-list+ +mc-context-offsets+ floating-point-error 
@@ -132,11 +132,11 @@
 
 #.`(let ((fpe-enabled 0)(fpe-set 0))
      #+no-sigfpe
-     (defun flush-floating-point-exceptions nil
+     (defun flush-floating-point-exceptions (name args &optional (fun (symbol-function name)))
        (let ((x (fetestexcept fpe-set)))
 	 (unless (zerop x)
 	   (feclearexcept x)
-	   (floating-point-error x 0 0))))
+	   (floating-point-error x (list* fun "unknown" name args) 0))))
      (defun break-on-floating-point-exceptions 
 	 (&key suspend no-flush
 	    ,@(mapcar (lambda (x) `(,(car x) (logtest ,(caddr x) fpe-enabled))) +fe-list+)
@@ -168,17 +168,23 @@
 	  :initial-value nil)
       'arithmetic-error))
 	 
-(defun floating-point-error (code addr context)
+(defun floating-point-error (code addr context &aux (l (listp addr)))
   (break-on-floating-point-exceptions :suspend t :no-flush t)
   (restart-case
    (unwind-protect
-       (let* ((fun (function-by-address addr))(m (read-instruction addr context)))
-	 ((lambda (&rest r) (apply 'error (if (find-package :conditions) r (list (format nil "~s" r)))))
+	(let* ((fun (if l (pop addr) (function-by-address addr)))
+	       (m (if l addr (read-instruction addr context)))
+	       (addr (if l (address fun) addr)))
+	 ((lambda (&rest r)
+	    (apply 'error (if (find-package :conditions) r (list (format nil "~s" r)))))
 	  (code-condition code)
-	  :operation (list :insn (pop m) :op (pop m) :fun fun :addr addr) :operands m :function-name (when fun (fun-name fun))))
+	  :operation (list :insn (pop m) :op (pop m) :fun fun :addr addr)
+	  :operands m
+	  :function-name (when fun (fun-name fun))))
      (break-on-floating-point-exceptions :no-flush t))
-   (continue nil :report (lambda (s) (format s "Continue disabling floating point exception trapping"))
-	     (apply 'break-on-floating-point-exceptions
-		    :no-flush t
-		    (mapcan (lambda (x) (list x nil))
-			    (break-on-floating-point-exceptions :no-flush t))))))
+    (continue nil
+      :report (lambda (s) (format s "Continue disabling floating point exception trapping"))
+      (apply 'break-on-floating-point-exceptions
+	     :no-flush t
+	     (mapcan (lambda (x) (list x nil))
+		     (break-on-floating-point-exceptions :no-flush t))))))
