From 31a8c798e5dc30f969d0b022e8133c89a94fdab2 Mon Sep 17 00:00:00 2001
From: rtoy <rtoy>
Date: Fri, 23 Jul 2010 02:06:53 +0000
Subject: [PATCH] Fix long-standing compiler error when cross-compiling the new
 compiler.  There are errors about undefined FIXUP-CODE-OBJECT and
 SANCTIFY-FOR-EXECUTION functions when compiling generic/core.lisp.

This allows the cross-compiling compiler to use the -batch flag.
---
 tools/cross-scripts/cross-x86-x86.lisp | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/tools/cross-scripts/cross-x86-x86.lisp b/tools/cross-scripts/cross-x86-x86.lisp
index a7daefc2b..aa4d84df8 100644
--- a/tools/cross-scripts/cross-x86-x86.lisp
+++ b/tools/cross-scripts/cross-x86-x86.lisp
@@ -36,6 +36,16 @@
 ;;; Compile the new backend.
 (pushnew :bootstrap *features*)
 (pushnew :building-cross-compiler *features*)
+
+;; Make fixup-code-object and sanctify-for-execution in the VM package
+;; be the same as the original.  Needed to get rid of a compiler error
+;; in generic/core.lisp.  (This halts cross-compilations if the
+;; compiling lisp uses the -batch flag.
+(import 'old-vm::fixup-code-object "VM")
+(import 'old-vm::sanctify-for-execution "VM")
+(export 'vm::fixup-code-object "VM")
+(export 'vm::sanctify-for-execution "VM")
+
 (load "target:tools/comcom")
 
 ;;; Load the new backend.
@@ -193,8 +203,6 @@
   (declare (type simple-string name))
   name)
 (export 'extern-alien-name)
-(export 'fixup-code-object)
-(export 'sanctify-for-execution)
 (in-package :cl-user)
 
 ;;; Don't load compiler parts from the target compilation
-- 
GitLab