~ chicken-core (chicken-5) ff64c99f03977031cbf378f79354db3a433c5d6d


commit ff64c99f03977031cbf378f79354db3a433c5d6d
Author:     Evan Hanson <evhan@foldling.org>
AuthorDate: Sat Jun 9 08:42:51 2018 +1200
Commit:     Peter Bex <peter@more-magic.net>
CommitDate: Sun Nov 11 20:00:38 2018 +0100

    Wait until after compilation has finished to search for linked objects
    
    This just makes the main `run' procedure in csc.scm read more clearly,
    by waiting until after `run-compilation' has finished and the `compile-only'
    flag has been checked before doing anything related to linking.
    
    Signed-off-by: Peter Bex <peter@more-magic.net>

diff --git a/csc.scm b/csc.scm
index 95f504d3..83d1d2c4 100644
--- a/csc.scm
+++ b/csc.scm
@@ -557,9 +557,6 @@ EOF
 	     (when show-libs (print* (linker-libraries) #\space))
 	     (newline)
 	     (exit) )
-	   (when (pair? linked-extensions)
-	     (set! object-files ; add objects from linked extensions
-	       (append (filter-map find-object-file linked-extensions) object-files)))
 	   (cond ((null? scheme-files)
 		  (when (and (null? c-files)
 			     (null? object-files))
@@ -578,6 +575,9 @@ EOF
 	   (unless translate-only 
 	     (run-compilation)
 	     (unless compile-only
+	       (when (pair? linked-extensions)
+		 (set! object-files ; add objects from linked extensions
+		   (append (filter-map find-object-file linked-extensions) object-files)))
 	       (when (member target-filename scheme-files)
 		 (fprintf (current-error-port)
                           "Warning: output file will overwrite source file `~A' - renaming source to `~A.old'~%"
Trap