summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--guix/build/compile.scm8
1 files changed, 6 insertions, 2 deletions
diff --git a/guix/build/compile.scm b/guix/build/compile.scm
index 9e31be93ff..794f12379c 100644
--- a/guix/build/compile.scm
+++ b/guix/build/compile.scm
@@ -40,8 +40,12 @@
(define %default-optimizations
;; Default optimization options (equivalent to -O2 on Guile 2.2).
- (append (tree-il-default-optimization-options)
- (cps-default-optimization-options)))
+ (append (if (defined? 'tree-il-default-optimization-options)
+ (tree-il-default-optimization-options) ;Guile 2.2
+ (tree-il-optimizations)) ;Guile 3
+ (if (defined? 'cps-default-optimization-options)
+ (cps-default-optimization-options) ;Guile 2.2
+ (cps-optimizations)))) ;Guile 3
(define %lightweight-optimizations
;; Lightweight optimizations (like -O0, but with partial evaluation).