$ ./run.sh + rm -rf '*.so' '*.o' m1.import.scm 'src/*.so' src/m1.o + tree . ├── main ├── main.link ├── main.scm ├── run.sh ├── src │   ├── m1.scm │   └── m2.scm ├── static-build2.txt └── static-build.txt 1 directory, 8 files + echo ---------------------------------------- ---------------------------------------- + more run.sh src/m1.scm src/m2.scm main.scm + cat :::::::::::::: run.sh :::::::::::::: #!/usr/bin/env bash set -euox pipefail rm -rf *.so *.o *.import.scm src/*.so src/*.o tree echo "----------------------------------------" more run.sh src/m1.scm src/m2.scm main.scm | cat echo "----------------------------------------" csc -s -O3 -J -unit m1 src/m1.scm -o m1.so csc -c -O3 -J -unit m1 src/m1.scm csc -c -O3 -J -uses m1 -unit m2 src/m2.scm csc -static main.scm -uses m1 src/m1.o -uses m2 src/m2.o ./main :::::::::::::: src/m1.scm :::::::::::::: (module m1 (m1-bar) (import scheme (chicken base)) (define (m1-bar f) (print "m1-bar called " f) `(list m1-bar ,f))) :::::::::::::: src/m2.scm :::::::::::::: (module m2 (m2-macro) (import scheme (chicken base)) (import-for-syntax m1) (define-syntax m2-macro (ir-macro-transformer (lambda (e inj cmp) (m1-bar (cdr e)))))) :::::::::::::: main.scm :::::::::::::: (import m2) (print (m2-macro "hello" "there")) + echo ---------------------------------------- ---------------------------------------- + csc -s -O3 -J -unit m1 src/m1.scm -o m1.so + csc -c -O3 -J -unit m1 src/m1.scm + csc -c -O3 -J -uses m1 -unit m2 src/m2.scm + csc -static main.scm -uses m1 src/m1.o -uses m2 src/m2.o m1-bar called (hello there) Warning: literal in operator position: ("hello" "there") Warning: at toplevel: in procedure call to `"hello"', expected a value of type `(procedure (*) *)' but was given a value of type `string' + ./main Error: call of non-procedure: "hello"