summaryrefslogtreecommitdiff
path: root/gnu/packages/make-bootstrap.scm
diff options
context:
space:
mode:
authorLeo Famulari <leo@famulari.name>2017-01-06 17:14:41 -0500
committerLeo Famulari <leo@famulari.name>2017-01-06 17:14:41 -0500
commit74288230ea8b2310495dc2739f39ceadcc143fd0 (patch)
tree73ba6c7c13d59c5f92b409c94dccfff159e08f4d /gnu/packages/make-bootstrap.scm
parent92e779592d269ca1924f184496eb4ca832997b12 (diff)
parentaa21c764d65068783ae31febee2a92eb3d138a24 (diff)
downloadguix-patches-74288230ea8b2310495dc2739f39ceadcc143fd0.tar
guix-patches-74288230ea8b2310495dc2739f39ceadcc143fd0.tar.gz
Merge branch 'master' into core-updates
Diffstat (limited to 'gnu/packages/make-bootstrap.scm')
-rw-r--r--gnu/packages/make-bootstrap.scm63
1 files changed, 19 insertions, 44 deletions
diff --git a/gnu/packages/make-bootstrap.scm b/gnu/packages/make-bootstrap.scm
index fcd22ee68b..d2a559c084 100644
--- a/gnu/packages/make-bootstrap.scm
+++ b/gnu/packages/make-bootstrap.scm
@@ -32,6 +32,7 @@
#:use-module (gnu packages guile)
#:use-module (gnu packages bdw-gc)
#:use-module (gnu packages linux)
+ #:use-module (gnu packages hurd)
#:use-module (gnu packages multiprecision)
#:use-module (ice-9 match)
#:use-module (srfi srfi-1)
@@ -332,7 +333,7 @@ for `sh' in $PATH, and without nscd, and with static NSS modules."
#t))))
(inputs `(("binutils" ,%binutils-static)))))
-(define %glibc-stripped
+(define (%glibc-stripped)
;; GNU libc's essential shared libraries, dynamic linker, and headers,
;; with all references to store directories stripped. As a result,
;; libc.so is unusable and need to be patched for proper relocation.
@@ -341,52 +342,26 @@ for `sh' in $PATH, and without nscd, and with static NSS modules."
(name "glibc-stripped")
(build-system trivial-build-system)
(arguments
- `(#:modules ((guix build utils))
+ `(#:modules ((guix build utils)
+ (guix build make-bootstrap))
#:builder
(begin
- (use-modules (guix build utils))
-
- (setvbuf (current-output-port) _IOLBF)
- (let* ((out (assoc-ref %outputs "out"))
- (libdir (string-append out "/lib"))
- (incdir (string-append out "/include"))
- (libc (assoc-ref %build-inputs "libc"))
- (linux (assoc-ref %build-inputs "kernel-headers")))
- (mkdir-p libdir)
- (for-each (lambda (file)
- (let ((target (string-append libdir "/"
- (basename file))))
- (copy-file file target)
- (remove-store-references target)))
- (find-files (string-append libc "/lib")
- "^(crt.*|ld.*|lib(c|m|dl|rt|pthread|nsl|util).*\\.so(\\..*)?|libc_nonshared\\.a)$"))
-
- (copy-recursively (string-append libc "/include") incdir)
-
- ;; Copy some of the Linux-Libre headers that glibc headers
- ;; refer to.
- (mkdir (string-append incdir "/linux"))
- (for-each (lambda (file)
- (copy-file (string-append linux "/include/linux/" file)
- (string-append incdir "/linux/"
- (basename file))))
- '("limits.h" "errno.h" "socket.h" "kernel.h"
- "sysctl.h" "param.h" "ioctl.h" "types.h"
- "posix_types.h" "stddef.h"))
-
- (copy-recursively (string-append linux "/include/asm")
- (string-append incdir "/asm"))
- (copy-recursively (string-append linux "/include/asm-generic")
- (string-append incdir "/asm-generic"))
-
- #t))))
- (inputs `(("libc" ,(let ((target (%current-target-system)))
+ (use-modules (guix build make-bootstrap))
+ (make-stripped-libc (assoc-ref %outputs "out")
+ (assoc-ref %build-inputs "libc")
+ (assoc-ref %build-inputs "kernel-headers")))))
+ (inputs `(("kernel-headers"
+ ,(if (or (and (%current-target-system)
+ (hurd-triplet? (%current-target-system)))
+ (string-suffix? "-hurd" (%current-system)))
+ gnumach-headers
+ linux-libre-headers))
+ ("libc" ,(let ((target (%current-target-system)))
(if target
(glibc-for-bootstrap
(parameterize ((%current-target-system #f))
(cross-libc target)))
- glibc)))
- ("kernel-headers" ,linux-libre-headers)))
+ glibc)))))
;; Only one output.
(outputs '("out")))))
@@ -648,9 +623,9 @@ for `sh' in $PATH, and without nscd, and with static NSS modules."
;; A tarball with the statically-linked Binutils programs.
(tarball-package %binutils-static-stripped))
-(define %glibc-bootstrap-tarball
+(define (%glibc-bootstrap-tarball)
;; A tarball with GNU libc's shared libraries, dynamic linker, and headers.
- (tarball-package %glibc-stripped))
+ (tarball-package (%glibc-stripped)))
(define %gcc-bootstrap-tarball
;; A tarball with a dynamic-linked GCC and its headers.
@@ -690,7 +665,7 @@ for `sh' in $PATH, and without nscd, and with static NSS modules."
(inputs `(("guile-tarball" ,%guile-bootstrap-tarball)
("gcc-tarball" ,%gcc-bootstrap-tarball)
("binutils-tarball" ,%binutils-bootstrap-tarball)
- ("glibc-tarball" ,%glibc-bootstrap-tarball)
+ ("glibc-tarball" ,(%glibc-bootstrap-tarball))
("coreutils&co-tarball" ,%bootstrap-binaries-tarball)))
(synopsis "Tarballs containing all the bootstrap binaries")
(description synopsis)