janneke pushed a commit to branch wip-bootstrap in repository guix. commit e06242fdacf6e88d2f3428546e176cd0d7c00f82 Author: Jan Nieuwenhuizen <jann...@gnu.org> Date: Sun Jun 10 20:10:58 2018 +0200
gnu: Add gcc-core-boot 2.95.3. * gnu/packages/mes.scm (gcc-core-boot0): Rename from gcc-boot. * gnu/packages/mes.scm (gcc-core-boot): New variable. --- gnu/packages/mes.scm | 71 +++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 68 insertions(+), 3 deletions(-) diff --git a/gnu/packages/mes.scm b/gnu/packages/mes.scm index 832a9ca..848d049 100644 --- a/gnu/packages/mes.scm +++ b/gnu/packages/mes.scm @@ -586,10 +586,10 @@ standard.") "--target=i386-unknown-linux" (string-append "--prefix=" out)))))))))))) -(define-public gcc-boot +(define-public gcc-core-boot (package (inherit gcc) - (name "gcc-boot") + (name "gcc-core-boot") (version "2.95.3") (source (origin (method url-fetch) @@ -689,7 +689,7 @@ ac_cv_c_float_format='IEEE (little-endian)' "1vl48i16gx6h68whjyhgnn1s57vqq32f9ygfa2fls7pdkbsqvp2q")))) (supported-systems '("i686-linux")) (native-inputs `(("binutils" ,binutils-boot) - ("gcc" ,gcc-boot))) + ("gcc" ,gcc-core-boot))) (propagated-inputs `(("kernel-headers" ,(linux-libre-headers-boot0)))) (outputs '("out")) (arguments @@ -743,6 +743,71 @@ ac_cv_c_float_format='IEEE (little-endian)' (zero? (apply system* "make" "install-lib-all" "install-headers" make-flags))))))))) +(define-public gcc-boot + (package + (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))) + ("gcc" ,gcc-core-boot) + ("glibc" ,glibc-boot))) + (outputs '("out")) + (arguments + `(#:tests? #f ; runtest: command not found + #:parallel-build? #f + #:strip-binaries? #f + #:make-flags (list "RANLIB=true" + (string-append "LIBGCC2_INCLUDES=-I " + (assoc-ref %build-inputs "gcc") + "/include") + "LANGUAGES=c") + #:modules ((guix build gnu-build-system) + (guix build utils) + (srfi srfi-1)) + #:phases + (modify-phases %standard-phases + (replace 'configure + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out")) + (binutils (assoc-ref %build-inputs "binutils")) + (cppflags (string-append + " -D __STDC__=1" + " -D __GLIBC_MINOR__=6" + ))) + (when #t ;; no info + (delete-file-recursively "texinfo") + (system "touch gcc/cpp.info gcc/gcc.info")) + + ;; MORTAL SIN: use pre-built binary seed + (setenv "PATH" (string-append + binutils "/i686-unknown-linux-gnu/bin" + ":" (getenv "PATH"))) + + (setenv "CONFIG_SHELL" (string-append + (assoc-ref %build-inputs "bash") + "/bin/sh")) + (unsetenv "C_INCLUDE_PATH") ; flex + (unsetenv "LIBRARY_PATH") + (setenv "CPPFLAGS" cppflags) + (setenv "CC" (string-append "gcc" cppflags)) + (setenv "CPP" (string-append "gcc -E" cppflags)) + (setenv "RANLIB" "true") + (with-output-to-file "config.cache" + (lambda _ + (display " +ac_cv_c_float_format='IEEE (little-endian)' +"))) + (and + (zero? + (system* "./configure" + ;;"--disable-shared" + ;;"--enable-static" + "--host=i386-unknown-linux" + "--target=i386-unknown-linux" + (string-append "--prefix=" out)))))))))))) + ;;; (define-public nyacc