From d6fc24083a6075d918e6c5b0f543e9d76fe38ce6 Mon Sep 17 00:00:00 2001
From: Raymond Toy <toy.raymond@gmail.com>
Date: Sun, 29 Jan 2012 09:20:41 -0800
Subject: [PATCH] When writing out the runtime features to internals.h, only
 include the features in the target backend.  This prevents runtime features
 (like :executable or :heap-overflow-check) from leaking from the compiling
 system to the target system which might not have these.

---
 src/compiler/generic/new-genesis.lisp | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/src/compiler/generic/new-genesis.lisp b/src/compiler/generic/new-genesis.lisp
index b6781cc6a..d356c3666 100644
--- a/src/compiler/generic/new-genesis.lisp
+++ b/src/compiler/generic/new-genesis.lisp
@@ -2606,14 +2606,16 @@
 		   vm:other-pointer-type
 		   (if symbol (vm:static-symbol-offset symbol) 0)))))
   ;;
-  ;; Write out features.
+  ;; Write out the runtime features, but only if they are also target
+  ;; features.
   (format t "~%/* Runtime features when built. */~2%")
   (dolist (feature sys:*runtime-features*)
-    (format t "#define FEATURE_~a 1~%"
-	    (nsubstitute #\_ #\-
-			 (remove-if #'(lambda (char)
-					(member char '(#\% #\* #\.)))
-				    (symbol-name feature)))))
+    (when (c::target-featurep feature)
+      (format t "#define FEATURE_~a 1~%"
+	      (nsubstitute #\_ #\-
+			   (remove-if #'(lambda (char)
+					  (member char '(#\% #\* #\.)))
+				      (symbol-name feature))))))
   ;;
   (format t "~%#endif~%"))
 
-- 
GitLab