[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
96/210: gnu: Add binutils-boot0-cheat.
From: |
Jan Nieuwenhuizen |
Subject: |
96/210: gnu: Add binutils-boot0-cheat. |
Date: |
Sat, 8 Sep 2018 10:36:14 -0400 (EDT) |
janneke pushed a commit to branch wip-bootstrap
in repository guix.
commit de4e174dd2a855075536ea7ef7b9f6aa424c0927
Author: Jan Nieuwenhuizen <address@hidden>
Date: Sat Jun 23 13:26:32 2018 +0200
gnu: Add binutils-boot0-cheat.
* gnu/packages/mes.scm (binutils-boot0-cheat): New variable.
(%cheat-binutils?): New variable.
---
gnu/packages/mes.scm | 102 +++++++++++++++++++++++++++++++++++++++++++++++----
1 file changed, 94 insertions(+), 8 deletions(-)
diff --git a/gnu/packages/mes.scm b/gnu/packages/mes.scm
index f1c3c7f..2a78445 100644
--- a/gnu/packages/mes.scm
+++ b/gnu/packages/mes.scm
@@ -44,6 +44,7 @@
#:use-module (guix gexp))
(define %fake-bootstrap? #f) ; cheat using Guile instead of Mes for speed-up?
+(define %cheat-binutils? #t) ; cheat using binutils-boot0 compiled with
current tool-chain
(define %mescc-tools-seed
(let ((commit"29aae8c72e195cbb2f965f05a997b984a4f158fb"))
@@ -633,12 +634,13 @@ standard.")
(system* "./configure"
(string-append "--prefix=" out)))))))))))
-(define-public binutils-boot0
+(define-public binutils-boot0-real
(package
(inherit binutils)
- (name "binutils-boot0")
- (version "2.20.1a")
- (source (origin
+ (name (if %cheat-binutils? "binutils-boot0-real"
+ "binutils-boot0"))
+ (version "2.20.1a")
+ (source (origin
(method url-fetch)
(uri (string-append "mirror://gnu/binutils/binutils-"
version ".tar.bz2"))
@@ -709,9 +711,95 @@ standard.")
"--target=i386-unknown-linux"
(string-append "--prefix=" out))))))))))))
+(define-public binutils-boot0-cheat
+ (let* ((triplet "i686-unknown-linux-gnu")
+ (tool-prefix (string-append triplet "-")))
+ (package
+ (inherit binutils-boot0-real)
+ (name (if %cheat-binutils? "binutils-boot0"
+ "binutils-boot0-cheat"))
+ (supported-systems '("i686-linux"))
+ (native-inputs `(("flex" ,flex) ; cheat
+ ("binutils" ,(cross-binutils triplet))
+ ("gcc" ,(cross-gcc triplet))
+ ("glibc" ,(cross-libc triplet))
+ ("kernel-headers" ,(linux-libre-headers-boot0))))
+ (arguments
+ `(#:tests? #f ; runtest: command not found
+ #:parallel-build? #f
+ #:strip-binaries? #f
+ #:make-flags (list "RANLIB=true")
+ #:phases
+ (modify-phases %standard-phases
+ (replace 'configure
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (glibc (assoc-ref %build-inputs "glibc"))
+ (headers (assoc-ref %build-inputs "kernel-headers"))
+ (cppflags (string-append " --static -static"
+ " -D MES_BOOTSTRAP=1"
+ " -B " glibc "/lib"
+ " -I " glibc "/include"
+ " -I " headers "/include"))
+ (ldflags (string-append " --static -static"
+ " -B " glibc "/lib")))
+ (setenv "C_INCLUDE_PATH"
+ (string-append glibc "/include"
+ ":" headers "/include"))
+ (setenv "LIBRARY_PATH"
+ (string-append glibc "/lib"))
+ (setenv "PATH"
+ (string-append
+ (assoc-ref %build-inputs "flex") "/bin"
+ ":" (assoc-ref %build-inputs "gcc") "/bin"
+ ":" (assoc-ref %build-inputs "binutils") "/"
,triplet "/bin"
+
+ ;; more bootstrap cheats
+ ":" (assoc-ref %build-inputs "bash") "/bin"
+ ":" (assoc-ref %build-inputs "bzip2") "/bin"
+ ":" (assoc-ref %build-inputs "coreutils") "/bin"
+ ":" (assoc-ref %build-inputs "diffutils") "/bin"
+ ;;":" (assoc-ref %build-inputs "file") "/bin"
+ ;;":" (assoc-ref %build-inputs "findutils") "/bin"
+ ":" (assoc-ref %build-inputs "gawk") "/bin"
+
+ ":" (assoc-ref %build-inputs "grep") "/bin"
+ ":" (assoc-ref %build-inputs "gzip") "/bin"
+ ;;":" (assoc-ref %build-inputs "m4") "/bin"
+ ":" (assoc-ref %build-inputs "make") "/bin"
+ ;;":" (assoc-ref %build-inputs "patch") "/bin"
+ ":" (assoc-ref %build-inputs "sed") "/bin"
+ ":" (assoc-ref %build-inputs "tar") "/bin"))
+
+ (setenv "CONFIG_SHELL" (string-append
+ (assoc-ref %build-inputs "bash")
+ "/bin/sh"))
+ (setenv "CPPFLAGS" cppflags)
+ (setenv "AR" "ar")
+ (setenv "RANLIB" "true")
+ (setenv "CC" (string-append ,tool-prefix "gcc" cppflags
ldflags))
+ (setenv "LD" (string-append ,tool-prefix "gcc" ldflags))
+ (setenv "CPP" (string-append ,tool-prefix "gcc -E" " "
cppflags))
+ (setenv "CC_FOR_BUILD" (string-append ,tool-prefix "gcc"
cppflags ldflags))
+
+ (format (current-error-port) "PATH=~a\n" (getenv "PATH"))
+ (format (current-error-port) "CC=~a\n" (getenv "CC"))
+
+ (and (zero? (system* "./configure"
+ "--disable-nls"
+ "--disable-shared"
+ "--disable-werror"
+ "--host=i386-unknown-linux"
+ "--target=i386-unknown-linux"
+ (string-append "--prefix="
out)))))))))))))
+
+(define-public binutils-boot0
+ (if %cheat-binutils? binutils-boot0-cheat
+ binutils-boot0-real))
+
(define-public binutils-boot
(package
- (inherit binutils-boot0)
+ (inherit binutils-boot0-real)
(name "binutils-boot")
(native-inputs `(("flex" ,flex) ; cheat
("glibc" ,glibc-boot)
@@ -948,9 +1036,7 @@ ac_cv_c_float_format='IEEE (little-endian)'
(inherit gcc-core-boot)
(name "gcc-boot")
(supported-systems '("i686-linux"))
- (native-inputs `(;;("binutils" ,binutils-boot)
- ,(let ((triplet "i686-unknown-linux-gnu")) ;; MORTAL SIN
HERE
- `("binutils" ,(cross-binutils triplet)))
+ (native-inputs `(("binutils" ,binutils-boot0)
("gcc" ,gcc-core-boot)
("glibc" ,glibc-boot)))
(outputs '("out"))
- 110/210: Revert "REMOVEME: %fake-bootstrap => #t.", (continued)
- 110/210: Revert "REMOVEME: %fake-bootstrap => #t.", Jan Nieuwenhuizen, 2018/09/08
- 109/210: REMOVEME: %fake-bootstrap => #t., Jan Nieuwenhuizen, 2018/09/08
- 103/210: gnu: glibc-mesboot: Rename from glibc-boot., Jan Nieuwenhuizen, 2018/09/08
- 102/210: gnu: gcc-core-mesboot: Rename from gcc-core-boot., Jan Nieuwenhuizen, 2018/09/08
- 97/210: gnu: gcc-boot: build with %cheat-binutils?, Jan Nieuwenhuizen, 2018/09/08
- 64/210: gnu: binutils-boot: Update to 2.14., Jan Nieuwenhuizen, 2018/09/08
- 95/210: gnu: binutils-boot: Update to 2.20.1a., Jan Nieuwenhuizen, 2018/09/08
- 98/210: gnu: binutils-boot0: Inject AR, LD from bootstrap-binaries., Jan Nieuwenhuizen, 2018/09/08
- 151/210: gnu: Add diffutils-mesboot 2.7., Jan Nieuwenhuizen, 2018/09/08
- 128/210: gnu: gcc-mesboot: Revise dependencies., Jan Nieuwenhuizen, 2018/09/08
- 96/210: gnu: Add binutils-boot0-cheat.,
Jan Nieuwenhuizen <=
- 76/210: Revert "gnu: gcc-boot: Update to 3.2.", Jan Nieuwenhuizen, 2018/09/08
- 148/210: gnu: mes-boot: Update to 0.17.1., Jan Nieuwenhuizen, 2018/09/08
- 126/210: gnu: gcc-mesboot0: Revise dependencies., Jan Nieuwenhuizen, 2018/09/08
- 124/210: gnu: gcc-core-mesboot: Revise dependencies., Jan Nieuwenhuizen, 2018/09/08
- 65/210: gnu: binutils-boot: Update to 2.25., Jan Nieuwenhuizen, 2018/09/08
- 99/210: gnu: Remove binutils-boot0-cheat., Jan Nieuwenhuizen, 2018/09/08
- 93/210: gnu: Add tcc-boot 0.9.27., Jan Nieuwenhuizen, 2018/09/08
- 94/210: gnu: tcc-boot0: Update for mes 0.16., Jan Nieuwenhuizen, 2018/09/08
- 88/210: gnu: mes-boot: Update to 0.16., Jan Nieuwenhuizen, 2018/09/08
- 82/210: Revert "REMOVEME: %fake-bootstrap => #t.", Jan Nieuwenhuizen, 2018/09/08