chicken-janitors
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-janitors] #1225: Strange static compilation behaviour


From: Chicken Trac
Subject: [Chicken-janitors] #1225: Strange static compilation behaviour
Date: Thu, 19 Nov 2015 14:57:55 -0000

#1225: Strange static compilation behaviour
----------------------+---------------------
 Reporter:  kooda     |      Owner:
     Type:  defect    |     Status:  new
 Priority:  minor     |  Milestone:  someday
Component:  compiler  |    Version:  4.10.x
 Keywords:            |
----------------------+---------------------
 I’ve been experimenting on static compilation of CHICKEN programs in the
 last few days and stumbled upon this weird behaviour.

 Here are the files used:

 {{{
 ;; mod.scm
 (module mod
     (func)
   (import scheme chicken)
   (define (func) (print "Hello world!")))
 }}}

 {{{
 ;; test.scm
 (use mod)
 (func)
 }}}

 When compiling the module with -J, everything goes well:
 {{{
 $ csc mod.scm -c -J -unit mod
 $ csc test.scm mod.o -uses mod -static-libs
 $ ./test -:D
 [debug] application startup...
 [debug] heap resized to 1048576 bytes
 [debug] stack bottom is 0x7fff266950b0.
 [debug] entering toplevel toplevel...
 [debug] entering toplevel library_toplevel...
 [debug] entering toplevel build_2dversion_toplevel...
 [debug] entering toplevel eval_toplevel...
 [debug] entering toplevel expand_toplevel...
 [debug] entering toplevel modules_toplevel...
 [debug] resizing mutation-stack from 8k to 16k ...
 [debug] entering toplevel chicken_2dsyntax_toplevel...
 [debug] entering toplevel mod_toplevel...
 Hello world!
 [debug] forcing finalizers...
 [debug] application terminated normally
 }}}


 Now if I remove mod.o (note that I keep mod.import.scm so the compiler
 knows about the module) and recompile the application, here is what
 happens:
 {{{
 $ rm mod.o
 $ csc mod.scm -c -unit mod
 $ csc test.scm mod.o -uses mod -static-libs
 $ ./test -:D
 [debug] application startup...
 [debug] heap resized to 1048576 bytes
 [debug] stack bottom is 0x7ffea745e110.
 [debug] entering toplevel toplevel...
 [debug] entering toplevel library_toplevel...
 [debug] entering toplevel build_2dversion_toplevel...
 [debug] entering toplevel eval_toplevel...
 [debug] entering toplevel expand_toplevel...
 [debug] entering toplevel modules_toplevel...
 [debug] resizing mutation-stack from 8k to 16k ...
 [debug] entering toplevel chicken_2dsyntax_toplevel...
 [debug] entering toplevel mod_toplevel...

 Error: (import) during expansion of (import ...) - cannot import from
 undefined module: chicken

         Call history:

         mod.scm:1: eval
         <syntax>          (import scheme chicken)       <--
 }}}

--
Ticket URL: <http://bugs.call-cc.org/ticket/1225>
CHICKEN Scheme <http://www.call-cc.org/>
CHICKEN Scheme is a compiler for the Scheme programming language.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]