[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
21/35: bootstrap: tcc-boot0: Scheme-only bootstrap. WIP
From: |
guix-commits |
Subject: |
21/35: bootstrap: tcc-boot0: Scheme-only bootstrap. WIP |
Date: |
Wed, 20 Nov 2019 15:16:10 -0500 (EST) |
janneke pushed a commit to branch wip-boot
in repository guix.
commit 300a0a3383e99bce9afc71335099f3b4320512b6
Author: Jan Nieuwenhuizen <address@hidden>
Date: Tue Dec 4 23:19:56 2018 +0100
bootstrap: tcc-boot0: Scheme-only bootstrap. WIP
---
gnu/packages/commencement.scm | 113 +++++++++++++++++++++++-------------------
1 file changed, 63 insertions(+), 50 deletions(-)
diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index 0f81808..1fdc848 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -197,100 +197,113 @@
;; ported to 0.9.27, alas the resulting tcc is buggy. Once MesCC is more
;; mature, this package should use the 0.9.27 sources (or later).
(let ((version "0.9.26")
- (revision "6")
- (commit "c004e9a34fb026bb44d211ab98bb768e79900eef"))
+ (revision "9")
+ (commit "17df781f70c7012ab5df74a2f0396f9bcf43e75a"))
(package-with-bootstrap-guile
(package
(inherit tcc)
(name "tcc-boot0")
(version (string-append version "-" revision "." (string-take commit
7)))
+ ;; (source (origin
+ ;; (method url-fetch)
+ ;; (uri (string-append "https://gitlab.com/janneke/tinycc"
+ ;; "/-/archive/" commit
+ ;; "/tinycc-" commit ".tar.gz"))
+ ;; (sha256
+ ;; (base32
+ ;;
"1jm9vxqa8jj3qjmycraxg99pzsd26781rzc8zr3y1dksfqdl0jaq"))))
(source (origin
(method url-fetch)
- (uri (string-append "https://gitlab.com/janneke/tinycc"
- "/-/archive/" commit
- "/tinycc-" commit ".tar.gz"))
+ (uri (string-append
+ "http://lilypond.org/janneke/mes/"
+ "tinycc-" commit ".tar"))
(sha256
(base32
- "1hmzn1pq0x22ppd80hyrn5qzqq94mxd0ychzj6vrr2vnj2frjv5b"))))
+ "0z2rnm8mg7ja6h4hk838gb5ib03k1rxj86c8ibjdca5mp5nh71rs"))))
(build-system gnu-build-system)
(supported-systems '("i686-linux" "x86_64-linux"))
(inputs '())
(propagated-inputs '())
(native-inputs
- `(("mes" ,mes-boot)
+ `(("bash" , %bootstrap-gash)
+ ("guile" ,%bootstrap-guile)
+ ("mes" ,mes-boot)
("mescc-tools" ,%bootstrap-mescc-tools)
- ("nyacc-source" ,(package-source nyacc-0.86))
-
- ("coreutils" , %bootstrap-coreutils&co)
- ("bootstrap-mes" ,%bootstrap-mes)))
+ ("nyacc-source" ,(package-source nyacc-boot))))
(arguments
`(#:implicit-inputs? #f
#:guile ,%bootstrap-guile
- #:strip-binaries? #f ; binutil's strip b0rkes MesCC/M1/hex2 binaries
+ #:validate-runpath? #f ; no dynamic executables
+ #:strip-binaries? #f ; no strip yet
#:phases
(modify-phases %standard-phases
(add-after 'unpack 'unpack-seeds
(lambda* (#:key outputs #:allow-other-keys)
- (let* ((coreutils (assoc-ref %build-inputs "coreutils"))
- (nyacc-source (assoc-ref %build-inputs "nyacc-source"))
- (bootstrap-mes (assoc-ref %build-inputs
"bootstrap-mes")))
- (setenv "PATH" (string-append
- coreutils "/bin"))
- (format (current-error-port) "PATH=~s\n" (getenv "PATH"))
+ (let ((nyacc-source (assoc-ref %build-inputs "nyacc-source")))
(with-directory-excursion ".."
- (mkdir-p "nyacc-source")
- (invoke "tar" "--strip=1" "-C" "nyacc-source"
- "-xvf" nyacc-source)
- (symlink (string-append bootstrap-mes "/share/mes/lib")
"mes-seed"))
- #t)))
+ (invoke "tar" "-xvf" nyacc-source)))))
(replace 'configure
(lambda* (#:key outputs #:allow-other-keys)
(let* ((out (assoc-ref %outputs "out"))
(dir (with-directory-excursion ".." (getcwd)))
- (coreutils (assoc-ref %build-inputs "coreutils"))
+ (gash (assoc-ref %build-inputs "bash"))
(mes (assoc-ref %build-inputs "mes"))
(mescc-tools (assoc-ref %build-inputs "mescc-tools"))
- (libc (assoc-ref %build-inputs "libc"))
- (interpreter (if libc
- ;; also for x86_64-linux, we are still
on i686-linux
- (string-append libc
,(glibc-dynamic-linker "i686-linux"))
- (string-append mes
"/lib/mes-loader"))))
+ (interpreter (string-append mes "/lib/mes-loader")))
(setenv "PATH" (string-append
- coreutils "/bin"
+ gash "/bin"
":" mes "/bin"
":" mescc-tools "/bin"))
(format (current-error-port) "PATH=~s\n" (getenv "PATH"))
- (setenv "PREFIX" out)
- (symlink (string-append mes "/share/mes") "mes")
- (symlink (string-append "../nyacc-source/module") "nyacc")
- (setenv "MES_PREFIX" "mes")
- (setenv "MES_ARENA" "100000000")
- (setenv "MES_MAX_ARENA" "100000000")
- (setenv "MES_STACK" "10000000")
- (setenv "MES" "mes")
- (setenv "GUILE_LOAD_PATH" "nyacc")
- (invoke "sh" "configure"
- "--prefix=$PREFIX"
- (string-append "--elfinterp=" interpreter)
- "--crtprefix=."
- "--tccdir=."))))
+ (setenv "prefix" out)
+ (setenv "MES_PREFIX" mes)
+ (setenv "GUILE_LOAD_PATH"
+ (string-append dir "/nyacc-0.99.0/module"))
+
+ (substitute* "conftest.c"
+ (("volatile") ""))
+
+ (if #f ;; needs Gash support for ${ #} ${ %}
+ (invoke "sh" "configure"
+ "--cc=mescc"
+ (string-append "--prefix=" out)
+ (string-append "--elfinterp=" interpreter)
+ "--crtprefix=."
+ "--tccdir=.")
+ (with-output-to-file "config.h"
+ (lambda _
+ (display (string-append "
+#ifndef CONFIG_TCCDIR
+#define CONFIG_TCCDIR \"" out "/lib/tcc\"
+#endif
+#define GCC_MAJOR 0
+#define GCC_MINOR 0
+#define TCC_VERSION \"0.9.26\"
+"))))))))
(replace 'build
(lambda _
- (substitute* "bootstrap.sh"
- (("^ cmp") "# cmp"))
+ (substitute* "bootstrap.sh" ; Show some progress
+ (("^(
*)((cp|ls|mkdir|rm|[.]/tcc|[.]/[$][{PROGRAM_PREFIX[}]tcc) [^\"]*[^\\])\n" all
space cmd)
+ (string-append space "echo \"" cmd "\"\n"
+ space cmd "\n")))
(invoke "sh" "bootstrap.sh")))
(replace 'check
(lambda _
- (setenv "DIFF" "diff.scm")
- (setenv "OBJDUMP" "true")
;; fail fast tests
+ (system* "./tcc" "--help") ; --help exits 1
;; (invoke "sh" "test.sh" "mes/scaffold/tests/30-strlen")
;; (invoke "sh" "-x" "test.sh"
"mes/scaffold/tinycc/00_assignment")
- (setenv "TCC" "./tcc")
- (invoke "sh" "check.sh")))
+ ;; TODO: add sensible check target (without depending on make)
+ ;; (invoke "sh" "check.sh")
+ #t))
(replace 'install
(lambda _
+ (substitute* "install.sh" ; Show some progress
+ (("^( *)((cp|ls|mkdir|rm|tar|./[$][{PROGRAM_PREFIX[}]tcc)
[^\"]*[^\\])\n" all space cmd)
+ (string-append space "echo \"" cmd "\"\n"
+ space cmd "\n")))
+
(invoke "sh" "install.sh"))))))
(native-search-paths
;; Use the language-specific variables rather than 'CPATH' because they
- branch wip-boot created (now e560af2), guix-commits, 2019/11/20
- 02/35: gnu: Add gash-core-utils., guix-commits, 2019/11/20
- 15/35: bootstrap: bootstrap-mes: Update for mes-0.20., guix-commits, 2019/11/20
- 06/35: bootstrap: Add %bootstrap-gash. WIP, guix-commits, 2019/11/20
- 08/35: gnu: mescc-tools: Update to 0.6.1., guix-commits, 2019/11/20
- 03/35: bootstrap: Add gash-boot., guix-commits, 2019/11/20
- 04/35: bootstrap: Add gash-core-utils-boot., guix-commits, 2019/11/20
- 07/35: gnu: nyacc: Update to 0.99.0., guix-commits, 2019/11/20
- 21/35: bootstrap: tcc-boot0: Scheme-only bootstrap. WIP,
guix-commits <=
- 13/35: bootstrap: mes-minimal: Update for mes-0.20., guix-commits, 2019/11/20
- 14/35: bootstrap: bootstrap-mescc-tools: Update for mescc-tools-0.6.1., guix-commits, 2019/11/20
- 30/35: bootstrap: Add sed-mesboot0., guix-commits, 2019/11/20
- 09/35: gnu: mes: Update to 0.20., guix-commits, 2019/11/20
- 11/35: mes: 0.21, guix-commits, 2019/11/20
- 05/35: bootstrap: Add %gash-bootstrap-guile, %gash-bootstrap-tarball., guix-commits, 2019/11/20
- 01/35: gnu: Add ncompress., guix-commits, 2019/11/20
- 10/35: gnu: mes: Update to 0.21 WIP, guix-commits, 2019/11/20
- 22/35: bootstrap-gash-rewire? WIP, guix-commits, 2019/11/20
- 23/35: bootstrap: Add gzip-mesboot0., guix-commits, 2019/11/20