guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

32/35: bootstrap: gcc-core-mesboot0: Scheme-only bootstrap.


From: guix-commits
Subject: 32/35: bootstrap: gcc-core-mesboot0: Scheme-only bootstrap.
Date: Wed, 20 Nov 2019 15:16:19 -0500 (EST)

janneke pushed a commit to branch wip-boot
in repository guix.

commit 0f72f9073cdc5b72e997b5654306e763ee702a11
Author: Jan Nieuwenhuizen <address@hidden>
Date:   Sun Oct 6 19:29:01 2019 +0200

    bootstrap: gcc-core-mesboot0: Scheme-only bootstrap.
    
    * gnu/packages/commencement.scm (gcc-core-mesboot0): Rename from
    gcc-core-mesboot; Update for scheme-only bootstrap.
---
 gnu/packages/commencement.scm | 106 ++++++++++++++++++++++++------------------
 1 file changed, 60 insertions(+), 46 deletions(-)

diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index 4599371..0d7bb10 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -981,36 +981,41 @@
                 (("[.]//dev/null") "/dev/null"))
               (invoke "sh" "./config.status")))))))))
 
-(define gcc-core-mesboot
+(define gcc-core-mesboot0
   ;; Gcc-2.95.3 is the most recent GCC that is supported by what the Mes C
   ;; Library v0.16 offers.  Gcc-3.x (and 4.x) place higher demands on a C
   ;; library, such as dir.h/struct DIR/readdir, locales, signals...  Also,
-  ;; with gcc-2.95.3, binutils-boot-2.20.1a and glibc-2.2.5 we found a GNU
-  ;; toolchain triplet "that works".
+  ;; with gcc-2.95.3, binutils (2.14.0, 2.20.1a) and glibc-2.2.5 we found a
+  ;; GNU toolchain triplet "that works".
   (package-with-bootstrap-guile
    (package
      (inherit gcc)
-     (name "gcc-core-mesboot")
+     (name "gcc-core-mesboot0")
      (version "2.95.3")
      (source (origin
                (method url-fetch)
                (uri (string-append "mirror://gnu/gcc/gcc-2.95.3/gcc-core-"
                                    version
                                    ".tar.gz"))
-               (patches (search-patches "gcc-boot-2.95.3.patch"))
+               ;; `patches' needs XZ
+               ;; (patches (search-patches "gcc-boot-2.95.3.patch"))
                (sha256
                 (base32
                  "1xvfy4pqhrd5v2cv8lzf63iqg92k09g6z9n2ah6ndd4h17k1x0an"))))
      (supported-systems '("i686-linux" "x86_64-linux"))
      (inputs '())
      (propagated-inputs '())
-     (native-inputs `(("binutils" ,binutils-mesboot0)
+     (native-inputs `(("boot-patch" ,(search-patch "gcc-boot-2.95.3.patch"))
+                      ("binutils" ,binutils-mesboot0)
+                      ("bash" ,bash-mesboot0)
+                      ("gzip" ,gzip-mesboot0)
+                      ("make" ,make-mesboot0)
+                      ("patch" ,patch-mesboot0)
+                      ("sed" ,sed-mesboot0)
                       ("tcc" ,tcc-boot)
 
-                      ("bash" ,%bootstrap-coreutils&co)
-                      ("coreutils" ,%bootstrap-coreutils&co)
-                      ("diffutils" ,diffutils-mesboot)
-                      ("make" ,make-mesboot0)))
+                      ("gash" ,%bootstrap-gash)
+                      ("guile" ,%bootstrap-guile)))
      (outputs '("out"))
      (arguments
       `(#:implicit-inputs? #f
@@ -1026,32 +1031,37 @@
             "--build=i686-unknown-linux-gnu"
             "--host=i686-unknown-linux-gnu"
             ,(string-append "--prefix=" out)))
-        #:make-flags (list
-                      "CC=tcc -static -D __GLIBC_MINOR__=6"
-                      "OLDCC=tcc -static -D __GLIBC_MINOR__=6"
-                      "CC_FOR_BUILD=tcc -static -D __GLIBC_MINOR__=6"
-                      "AR=ar"
-                      "RANLIB=ranlib"
-                      (string-append "LIBGCC2_INCLUDES=-I "
-                                     (assoc-ref %build-inputs "tcc")
-                                     "/include")
-                      "LANGUAGES=c"
-                      (string-append "BOOT_LDFLAGS="
-                                     " -B" (assoc-ref %build-inputs "tcc")
-                                     "/lib/"))
+        #:make-flags
+        `("CC=tcc -static -D __GLIBC_MINOR__=6"
+          "OLDCC=tcc -static -D __GLIBC_MINOR__=6"
+          "CC_FOR_BUILD=tcc -static -D __GLIBC_MINOR__=6"
+          "AR=ar"
+          "RANLIB=ranlib"
+          ,(string-append "LIBGCC2_INCLUDES=-I "
+                          (assoc-ref %build-inputs "tcc")
+                          "/include")
+          "LANGUAGES=c"
+          ,(string-append "BOOT_LDFLAGS="
+                          " -B" (assoc-ref %build-inputs "tcc")
+                          "/lib/"))
         #:modules ((guix build gnu-build-system)
                    (guix build utils)
                    (srfi srfi-1))
         #:phases
         (modify-phases %standard-phases
-          ;; gcc-2.95.3 needs more traditional configure
+          (add-after 'unpack 'apply-boot-patch
+            (lambda* (#:key inputs #:allow-other-keys)
+              (let ((patch-file (assoc-ref inputs "boot-patch")))
+                (system* "patch" "--force" "-p1" "-i" patch-file)
+                #t)))
           (add-before 'configure 'setenv
             (lambda* (#:key outputs #:allow-other-keys)
-              (let ((out (assoc-ref outputs "out"))
-                    (bash (assoc-ref %build-inputs "bash"))
-                    (tcc (assoc-ref %build-inputs "tcc"))
-                    (cppflags " -D __GLIBC_MINOR__=6"))
-                (setenv "CONFIG_SHELL" (string-append bash "/bin/sh"))
+              (let* ((out (assoc-ref outputs "out"))
+                     (bash (assoc-ref %build-inputs "bash"))
+                     (shell (string-append bash "/bin/bash"))
+                     (tcc (assoc-ref %build-inputs "tcc"))
+                     (cppflags " -D __GLIBC_MINOR__=6"))
+                (setenv "CONFIG_SHELL" shell)
                 (setenv "CPPFLAGS" cppflags)
                 (setenv "CC" (string-append "tcc" cppflags))
                 (setenv "CC_FOR_BUILD" (string-append "tcc" cppflags))
@@ -1060,9 +1070,9 @@
                   (lambda _
                     (display "
 ac_cv_c_float_format='IEEE (little-endian)'
-")))
-                #t)))
-          (replace 'configure
+"))))))
+          ;; gcc-2.95.3 
+          (replace 'configure ; needs classic invocation of configure
             (lambda* (#:key configure-flags  #:allow-other-keys)
               (format (current-error-port)
                       "running ./configure ~a\n" (string-join configure-flags))
@@ -1079,19 +1089,23 @@ ac_cv_c_float_format='IEEE (little-endian)'
                      (out (assoc-ref outputs "out"))
                      (gcc-dir (string-append
                                out 
"/lib/gcc-lib/i686-unknown-linux-gnu/2.95.3")))
-                (mkdir-p "tmp")
                 (zero? (system (string-append "set -x; cd tmp && ar x 
../gcc/libgcc2.a")))
                 (zero? (system (string-append "set -x; cd tmp && ar r " 
gcc-dir "/libgcc.a *.o")))
                 (copy-file "gcc/libgcc2.a" (string-append out 
"/lib/libgcc2.a"))
                 (copy-file (string-append tcc "/lib/libtcc1.a")
-                           (string-append out "/lib/libtcc1.a"))
-                (invoke "ar" "r" (string-append gcc-dir "/libc.a")
-                        (string-append tcc-lib "/libc+gnu.o")
-                        (string-append tcc-lib "/libtcc1.o"))
-                (invoke "ar" "r" (string-append out "/lib/libc.a")
-                        (string-append tcc-lib "/libc+gnu.o")
-                        (string-append tcc-lib "/libtcc1.o"))
-                (invoke "ls" "-ltrF" gcc-dir)
+                              (string-append out "/lib/libtcc1.a"))
+                ;; (invoke "ar" "r" (string-append gcc-dir "/libc.a")
+                ;;         (string-append tcc-lib "/libc+gnu.o")
+                ;;         (string-append tcc-lib "/libtcc1.o"))
+                ;; (invoke "ar" "r" (string-append out "/lib/libc.a")
+                ;;         (string-append tcc-lib "/libc+gnu.o")
+                ;;         (string-append tcc-lib "/libtcc1.o"))
+                (copy-file (string-append tcc "/lib/libc.a")
+                           (string-append out "/lib/libc.a"))
+                ;; (mkdir-p gcc-dir)
+                ;; (copy-file (string-append tcc "/lib/libc.a")
+                ;;            (string-append gcc-dir "/libc.a"))
+                ;; (invoke "ls" "-ltrF" gcc-dir)
                 (copy-recursively (string-append tcc "/include")
                                   (string-append out "/include"))
                 #t))))))
@@ -1168,7 +1182,7 @@ ac_cv_c_float_format='IEEE (little-endian)'
      (inputs '())
      (propagated-inputs '())
      (native-inputs `(("binutils" ,binutils-mesboot0)
-                      ("gcc" ,gcc-core-mesboot)
+                      ("gcc" ,gcc-core-mesboot0)
 
                       ("bash" ,%bootstrap-coreutils&co)
                       ("coreutils" ,%bootstrap-coreutils&co)
@@ -1246,10 +1260,10 @@ ac_cv_c_float_format='IEEE (little-endian)'
 (define gcc-mesboot0
   (package-with-bootstrap-guile
    (package
-     (inherit gcc-core-mesboot)
+     (inherit gcc-core-mesboot0)
      (name "gcc-mesboot0")
      (native-inputs `(("binutils" ,binutils-mesboot0)
-                      ("gcc" ,gcc-core-mesboot)
+                      ("gcc" ,gcc-core-mesboot0)
                       ("libc" ,glibc-mesboot0)
 
                       ("bash" ,%bootstrap-coreutils&co)
@@ -1258,7 +1272,7 @@ ac_cv_c_float_format='IEEE (little-endian)'
                       ("kernel-headers" ,%bootstrap-linux-libre-headers)
                       ("make" ,make-mesboot0)))
      (arguments
-      (substitute-keyword-arguments (package-arguments gcc-core-mesboot)
+      (substitute-keyword-arguments (package-arguments gcc-core-mesboot0)
         ((#:phases phases)
          `(modify-phases ,phases
             (replace 'setenv
@@ -1424,7 +1438,7 @@ ac_cv_c_float_format='IEEE (little-endian)'
                       ("kernel-headers" ,%bootstrap-linux-libre-headers)
                       ("make" ,make-mesboot)))
      (arguments
-      (substitute-keyword-arguments (package-arguments gcc-core-mesboot)
+      (substitute-keyword-arguments (package-arguments gcc-core-mesboot0)
         ((#:make-flags make-flags)
          `(let* ((libc (assoc-ref %build-inputs "libc"))
                  (ldflags (string-append



reply via email to

[Prev in Thread] Current Thread [Next in Thread]