mescc: Opt for reproducible builds with Guile and Mes.
* module/mescc/compile.scm (mes-or-reproducible?): New variable. (ast->comment): Use it. * module/mescc/preprocess.scm (mes-or-reproducible?): New variable. (c99-input->full-ast): Use it.
This commit is contained in:
parent
720f224a08
commit
36b2857d5b
|
@ -42,6 +42,7 @@
|
||||||
c99-input->object))
|
c99-input->object))
|
||||||
|
|
||||||
(define mes? (pair? (current-module)))
|
(define mes? (pair? (current-module)))
|
||||||
|
(define mes-or-reproducible? #t)
|
||||||
(define (cc-amd? info) #f) ; use AMD calling convention?
|
(define (cc-amd? info) #f) ; use AMD calling convention?
|
||||||
;; (define %reduced-register-count #f) ; use all registers?
|
;; (define %reduced-register-count #f) ; use all registers?
|
||||||
(define %reduced-register-count 2) ; use reduced instruction set
|
(define %reduced-register-count 2) ; use reduced instruction set
|
||||||
|
@ -581,7 +582,7 @@
|
||||||
(wrap-as `((#:comment ,o))))
|
(wrap-as `((#:comment ,o))))
|
||||||
|
|
||||||
(define (ast->comment o)
|
(define (ast->comment o)
|
||||||
(if mes? '()
|
(if mes-or-reproducible? '()
|
||||||
(let* ((source (with-output-to-string (lambda () (pretty-print-c99 o))))
|
(let* ((source (with-output-to-string (lambda () (pretty-print-c99 o))))
|
||||||
;; Nyacc fixups
|
;; Nyacc fixups
|
||||||
(source (string-substitute source "\\" "\\\\"))
|
(source (string-substitute source "\\" "\\\\"))
|
||||||
|
@ -1514,7 +1515,7 @@
|
||||||
info))
|
info))
|
||||||
|
|
||||||
((or ,a ,b)
|
((or ,a ,b)
|
||||||
(let* ((here (number->string (length (if mes? (.text info)
|
(let* ((here (number->string (length (if mes-or-reproducible? (.text info)
|
||||||
(filter (negate comment?) (.text info))))))
|
(filter (negate comment?) (.text info))))))
|
||||||
(skip-b-label (string-append label "_skip_b_" here))
|
(skip-b-label (string-append label "_skip_b_" here))
|
||||||
(b-label (string-append label "_b_" here))
|
(b-label (string-append label "_b_" here))
|
||||||
|
|
|
@ -31,6 +31,8 @@
|
||||||
#:use-module (mes guile)
|
#:use-module (mes guile)
|
||||||
#:export (c99-input->ast))
|
#:export (c99-input->ast))
|
||||||
|
|
||||||
|
(define mes-or-reproducible? #t)
|
||||||
|
|
||||||
(when (getenv "MESC_DEBUG")
|
(when (getenv "MESC_DEBUG")
|
||||||
(format (current-error-port) "*nyacc-version*=~a\n" *nyacc-version*))
|
(format (current-error-port) "*nyacc-version*=~a\n" *nyacc-version*))
|
||||||
|
|
||||||
|
@ -97,7 +99,7 @@
|
||||||
"SYSTEM_LIBC=0"
|
"SYSTEM_LIBC=0"
|
||||||
"__STDC__=1"
|
"__STDC__=1"
|
||||||
"__MESC__=1"
|
"__MESC__=1"
|
||||||
,(if mes? "__MESC_MES__=1" "__MESC_MES__=0")
|
,(if mes-or-reproducible? "__MESC_MES__=1" "__MESC_MES__=0")
|
||||||
,@defines)))
|
,@defines)))
|
||||||
(when (and verbose? (> verbose? 1))
|
(when (and verbose? (> verbose? 1))
|
||||||
(stderr "includes: ~s\n" includes)
|
(stderr "includes: ~s\n" includes)
|
||||||
|
|
Loading…
Reference in a new issue