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-14) unstable; urgency=medium
 .
   * Version_2_7_0pre17
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: 2024-02-21

--- gcl27-2.7.0.orig/configure
+++ gcl27-2.7.0/configure
@@ -8558,7 +8558,7 @@ printf "%s\n" "got it" >&6; }
 
 	{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking output_arch" >&5
 printf %s "checking output_arch... " >&6; }
-	output_arch=`cat gcl.script |grep OUTPUT_ARCH|head -n 1|sed 's,.*(\(.*\)).*,\1,1'|cut -f1 -d:`;
+	output_arch=`cat gcl.script |grep OUTPUT_ARCH|head -n 1|sed 's,.*(\(.*\)).*,\1:,1'|cut -f1 -d:|tr '-' '_'`;
 	if test "$output_arch" != "" ; then
 
 printf "%s\n" "#define OUTPUT_ARCH bfd_arch_${output_arch}" >>confdefs.h
@@ -8568,6 +8568,26 @@ printf "%s\n" "bfd_arch_${output_arch}"
 	else
      	    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not found" >&5
 printf "%s\n" "not found" >&6; }
+	fi
+	{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking output_mach" >&5
+printf %s "checking output_mach... " >&6; }
+	output_mach=`cat gcl.script |grep OUTPUT_ARCH|head -n 1|sed 's,.*(\(.*\)).*,\1:,1'|cut -f2 -d:|tr '-' '_'`;
+	defaulted=""
+        if test "$output_mach" = "" ; then
+		if test "$output_arch" = "i386" ; then
+		   output_mach="i386_i386";
+		   defaulted="(defaulted)"
+		fi
+	fi
+	if test "$output_mach" != "" ; then
+
+printf "%s\n" "#define OUTPUT_MACH bfd_mach_${output_mach}" >>confdefs.h
+
+     	    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $defaulted bfd_mach_${output_mach}" >&5
+printf "%s\n" "$defaulted bfd_mach_${output_mach}" >&6; }
+	else
+     	    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not found" >&5
+printf "%s\n" "not found" >&6; }
 	fi
 
 	{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: trying to adjust text start" >&5
--- gcl27-2.7.0.orig/configure.in
+++ gcl27-2.7.0/configure.in
@@ -1458,13 +1458,29 @@ if test "$use" != "386-gnu" ; then #hurd
 	AC_MSG_RESULT(got it)
 
 	AC_MSG_CHECKING([output_arch])
-	output_arch=`cat gcl.script |grep OUTPUT_ARCH|head -n 1|sed 's,.*(\(.*\)).*,\1,1'|cut -f1 -d:`;
+	output_arch=`cat gcl.script |grep OUTPUT_ARCH|head -n 1|sed 's,.*(\(.*\)).*,\1:,1'|cut -f1 -d:|tr '-' '_'`;
 	if test "$output_arch" != "" ; then
 	    AC_DEFINE_UNQUOTED(OUTPUT_ARCH,bfd_arch_${output_arch},[bfd output arch])
      	    AC_MSG_RESULT([bfd_arch_${output_arch}])
 	else
      	    AC_MSG_RESULT([not found])
 	fi
+	AC_MSG_CHECKING([output_mach])
+	output_mach=`cat gcl.script |grep OUTPUT_ARCH|head -n 1|sed 's,.*(\(.*\)).*,\1:,1'|cut -f2 -d:|tr '-' '_'`;
+dnl     FIXME
+	defaulted=""
+        if test "$output_mach" = "" ; then
+		if test "$output_arch" = "i386" ; then
+		   output_mach="i386_i386";
+		   defaulted="(defaulted)"
+		fi
+	fi
+	if test "$output_mach" != "" ; then
+	    AC_DEFINE_UNQUOTED(OUTPUT_MACH,bfd_mach_${output_mach},[bfd output mach])
+     	    AC_MSG_RESULT([$defaulted bfd_mach_${output_mach}])
+	else
+     	    AC_MSG_RESULT([not found])
+	fi
 
 	AC_MSG_NOTICE([trying to adjust text start])
 	cp gcl.script gcl.script.def
--- gcl27-2.7.0.orig/git.tag
+++ gcl27-2.7.0/git.tag
@@ -1,2 +1,2 @@
-"Version_2_7_0pre16"
+"Version_2_7_0pre17"
 
--- gcl27-2.7.0.orig/h/gclincl.h.in
+++ gcl27-2.7.0/h/gclincl.h.in
@@ -333,6 +333,9 @@
 /* bfd output arch */
 #undef OUTPUT_ARCH
 
+/* bfd output mach */
+#undef OUTPUT_MACH
+
 /* Define to the address where bug reports for this package should be sent. */
 #undef PACKAGE_BUGREPORT
 
--- gcl27-2.7.0.orig/lsp/gcl_sf.lsp
+++ gcl27-2.7.0/lsp/gcl_sf.lsp
@@ -3,6 +3,11 @@
 
 (defun strcat (&rest r) (declare (dynamic-extent r)) (nstring-downcase (apply 'string-concatenate r)))
 
+ #.`(defun end-shft (s &optional (sz 1)(b fixnum-length))
+      (declare (ignorable sz b))
+      ,(if (member :clx-little-endian *features*) 's '(- b s sz)))
+ (si::putprop 'end-shft t 'si::cmp-inline)
+
 (eval-when
  (eval compile) 
   
@@ -124,11 +129,6 @@
 		,@(unless (eq tp t) `((check-type x ,tp))),@(when ytp `((check-type y ,ytp)))
 	       ,@body)))
 
- #.`(defun end-shft (s &optional (sz 1)(b fixnum-length))
-      (declare (ignorable sz b))
-      ,(if (member :clx-little-endian *features*) 's '(- b s sz)))
- (si::putprop 'end-shft t 'si::cmp-inline)
-
  (defun gbe (f tp o s sz b a &aux (s (end-shft s sz b)))
    `((the ,tp ,(m& (m>> `(,f ,a ,o nil nil) s) (when (< (+ s sz) b) (mm (1- (ash 1 sz))))))))
  (defun sbe (f    o s sz b a &aux (s (end-shft s sz b)))
--- gcl27-2.7.0.orig/o/main.c
+++ gcl27-2.7.0/o/main.c
@@ -1322,6 +1322,9 @@ DEFUN("DISASSEMBLE-INSTRUCTION",object,f
       s(&i, stdout,(fprintf_ftype) my_fprintf,my_fprintf_styled);
       i.read_memory_func=my_read;
       i.print_address_func=my_pa;
+#if defined(OUTPUT_MACH)
+      i.mach=OUTPUT_MACH;
+#endif
       if ((s=dlsym(v,"disassembler"))) {
 	disassembler_ftype disasm=(disassembler_ftype)(ufixnum)s(OUTPUT_ARCH,false,0,NULL);/*bfd_mach_x86_64*/
 	bp=b;
