From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Camm Maguire <camm@debian.org>
Date: May, 22 2026 15:34:58 +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.

---
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
@@ -272,8 +272,11 @@ unixport/raw_%: unixport/lib%.a $(FF) $(
 		  $(CC) \
                      $$(otool -l $@ | bin/mac_arm_relink ps=$(SEGMENT_ALIGNMENT_BITS) base=$(TEXT_BASE)) \
                      $(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 && \
+		  (  LV=$$(ld -v  2>&1 | head -n 1 | awk '{print $$2}' | cut -f2 -d: | cut -d- -f2 | cut -d\. -f1); \
+                     echo "Linker version $$LV" ; \
+                     [ "$$(printf '%s\n1167\n' $$LV | sort -r -V |head -n 1)"  != "1167" ] || \
+			( echo "Patching" ; \
+                          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:\
--- gcl27-2.7.1.orig/Makefile.in
+++ gcl27-2.7.1/Makefile.in
@@ -4584,8 +4584,11 @@ unixport/raw_%: unixport/lib%.a $(FF) $(
 		  $(CC) \
                      $$(otool -l $@ | bin/mac_arm_relink ps=$(SEGMENT_ALIGNMENT_BITS) base=$(TEXT_BASE)) \
                      $(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 && \
+		  (  LV=$$(ld -v  2>&1 | head -n 1 | awk '{print $$2}' | cut -f2 -d: | cut -d- -f2 | cut -d\. -f1); \
+                     echo "Linker version $$LV" ; \
+                     [ "$$(printf '%s\n1167\n' $$LV | sort -r -V |head -n 1)"  != "1167" ] || \
+			( echo "Patching" ; \
+                          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:\
--- gcl27-2.7.1.orig/cmpnew/gcl_cmpfun.lsp
+++ gcl27-2.7.1/cmpnew/gcl_cmpfun.lsp
@@ -350,6 +350,7 @@
 		cadddr cdaddr cddadr cdddar cddddr logand lognot logior logxor c-type complex-real
 		complex-imag ratio-numerator ratio-denominator cnum-type si::number-plus si::number-minus
 		si::number-times si::number-divide ;FIXME more
+		si::expand-deftype
 		,@(mapcar (lambda (x) (cdr x)) (remove-if-not (lambda (x) (symbolp (cdr x))) +cmp-type-alist+))))
   (si::putprop l t 'c1no-side-effects))
 
--- gcl27-2.7.1.orig/cmpnew/gcl_cmpopt.lsp
+++ gcl27-2.7.1/cmpnew/gcl_cmpopt.lsp
@@ -895,9 +895,9 @@
    (get 'truncate 'inline-always))
 (push '((fixnum) (returns-exactly fixnum fixnum) #.(flags rfa)"({fixnum _t=(#0);@1(#0)-_t@ _t;})")
    (get 'truncate 'inline-always))
-(push '((short-float) (returns-exactly fixnum short-float) #.(flags rfa)"({float _t=(#0);@1(#0)-_t@ _t;})")
+(push '((short-float) (returns-exactly fixnum short-float) #.(flags rfa)"({fixnum _t=(#0);@1(#0)-_t@ _t;})")
    (get 'truncate 'inline-always))
-(push '((long-float) (returns-exactly fixnum long-float) #.(flags rfa)"({double _t=(#0);@1(#0)-_t@ _t;})")
+(push '((long-float) (returns-exactly fixnum long-float) #.(flags rfa)"({fixnum _t=(#0);@1(#0)-_t@ _t;})")
    (get 'truncate 'inline-always))
 
 ;;COMPLEXP
--- gcl27-2.7.1.orig/configure
+++ gcl27-2.7.1/configure
@@ -4189,6 +4189,10 @@ if test "$use" = "gnuwin95" ; then
 
    libboot="no"
 fi
+case $use in
+   *86*gnu) libboot="no";;
+esac
+
 
  if test "$libboot" = "yes"; then
   AMM_LIBBOOT_TRUE=
@@ -7210,7 +7214,8 @@ add_args_to_cflags  -fsigned-char -pipe
                     -fno-PIE -fno-pie -fno-PIC -fno-pic \
 	            -Wall \
 	            -Wno-builtin-requires-header -Wno-empty-body -Wno-self-assign \
-	            -Wno-unused-but-set-variable -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 \
+	            -Wno-unused-but-set-variable -Wno-tautological-compare \
+		    -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 \
 		    -fbracket-depth=512
 
 add_args_to_ldflags -no-pie -Wl,-z,relro # -Wl,-z,lazy
@@ -8858,10 +8863,10 @@ fi
 
 
 case $use in
-    sh4*) ;;     #FIXME, these exceptions needed as of gcc 4.7
-    hppa*) ;;    #FIXME
-    powerpc*) ;; #FIXME
-    alpha*) ;;   #FIXME
+#    sh4*) ;;     #FIXME, these exceptions needed as of gcc 4.7
+#    hppa*) ;;    #FIXME
+#    powerpc*) ;; #FIXME
+#    alpha*) ;;   #FIXME
     ia64*) ;;    #FIXME
     *)
 	{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking __builtin___clear_cache" >&5
@@ -8880,8 +8885,8 @@ int
 main (void)
 {
 
-			void *v,*ve;
-			__builtin___clear_cache(v,ve);
+			char v[1<<12];
+			__builtin___clear_cache(v,v+sizeof(v));
 
   ;
   return 0;
--- gcl27-2.7.1.orig/configure.ac
+++ gcl27-2.7.1/configure.ac
@@ -82,6 +82,10 @@ if test "$use" = "gnuwin95" ; then
    AC_SUBST(LF)
    libboot="no"
 fi
+case $use in
+   *86*gnu) libboot="no";;
+esac
+
 
 AM_CONDITIONAL([AMM_LIBBOOT],[test "$libboot" = "yes"])
 if test "$libboot" = "yes" ; then
@@ -276,7 +280,8 @@ add_args_to_cflags  -fsigned-char -pipe
                     -fno-PIE -fno-pie -fno-PIC -fno-pic \
 	            -Wall \
 	            -Wno-builtin-requires-header -Wno-empty-body -Wno-self-assign \
-	            -Wno-unused-but-set-variable -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 \
+	            -Wno-unused-but-set-variable -Wno-tautological-compare \
+		    -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 \
 		    -fbracket-depth=512
 
 add_args_to_ldflags -no-pie -Wl,-z,relro # -Wl,-z,lazy
@@ -830,19 +835,19 @@ AC_RUN_IFELSE(
 
 
 case $use in
-    sh4*) ;;     #FIXME, these exceptions needed as of gcc 4.7
-    hppa*) ;;    #FIXME
-    powerpc*) ;; #FIXME
-    alpha*) ;;   #FIXME
+#    sh4*) ;;     #FIXME, these exceptions needed as of gcc 4.7
+#    hppa*) ;;    #FIXME
+#    powerpc*) ;; #FIXME
+#    alpha*) ;;   #FIXME
     ia64*) ;;    #FIXME
     *)
-	AC_MSG_CHECKING(__builtin___clear_cache)
+	AC_MSG_CHECKING([__builtin___clear_cache])
 	AC_RUN_IFELSE(
 	    [AC_LANG_PROGRAM(
 		    [[]],
 		    [[
-			void *v,*ve;
-			__builtin___clear_cache(v,ve);
+			char v[1<<12];
+			__builtin___clear_cache(v,v+sizeof(v));
 		    ]])],
 	    [AC_DEFINE(HAVE_BUILTIN_CLEAR_CACHE,1,[have __builtin__clear_cache instruction])
 	     AC_MSG_RESULT(yes)],
--- gcl27-2.7.1.orig/git.tag
+++ gcl27-2.7.1/git.tag
@@ -1 +1 @@
-"Version_2_7_2pre23"
+"Version_2_7_2pre24"
--- gcl27-2.7.1.orig/h/hppa-linux.h
+++ gcl27-2.7.1/h/hppa-linux.h
@@ -3,17 +3,17 @@
 #define SGC
 #define STATIC_FUNCTION_POINTERS
 
-#ifdef IN_SFASL
-#include <sys/mman.h>
-#define CLEAR_CACHE_LINE_SIZE 32
-#define CLEAR_CACHE {\
-   void *v1=memory->cfd.cfd_start,*v,*ve=v1+memory->cfd.cfd_size;	\
-   v1=(void *)((unsigned long)v1 & ~(CLEAR_CACHE_LINE_SIZE - 1));\
-   for (v=v1;v<ve;v+=CLEAR_CACHE_LINE_SIZE) asm __volatile__ ("fdc 0(%0)" : : "r" (v) : "memory");\
-   asm __volatile__ ("syncdma\n\tsync" : : "r" (v) : "memory");\
-   for (v=v1;v<ve;v+=CLEAR_CACHE_LINE_SIZE) asm __volatile__ ("fic 0(%%sr4,%0)" : : "r" (v) : "memory");\
-   asm __volatile__ ("syncdma\n\tsync" : : "r" (v) : "memory");}
-#endif
+/* #ifdef IN_SFASL */
+/* #include <sys/mman.h> */
+/* #define CLEAR_CACHE_LINE_SIZE 32 */
+/* #define CLEAR_CACHE {\ */
+/*    void *v1=memory->cfd.cfd_start,*v,*ve=v1+memory->cfd.cfd_size;	\ */
+/*    v1=(void *)((unsigned long)v1 & ~(CLEAR_CACHE_LINE_SIZE - 1));\ */
+/*    for (v=v1;v<ve;v+=CLEAR_CACHE_LINE_SIZE) asm __volatile__ ("fdc 0(%0)" : : "r" (v) : "memory");\ */
+/*    asm __volatile__ ("syncdma\n\tsync" : : "r" (v) : "memory");\ */
+/*    for (v=v1;v<ve;v+=CLEAR_CACHE_LINE_SIZE) asm __volatile__ ("fic 0(%%sr4,%0)" : : "r" (v) : "memory");\ */
+/*    asm __volatile__ ("syncdma\n\tsync" : : "r" (v) : "memory");} */
+/* #endif */
 
 #define RELOC_H "elf32_hppa_reloc.h"
 #define SPECIAL_RELOC_H "elf32_hppa_reloc_special.h"
--- gcl27-2.7.1.orig/h/m68k-linux.h
+++ gcl27-2.7.1/h/m68k-linux.h
@@ -41,13 +41,13 @@
 #define	M68K
 /* #define SGC *//*FIXME:  Unknown m68k cpu in modern emulators*/
 
-#include <asm/cachectl.h>
-int cacheflush(void *,int,int,int);
-#define CLEAR_CACHE_LINE_SIZE 32
-#define CLEAR_CACHE do {void *v=memory->cfd.cfd_start,*ve=v+memory->cfd.cfd_size; \
-                        v=(void *)((unsigned long)v & ~(CLEAR_CACHE_LINE_SIZE - 1));\
-                        cacheflush(v,FLUSH_SCOPE_PAGE,FLUSH_CACHE_BOTH,ve-v);\
-                    } while(0)
+/* #include <asm/cachectl.h> */
+/* int cacheflush(void *,int,int,int); */
+/* #define CLEAR_CACHE_LINE_SIZE 32 */
+/* #define CLEAR_CACHE do {void *v=memory->cfd.cfd_start,*ve=v+memory->cfd.cfd_size; \ */
+/*                         v=(void *)((unsigned long)v & ~(CLEAR_CACHE_LINE_SIZE - 1));\ */
+/*                         cacheflush(v,FLUSH_SCOPE_PAGE,FLUSH_CACHE_BOTH,ve-v);\ */
+/*                     } while(0) */
 
 #define C_GC_OFFSET 2
 
--- gcl27-2.7.1.orig/h/mach64_aarch64_reloc.h
+++ gcl27-2.7.1/h/mach64_aarch64_reloc.h
@@ -43,10 +43,10 @@
     addend=0;
     a&=0xfff;
     a>>=(((*q)>>29)&0x1)*                              /*not add/sub*/
-          ((((*q)>>26)&0x1) ?                          /*simd*/
-	   ((((*q)>>22)&0x3) ?
-	    (((*q)>>22)&0x3)+1 : (((*q)>>30)&0x1)) :
-	   (((*q)>>30)&0x3));                          /*gp*/
+      (((((*q)>>26)&0x1)&&
+        (((*q)>>22)&0x1)&&
+	(!(((*q)>>30)&0x3))) ?                           /*simd hardcode*/
+       4 : (((*q)>>30)&0x3));                          /*gp*/
     store_val(q,MASK(12) << 10, a << 10);
     break;
   case ARM64_RELOC_UNSIGNED:
--- gcl27-2.7.1.orig/h/powerpc-linux.h
+++ gcl27-2.7.1/h/powerpc-linux.h
@@ -2,12 +2,12 @@
 
 #define SGC
 
-#define CLEAR_CACHE_LINE_SIZE 32
-#define CLEAR_CACHE do {void *v=memory->cfd.cfd_start,*ve=v+memory->cfd.cfd_size; \
-                        v=(void *)((unsigned long)v & ~(CLEAR_CACHE_LINE_SIZE - 1));\
-                        for (;v<ve;v+=CLEAR_CACHE_LINE_SIZE) \
-                           asm __volatile__ ("dcbst 0,%0\n\tsync\n\ticbi 0,%0\n\tsync\n\tisync": : "r" (v) : "memory");\
-                        } while(0)
+/* #define CLEAR_CACHE_LINE_SIZE 32 */
+/* #define CLEAR_CACHE do {void *v=memory->cfd.cfd_start,*ve=v+memory->cfd.cfd_size; \ */
+/*                         v=(void *)((unsigned long)v & ~(CLEAR_CACHE_LINE_SIZE - 1));\ */
+/*                         for (;v<ve;v+=CLEAR_CACHE_LINE_SIZE) \ */
+/*                            asm __volatile__ ("dcbst 0,%0\n\tsync\n\ticbi 0,%0\n\tsync\n\tisync": : "r" (v) : "memory");\ */
+/*                         } while(0) */
 
 #if SIZEOF_LONG == 4
 #define RELOC_H "elf32_ppc_reloc.h"
--- gcl27-2.7.1.orig/h/sh4-linux.h
+++ gcl27-2.7.1/h/sh4-linux.h
@@ -8,14 +8,14 @@
 #define SGC
 
 
-#ifdef IN_SFASL
-#include <sys/mman.h>
-#define CLEAR_CACHE {\
-   void *p=memory->cfd.cfd_start,*pe=p+memory->cfd.cfd_size; \
-   p=(void *)((unsigned long)p & ~(PAGESIZE-1)); \
-   for (;p<pe;p++) /*+=PAGESIZE?*/ asm __volatile__ ("ocbp @%0\n\t": : "r" (p) : "memory");\
-}
-#endif
+/* #ifdef IN_SFASL */
+/* #include <sys/mman.h> */
+/* #define CLEAR_CACHE {\ */
+/*    void *p=memory->cfd.cfd_start,*pe=p+memory->cfd.cfd_size; \ */
+/*    p=(void *)((unsigned long)p & ~(PAGESIZE-1)); \ */
+/*    for (;p<pe;p++) /\*+=PAGESIZE?*\/ asm __volatile__ ("ocbp @%0\n\t": : "r" (p) : "memory");\ */
+/* } */
+/* #endif */
 #define RELOC_H "elf32_sh4_reloc.h"
 
 #define NEED_STACK_CHK_GUARD
--- gcl27-2.7.1.orig/lsp/gcl_mislib.lsp
+++ gcl27-2.7.1/lsp/gcl_mislib.lsp
@@ -89,16 +89,20 @@
 	      (unless tzp (> dstp 0))
 	      (if tzp tz (+ (truncate (- off) 3600) dstp))))))
 
-(defun encode-universal-time (s n h d m y &optional (tz (this-tz) tzp))
+(defun encode-universal-time (s n h d m y &optional (tz (this-tz) tzp)
+					    &aux (tzo (* (- tz (this-tz)) 3600)))
   (declare (optimize (safety 2)))
   (check-type s (integer 0 59))
   (check-type n (integer 0 59))
   (check-type h (integer 0 23))
   (check-type d (integer 1 31))
   (check-type m (integer 1 12))
-  (check-type y integer)
+  (check-type y (integer 1899))
   (check-type tz rational)
-  (+ (mktime s n h d (1- m) (- y 1900) (if tzp 0 -1)) +secs-to-1970+ (* (- tz (this-tz)) 3600)))
+  (cond ((eql 1899 y)
+	 (assert (and (eql h 23) (eql d 31) (eql m 12)))
+	 (+ s (* n 60) tzo))
+	((+ (mktime s n h d (1- m) (- y 1900) (if tzp 0 -1)) +secs-to-1970+ tzo))))
 
 (defun get-decoded-time ()
   (decode-universal-time (get-universal-time)))
--- gcl27-2.7.1.orig/o/alloc.c
+++ gcl27-2.7.1/o/alloc.c
@@ -1308,7 +1308,7 @@ gcl_init_alloc(void *cs_start) {
       ufixnum k;
       for (p=pagetochar(page(v)),k=0;k<tm->tm_nppage;k++,p+=tm->tm_size) {
  	object o=p;
- 	if (!is_free(o) && type_of(o)==t_cfdata && (void *)o->cfd.cfd_start>=data_start)
+ 	if (!is_free(o) && type_of(o)==t_cfdata && !o->d.tt && (void *)o->cfd.cfd_start>=data_start)
 	  gcl_mprotect((void *)o->cfd.cfd_start,o->cfd.cfd_nexp<<PAGEWIDTH,PROT_READ|PROT_EXEC);
       }
     }
@@ -1707,7 +1707,12 @@ malloc_internal(size_t size) {
     recursive_malloc=1;
     gcl_init_alloc(&size);
     recursive_malloc=0;
-  }
+  } else
+    /*FIXME idempotent but required gcl_init_alloc functions in saved images*/
+#ifdef INITIALIZE_BRK
+    INITIALIZE_BRK;
+#endif
+
 
   CHECK_INTERRUPT;
   
--- gcl27-2.7.1.orig/o/funlink.c
+++ gcl27-2.7.1/o/funlink.c
@@ -291,7 +291,7 @@ call_proc_new23(object sym,ufixnum clp,u
       	fas=0;
       else if (u.f.va &&(nfargs<fun->fun.fun_minarg || nfargs>fun->fun.fun_maxarg))/*u.f.va -> varg, xxx*/
 	fas=0;
-      else if (u.f.va && VFUN_NARGS<0 && fun->fun.fun_minarg==fun->fun.fun_maxarg)/*runtime apply #arg checking omitted in reg fns*/
+      else if (u.f.va && /* VFUN_NARGS<0 &&  */fun->fun.fun_minarg==fun->fun.fun_maxarg)/*runtime apply #arg checking omitted in reg fns*/
 	fas=0;
       /* else if (u.f.va && VFUN_NARGS<0 && */
       /* 	       (nargs-1<fun->fun.fun_minarg || nargs-1>fun->fun.fun_maxarg))/\*u.f.va -> varg, xxx*\/ */
--- gcl27-2.7.1.orig/o/sfaslcoff.c
+++ gcl27-2.7.1/o/sfaslcoff.c
@@ -488,8 +488,12 @@ fasload(object faslfile) {
 
   massert(!un_mmap(st,est));
 
-#ifdef CLEAR_CACHE
+#if defined(CLEAR_CACHE)
   CLEAR_CACHE;
+#elif defined(HAVE_BUILTIN_CLEAR_CACHE)
+  __builtin___clear_cache((void *)memory->cfd.cfd_start,(void *)memory->cfd.cfd_start+memory->cfd.cfd_size);
+#else
+  #error "No clear cache"
 #endif
 
   if(symbol_value(sLAload_verboseA)!=Cnil) {
--- gcl27-2.7.1.orig/o/sfaslelf.c
+++ gcl27-2.7.1/o/sfaslelf.c
@@ -627,10 +627,12 @@ fasload(object faslfile) {
   
   massert(!clear_protect_memory(memory));
 
-#if defined(HAVE_BUILTIN_CLEAR_CACHE)
-  __builtin___clear_cache((void *)memory->cfd.cfd_start,(void *)memory->cfd.cfd_start+memory->cfd.cfd_size);
-#elif defined(CLEAR_CACHE)
+#if defined(CLEAR_CACHE)
   CLEAR_CACHE;
+#elif defined(HAVE_BUILTIN_CLEAR_CACHE)
+  __builtin___clear_cache((void *)memory->cfd.cfd_start,(void *)memory->cfd.cfd_start+memory->cfd.cfd_size);
+#else
+  #error "No clear cache"
 #endif  
 
   if(symbol_value(sLAload_verboseA)!=Cnil) {
--- gcl27-2.7.1.orig/o/sfaslmacho.c
+++ gcl27-2.7.1/o/sfaslmacho.c
@@ -31,6 +31,10 @@
 #define LOAD_SEC(sec) ({ul _fl=sec->flags&SECTION_TYPE;\
       (_fl<=S_SYMBOL_STUBS || _fl==S_16BYTE_LITERALS) && _fl!=S_ZEROFILL && !(sec->flags&S_ATTR_DEBUG);})
 
+#define GCL_EXTERNAL(sym) ((sym)->n_type & N_EXT || \
+			   (((sym)->n_type & N_TYPE) == N_SECT && \
+			    (sym)->n_sect == 1 && \
+			    !memcmp(strtab+(sym)->n_un.n_strx,"___",3)))
 
 #define MASK(n) (~(~0ULL << (n)))
 
@@ -488,7 +492,7 @@ load_self_symbols() {
 
   for (a=c_table.ptable,sym=sym1;sym<syme;sym++) {
     
-    if ((sym->n_type & N_STAB) || !(sym->n_type & N_EXT))
+    if ((sym->n_type & N_STAB) || !GCL_EXTERNAL(sym))
       continue;
 
     a->address=sym->n_value;
@@ -504,7 +508,7 @@ load_self_symbols() {
 
   for (c_table.local_ptable=a,sym=sym1;sym<syme;sym++) {
 
-    if ((sym->n_type & N_STAB) || sym->n_type & N_EXT)
+    if ((sym->n_type & N_STAB) || GCL_EXTERNAL(sym))
       continue;
 
     a->address=sym->n_value;
@@ -645,10 +649,12 @@ fasload(object faslfile) {
   
   massert(!clear_protect_memory(memory));
 
-#if defined(HAVE_BUILTIN_CLEAR_CACHE)
-  __builtin___clear_cache((void *)memory->cfd.cfd_start,(void *)memory->cfd.cfd_start+memory->cfd.cfd_size);
-#elif defined(CLEAR_CACHE)
+#if defined(CLEAR_CACHE)
   CLEAR_CACHE;
+#elif defined(HAVE_BUILTIN_CLEAR_CACHE)
+  __builtin___clear_cache((void *)memory->cfd.cfd_start,(void *)memory->cfd.cfd_start+memory->cfd.cfd_size);
+#else
+  #error "No clear cache"
 #endif
   
   massert(!un_mmap(v1,ve));
