summary refs log tree commit diff
path: root/gnu/packages/make-bootstrap.scm
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/make-bootstrap.scm')
-rw-r--r--gnu/packages/make-bootstrap.scm206
1 files changed, 94 insertions, 112 deletions
diff --git a/gnu/packages/make-bootstrap.scm b/gnu/packages/make-bootstrap.scm
index b8d1b2af3e..5716ed3886 100644
--- a/gnu/packages/make-bootstrap.scm
+++ b/gnu/packages/make-bootstrap.scm
@@ -1,10 +1,11 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2018, 2019 Mark H Weaver <mhw@netris.org>
 ;;; Copyright © 2018, 2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
-;;; Copyright © 2019 Marius Bakke <mbakke@fastmail.com>
+;;; Copyright © 2019, 2020 Marius Bakke <mbakke@fastmail.com>
+;;; Copyright © 2020 Mathieu Othacehe <m.othacehe@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -92,34 +93,13 @@ for `sh' in $PATH, and without nscd, and with static NSS modules."
   (mlambdaq (glibc)
     "Return a variant of GCC that uses the bootstrap variant of GLIBC."
     (package
-      (inherit gcc)
+      (inherit gcc-5)
       (outputs '("out")) ;all in one so libgcc_s is easily found
-      (native-search-paths
-       ;; Set CPLUS_INCLUDE_PATH so GCC is able to find the libc
-       ;; C++ headers.
-       (cons (search-path-specification
-              (variable "CPLUS_INCLUDE_PATH")
-              (files '("include")))
-             (package-native-search-paths gcc)))
       (inputs
        `( ;; Distinguish the name so we can refer to it below.
          ("bootstrap-libc" ,(glibc-for-bootstrap glibc))
          ("libc:static" ,(glibc-for-bootstrap glibc) "static")
-         ,@(package-inputs gcc)))
-      (arguments
-       (substitute-keyword-arguments (package-arguments gcc)
-         ((#:phases phases)
-          `(modify-phases ,phases
-             (add-before 'configure 'treat-glibc-as-system-header
-               (lambda* (#:key inputs #:allow-other-keys)
-                 (let ((libc (assoc-ref inputs "bootstrap-libc")))
-                   ;; GCCs build processes requires that the libc
-                   ;; we're building against is on the system header
-                   ;; search path.
-                   (for-each (lambda (var)
-                               (setenv var (string-append libc "/include")))
-                             '("C_INCLUDE_PATH" "CPLUS_INCLUDE_PATH"))
-                   #t))))))))))
+         ,@(package-inputs gcc-5))))))
 
 (define (package-with-relocatable-glibc p)
   "Return a variant of P that uses the libc as defined by
@@ -137,7 +117,10 @@ for `sh' in $PATH, and without nscd, and with static NSS modules."
   (define (inputs)
     (if (%current-target-system)                ; is this package cross built?
         `(("cross-libc"
-           ,(cross-bootstrap-libc (%current-target-system))))
+           ,(cross-bootstrap-libc (%current-target-system)))
+          ("cross-libc:static"
+           ,(cross-bootstrap-libc (%current-target-system))
+           "static"))
         '()))
 
   (define (native-inputs)
@@ -155,7 +138,7 @@ for `sh' in $PATH, and without nscd, and with static NSS modules."
                              (cons (search-path-specification
                                     (variable "CROSS_CPLUS_INCLUDE_PATH")
                                     (files '("include")))
-                                   (package-search-paths gcc)))))
+                                   (package-search-paths gcc-5)))))
             ("cross-binutils" ,(cross-binutils target))
             ,@(%final-inputs)))
         `(("libc" ,(glibc-for-bootstrap glibc))
@@ -167,15 +150,6 @@ for `sh' in $PATH, and without nscd, and with static NSS modules."
                                 (current-source-location)
                                 #:native-inputs native-inputs))
 
-(define static-bash-for-bootstrap
-  (package
-    (inherit static-bash)
-    (source (origin
-              (inherit (package-source static-bash))
-              (patches
-               (cons (search-patch "bash-reproducible-linux-pgrp-pipe.patch")
-                     (origin-patches (package-source static-bash))))))))
-
 (define %static-inputs
   ;; Packages that are to be used as %BOOTSTRAP-INPUTS.
   (let ((coreutils (package (inherit coreutils)
@@ -252,7 +226,7 @@ for `sh' in $PATH, and without nscd, and with static NSS modules."
                                  (("-Wl,-export-dynamic") ""))
                                #t)))))))
                 (inputs (if (%current-target-system)
-                            `(("bash" ,static-bash-for-bootstrap))
+                            `(("bash" ,static-bash))
                             '()))))
 	(tar (package (inherit tar)
 	       (arguments
@@ -298,7 +272,7 @@ for `sh' in $PATH, and without nscd, and with static NSS modules."
                ("sed" ,sed)
                ("grep" ,grep)
                ("gawk" ,gawk)))
-      ("bash" ,static-bash-for-bootstrap))))
+      ("bash" ,static-bash))))
 
 (define %static-binaries
   (package
@@ -400,6 +374,10 @@ for `sh' in $PATH, and without nscd, and with static NSS modules."
                                              (package-arguments binutils))
                                   ((#:configure-flags flags _ ...)
                                    flags)))
+       #:make-flags ,(match (memq #:make-flags (package-arguments binutils))
+                       ((#:make-flags flags _ ...)
+                        flags)
+                       (_ ''()))
        #:strip-flags '("--strip-all")
        #:phases (modify-phases %standard-phases
                   (add-before 'configure 'all-static
@@ -427,7 +405,8 @@ for `sh' in $PATH, and without nscd, and with static NSS modules."
        (begin
          (use-modules (guix build utils))
 
-         (setvbuf (current-output-port) _IOLBF)
+         (setvbuf (current-output-port)
+                  (cond-expand (guile-2.0 _IOLBF) (else 'line)))
          (let* ((in  (assoc-ref %build-inputs "binutils"))
                 (out (assoc-ref %outputs "out"))
                 (bin (string-append out "/bin")))
@@ -481,61 +460,62 @@ for `sh' in $PATH, and without nscd, and with static NSS modules."
 (define %gcc-static
   ;; A statically-linked GCC, with stripped-down functionality.
   (package-with-relocatable-glibc
-   (package (inherit gcc)
+   (package (inherit gcc-5)
      (name "gcc-static")
      (outputs '("out"))                           ; all in one
      (arguments
-      `(#:modules ((guix build utils)
-                   (guix build gnu-build-system)
-                   (srfi srfi-1)
-                   (srfi srfi-26)
-                   (ice-9 regex))
-        ,@(substitute-keyword-arguments (package-arguments gcc)
-            ((#:guile _) #f)
-            ((#:implicit-inputs? _) #t)
-            ((#:configure-flags flags)
-             `(append (list
-                       ;; We don't need a full bootstrap here.
-                       "--disable-bootstrap"
-
-                       ;; Make sure '-static' is passed where it matters.
-                       "--with-stage1-ldflags=-static"
-
-                       ;; GCC 4.8+ requires a C++ compiler and library.
-                       "--enable-languages=c,c++"
-
-                       ;; Make sure gcc-nm doesn't require liblto_plugin.so.
-                       "--disable-lto"
-
-                       "--disable-shared"
-                       "--disable-plugin"
-                       "--disable-libmudflap"
-                       "--disable-libatomic"
-                       "--disable-libsanitizer"
-                       "--disable-libitm"
-                       "--disable-libgomp"
-                       "--disable-libcilkrts"
-                       "--disable-libvtv"
-                       "--disable-libssp"
-                       "--disable-libquadmath")
-                      (remove (cut string-match "--(.*plugin|enable-languages)" <>)
-                              ,flags)))
-            ((#:phases phases)
-             `(modify-phases ,phases
-                (add-after 'pre-configure 'remove-lgcc_s
-                  (lambda _
-                    ;; Remove the '-lgcc_s' added to GNU_USER_TARGET_LIB_SPEC in
-                    ;; the 'pre-configure phase of our main gcc package, because
-                    ;; that shared library is not present in this static gcc.  See
-                    ;; <https://lists.gnu.org/archive/html/guix-devel/2015-01/msg00008.html>.
-                    (substitute* (cons "gcc/config/rs6000/sysv4.h"
-                                       (find-files "gcc/config"
-                                                   "^gnu-user.*\\.h$"))
-                      ((" -lgcc_s}}") "}}"))
-                    #t)))))))
+      (substitute-keyword-arguments (package-arguments gcc-5)
+        ((#:modules modules %gnu-build-system-modules)
+         `((srfi srfi-1)
+           (srfi srfi-26)
+           (ice-9 regex)
+           ,@modules))
+        ((#:guile _) #f)
+        ((#:implicit-inputs? _) #t)
+        ((#:configure-flags flags)
+         `(append (list
+                   ;; We don't need a full bootstrap here.
+                   "--disable-bootstrap"
+
+                   ;; Make sure '-static' is passed where it matters.
+                   "--with-stage1-ldflags=-static"
+
+                   ;; GCC 4.8+ requires a C++ compiler and library.
+                   "--enable-languages=c,c++"
+
+                   ;; Make sure gcc-nm doesn't require liblto_plugin.so.
+                   "--disable-lto"
+
+                   "--disable-shared"
+                   "--disable-plugin"
+                   "--disable-libmudflap"
+                   "--disable-libatomic"
+                   "--disable-libsanitizer"
+                   "--disable-libitm"
+                   "--disable-libgomp"
+                   "--disable-libcilkrts"
+                   "--disable-libvtv"
+                   "--disable-libssp"
+                   "--disable-libquadmath")
+                  (remove (cut string-match "--(.*plugin|enable-languages)" <>)
+                          ,flags)))
+        ((#:phases phases)
+         `(modify-phases ,phases
+            (add-after 'pre-configure 'remove-lgcc_s
+              (lambda _
+                ;; Remove the '-lgcc_s' added to GNU_USER_TARGET_LIB_SPEC in
+                ;; the 'pre-configure phase of our main gcc package, because
+                ;; that shared library is not present in this static gcc.  See
+                ;; <https://lists.gnu.org/archive/html/guix-devel/2015-01/msg00008.html>.
+                (substitute* (cons "gcc/config/rs6000/sysv4.h"
+                                   (find-files "gcc/config"
+                                               "^gnu-user.*\\.h$"))
+                  ((" -lgcc_s}}") "}}"))
+                #t))))))
      (inputs
       `(("zlib:static" ,zlib "static")
-        ,@(package-inputs gcc)))
+        ("isl:static" ,isl-0.18 "static")
+        ,@(package-inputs gcc-5)))
      (native-inputs
       (if (%current-target-system)
           `(;; When doing a Canadian cross, we need GMP/MPFR/MPC both
@@ -548,12 +528,12 @@ for `sh' in $PATH, and without nscd, and with static NSS modules."
             ("gmp-native" ,gmp)
             ("mpfr-native" ,mpfr)
             ("mpc-native" ,mpc)
-            ,@(package-native-inputs gcc))
-          (package-native-inputs gcc))))))
+            ,@(package-native-inputs gcc-5))
+          (package-native-inputs gcc-5))))))
 
 (define %gcc-stripped
   ;; The subset of GCC files needed for bootstrap.
-  (package (inherit gcc)
+  (package (inherit gcc-5)
     (name "gcc-stripped")
     (build-system trivial-build-system)
     (source #f)
@@ -566,7 +546,8 @@ for `sh' in $PATH, and without nscd, and with static NSS modules."
                       (srfi srfi-26)
                       (guix build utils))
 
-         (setvbuf (current-output-port) _IOLBF)
+         (setvbuf (current-output-port)
+                  (cond-expand (guile-2.0 _IOLBF) (else 'line)))
          (let* ((out        (assoc-ref %outputs "out"))
                 (bindir     (string-append out "/bin"))
                 (libdir     (string-append out "/lib"))
@@ -700,29 +681,29 @@ for `sh' in $PATH, and without nscd, and with static NSS modules."
   ;; .scm and .go files relative to its installation directory, rather
   ;; than in hard-coded configure-time paths.
   (let* ((patches (cons* (search-patch "guile-relocatable.patch")
-                         (search-patch "guile-2.2-default-utf8.patch")
+                         (search-patch "guile-default-utf8.patch")
                          (search-patch "guile-linux-syscalls.patch")
-                         (origin-patches (package-source guile-2.2))))
-         (source  (origin (inherit (package-source guile-2.2))
+                         (origin-patches (package-source guile-2.0))))
+         (source  (origin (inherit (package-source guile-2.0))
                     (patches patches)))
-         (guile (package (inherit guile-2.2)
-                  (name (string-append (package-name guile-2.2) "-static"))
+         (guile (package (inherit guile-2.0)
+                  (name (string-append (package-name guile-2.0) "-static"))
                   (source source)
                   (synopsis "Statically-linked and relocatable Guile")
 
                   ;; Remove the 'debug' output (see above for the reason.)
-                  (outputs (delete "debug" (package-outputs guile-2.2)))
+                  (outputs (delete "debug" (package-outputs guile-2.0)))
 
                   (inputs
                    `(("libunistring:static" ,libunistring "static")
                      ,@(package-inputs guile-2.2)))
 
                   (propagated-inputs
-                   `(("bdw-gc" ,libgc)
+                   `(("bdw-gc" ,libgc/static-libs)
                      ,@(alist-delete "bdw-gc"
-                                     (package-propagated-inputs guile-2.2))))
+                                     (package-propagated-inputs guile-2.0))))
                   (arguments
-                   (substitute-keyword-arguments (package-arguments guile-2.2)
+                   (substitute-keyword-arguments (package-arguments guile-2.0)
                      ((#:configure-flags flags '())
                       ;; When `configure' checks for ltdl availability, it
                       ;; doesn't try to link using libtool, and thus fails
@@ -745,7 +726,7 @@ for `sh' in $PATH, and without nscd, and with static NSS modules."
                                (("^guile_LDFLAGS =")
                                 "guile_LDFLAGS = -all-static")
 
-                               ;; Add `-ldl' *after* libguile-2.2.la.
+                               ;; Add `-ldl' *after* libguile-2.0.la.
                                (("^guile_LDADD =(.*)$" _ ldadd)
                                 (string-append "guile_LDADD = "
                                                (string-trim-right ldadd)
@@ -777,13 +758,13 @@ for `sh' in $PATH, and without nscd, and with static NSS modules."
                 (out    (assoc-ref %outputs "out"))
                 (guile1 (string-append in "/bin/guile"))
                 (guile2 (string-append out "/bin/guile")))
-           (mkdir-p (string-append out "/share/guile/2.2"))
-           (copy-recursively (string-append in "/share/guile/2.2")
-                             (string-append out "/share/guile/2.2"))
+           (mkdir-p (string-append out "/share/guile/2.0"))
+           (copy-recursively (string-append in "/share/guile/2.0")
+                             (string-append out "/share/guile/2.0"))
 
-           (mkdir-p (string-append out "/lib/guile/2.2/ccache"))
-           (copy-recursively (string-append in "/lib/guile/2.2/ccache")
-                             (string-append out "/lib/guile/2.2/ccache"))
+           (mkdir-p (string-append out "/lib/guile/2.0/ccache"))
+           (copy-recursively (string-append in "/lib/guile/2.0/ccache")
+                             (string-append out "/lib/guile/2.0/ccache"))
 
            (mkdir (string-append out "/bin"))
            (copy-file guile1 guile2)
@@ -890,7 +871,8 @@ for `sh' in $PATH, and without nscd, and with static NSS modules."
                       (ice-9 match)
                       (srfi srfi-26))
 
-         (setvbuf (current-output-port) _IOLBF)
+         (setvbuf (current-output-port)
+                  (cond-expand (guile-2.0 _IOLBF) (else 'line)))
          (mkdir out)
          (chdir out)
          (for-each (match-lambda
@@ -910,8 +892,8 @@ for `sh' in $PATH, and without nscd, and with static NSS modules."
                       ,%linux-libre-headers-bootstrap-tarball)))
                   (_ `(("gcc-tarball" ,%gcc-bootstrap-tarball)
                        ("binutils-tarball" ,%binutils-bootstrap-tarball)
-                       ("glibc-tarball" ,(%glibc-bootstrap-tarball)))))
-              ("coreutils&co-tarball" ,%bootstrap-binaries-tarball)))
+                       ("glibc-tarball" ,(%glibc-bootstrap-tarball))
+                       ("coreutils&co-tarball" ,%bootstrap-binaries-tarball))))))
     (synopsis "Tarballs containing all the bootstrap binaries")
     (description synopsis)
     (home-page #f)