From 5b8c6abcfcbe97888779fdfe0cd9768f7599129b Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Sun, 9 Sep 2018 11:48:10 +0200 Subject: gnu: Add linux-libre-headers-bootstrap-tarball. * gnu/packages/make-bootstrap.scm (%linux-libre-headers-stripped): New variable. (%linux-libre-headers-bootstrap-tarball): New variable. --- gnu/packages/make-bootstrap.scm | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'gnu/packages/make-bootstrap.scm') diff --git a/gnu/packages/make-bootstrap.scm b/gnu/packages/make-bootstrap.scm index c6002eb63a..af9373ad9c 100644 --- a/gnu/packages/make-bootstrap.scm +++ b/gnu/packages/make-bootstrap.scm @@ -41,6 +41,7 @@ #:use-module (ice-9 match) #:use-module (srfi srfi-1) #:export (%bootstrap-binaries-tarball + %linux-libre-headers-bootstrap-tarball %binutils-bootstrap-tarball %glibc-bootstrap-tarball %gcc-bootstrap-tarball @@ -300,6 +301,26 @@ for `sh' in $PATH, and without nscd, and with static NSS modules." (license gpl3+) (home-page #f))) +(define %linux-libre-headers-stripped + ;; The subset of Linux-Libre-Headers that we need. + (package (inherit linux-libre-headers) + (name (string-append (package-name linux-libre-headers) "-stripped")) + (build-system trivial-build-system) + (outputs '("out")) + (arguments + `(#:modules ((guix build utils) + (guix build make-bootstrap)) + #:builder + (begin + (use-modules (guix build utils) + (guix build make-bootstrap)) + + (let* ((in (assoc-ref %build-inputs "linux-libre-headers")) + (out (assoc-ref %outputs "out"))) + (copy-linux-headers out in) + #t)))) + (inputs `(("linux-libre-headers" ,linux-libre-headers))))) + (define %binutils-static ;; Statically-linked Binutils. (package (inherit binutils) @@ -660,6 +681,10 @@ for `sh' in $PATH, and without nscd, and with static NSS modules." ;; A tarball with the statically-linked bootstrap binaries. (tarball-package %static-binaries)) +(define %linux-libre-headers-bootstrap-tarball + ;; A tarball with the statically-linked Linux-Libre-Headers programs. + (tarball-package %linux-libre-headers-stripped)) + (define %binutils-bootstrap-tarball ;; A tarball with the statically-linked Binutils programs. (tarball-package %binutils-static-stripped)) -- cgit v1.2.3 From fb925c7257104077ccc8117087e60bec8b551f45 Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Mon, 22 Jul 2019 10:07:07 +0200 Subject: bootstrap: Add mescc-tools-static-stripped-tarball. * gnu/packages/make-bootstrap.scm (%mescc-tools-static, %mescc-tools-static-stripped, %mescc-tools-bootstrap-tarball): New variable. Modified-By: Mark H Weaver --- gnu/packages/make-bootstrap.scm | 68 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) (limited to 'gnu/packages/make-bootstrap.scm') diff --git a/gnu/packages/make-bootstrap.scm b/gnu/packages/make-bootstrap.scm index af9373ad9c..5d80f584a4 100644 --- a/gnu/packages/make-bootstrap.scm +++ b/gnu/packages/make-bootstrap.scm @@ -3,6 +3,7 @@ ;;; Copyright © 2017 Efraim Flashner ;;; Copyright © 2018 Tobias Geerinckx-Rice ;;; Copyright © 2018 Mark H Weaver +;;; Copyright © 2019 Jan (janneke) Nieuwenhuizen ;;; ;;; This file is part of GNU Guix. ;;; @@ -37,6 +38,7 @@ #:use-module (gnu packages libunistring) #:use-module (gnu packages linux) #:use-module (gnu packages hurd) + #:use-module (gnu packages mes) #:use-module (gnu packages multiprecision) #:use-module (ice-9 match) #:use-module (srfi srfi-1) @@ -46,6 +48,7 @@ %glibc-bootstrap-tarball %gcc-bootstrap-tarball %guile-bootstrap-tarball + %mescc-tools-bootstrap-tarball %bootstrap-tarballs %guile-static-stripped)) @@ -534,6 +537,67 @@ for `sh' in $PATH, and without nscd, and with static NSS modules." #t)))) (inputs `(("gcc" ,%gcc-static))))) +;; One package: build + remove store references +;; (define %mescc-tools-static-stripped +;; ;; A statically linked Mescc Tools with store references removed, for +;; ;; bootstrap. +;; (package +;; (inherit mescc-tools) +;; (name "mescc-tools-static-stripped") +;; (arguments +;; `(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out")) +;; "CC=gcc -static") +;; #:test-target "test" +;; #:phases (modify-phases %standard-phases +;; (delete 'configure) +;; (add-after 'install 'strip-store-references +;; (lambda _ +;; (let* ((out (assoc-ref %outputs "out")) +;; (bin (string-append out "/bin"))) +;; (for-each (lambda (file) +;; (let ((target (string-append bin "/" file))) +;; (format #t "strippingg `~a'...~%" target) +;; (remove-store-references target))) +;; '( "M1" "blood-elf" "hex2")))))))))) + +;; Two packages: first build static, bare minimum content. +(define %mescc-tools-static + ;; A statically linked MesCC Tools. + (package + (inherit mescc-tools) + (name "mescc-tools-static") + (arguments + `(#:system "i686-linux" + ,@(substitute-keyword-arguments (package-arguments mescc-tools) + ((#:make-flags flags) + `(cons "CC=gcc -static" ,flags))))))) + +;; ... next remove store references. +(define %mescc-tools-static-stripped + ;; A statically linked Mescc Tools with store references removed, for + ;; bootstrap. + (package + (inherit %mescc-tools-static) + (name (string-append (package-name %mescc-tools-static) "-stripped")) + (build-system trivial-build-system) + (arguments + `(#:modules ((guix build utils)) + #:builder + (begin + (use-modules (guix build utils)) + (let* ((in (assoc-ref %build-inputs "mescc-tools")) + (out (assoc-ref %outputs "out")) + (bin (string-append out "/bin"))) + (mkdir-p bin) + (for-each (lambda (file) + (let ((target (string-append bin "/" file))) + (format #t "copying `~a'...~%" file) + (copy-file (string-append in "/bin/" file) + target) + (remove-store-references target))) + '( "M1" "blood-elf" "hex2")) + #t)))) + (inputs `(("mescc-tools" ,%mescc-tools-static))))) (define %guile-static ;; A statically-linked Guile that is relocatable--i.e., it can search ;; .scm and .go files relative to its installation directory, rather @@ -701,6 +765,10 @@ for `sh' in $PATH, and without nscd, and with static NSS modules." ;; A tarball with the statically-linked, relocatable Guile. (tarball-package %guile-static-stripped)) +(define %mescc-tools-bootstrap-tarball + ;; A tarball with statically-linked MesCC binary seed. + (tarball-package %mescc-tools-static-stripped)) + (define %bootstrap-tarballs ;; A single derivation containing all the bootstrap tarballs, for ;; convenience. -- cgit v1.2.3 From ed050b1cf51941046466d07ba7e94bd9fba02e00 Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Mon, 22 Jul 2019 10:07:41 +0200 Subject: bootstrap: Add mes-minimal-stripped-tarball. * gnu/packages/make-bootstrap.scm (%mes-minimal, %mes-minimal-stripped, %mes-bootstrap-tarball): New variable. Modified-By: Mark H Weaver --- gnu/packages/make-bootstrap.scm | 92 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) (limited to 'gnu/packages/make-bootstrap.scm') diff --git a/gnu/packages/make-bootstrap.scm b/gnu/packages/make-bootstrap.scm index 5d80f584a4..cf9f8b4633 100644 --- a/gnu/packages/make-bootstrap.scm +++ b/gnu/packages/make-bootstrap.scm @@ -49,6 +49,7 @@ %gcc-bootstrap-tarball %guile-bootstrap-tarball %mescc-tools-bootstrap-tarball + %mes-bootstrap-tarball %bootstrap-tarballs %guile-static-stripped)) @@ -598,6 +599,93 @@ for `sh' in $PATH, and without nscd, and with static NSS modules." '( "M1" "blood-elf" "hex2")) #t)))) (inputs `(("mescc-tools" ,%mescc-tools-static))))) + +;; (define-public %mes-minimal-stripped +;; ;; A minimal Mes without documentation dependencies, for bootstrap. +;; (let ((triplet "i686-unknown-linux-gnu")) +;; (package +;; (inherit mes) +;; (name "mes-minimal-stripped") +;; (native-inputs +;; `(("guile" ,guile-2.2))) +;; (arguments +;; `(#:system "i686-linux" +;; #:strip-binaries? #f +;; #:configure-flags '("--mes") +;; #:phases +;; (modify-phases %standard-phases +;; (delete 'patch-shebangs) +;; (add-after 'install 'strip-install +;; (lambda _ +;; (let* ((out (assoc-ref %outputs "out")) +;; (share (string-append out "/share"))) +;; (delete-file-recursively (string-append out "/lib/guile")) +;; (delete-file-recursively (string-append share "/guile")) +;; (delete-file-recursively (string-append share "/mes/scaffold")) + +;; (for-each delete-file +;; (find-files +;; (string-append share "/mes/lib") "\\.(h|c)")) + +;; (for-each (lambda (dir) +;; (for-each remove-store-references +;; (find-files (string-append out "/" dir) +;; ".*"))) +;; '("bin" "share/mes"))))))))))) + +;; Two packages: first build static, bare minimum content. +(define-public %mes-minimal + ;; A minimal Mes without documentation. + (let ((triplet "i686-unknown-linux-gnu")) + (package + (inherit mes) + (name "mes-minimal") + (native-inputs + `(("guile" ,guile-2.2))) + (arguments + `(#:system "i686-linux" + #:strip-binaries? #f + #:configure-flags '("--mes") + #:phases + (modify-phases %standard-phases + (delete 'patch-shebangs) + (add-after 'install 'strip-install + (lambda _ + (let* ((out (assoc-ref %outputs "out")) + (share (string-append out "/share"))) + (delete-file-recursively (string-append out "/lib/guile")) + (delete-file-recursively (string-append share "/guile")) + (delete-file-recursively (string-append share "/mes/scaffold")) + + (for-each delete-file + (find-files + (string-append share "/mes/lib") + "\\.(h|c)"))))))))))) + +;; next remove store references. +(define %mes-minimal-stripped + ;; A minimal Mes with store references removed, for bootstrap. + (package + (inherit %mes-minimal) + (name (string-append (package-name %mes-minimal) "-stripped")) + (build-system trivial-build-system) + (arguments + `(#:modules ((guix build utils)) + #:builder + (begin + (use-modules (guix build utils)) + (let ((in (assoc-ref %build-inputs "mes")) + (out (assoc-ref %outputs "out"))) + + (copy-recursively in out) + (for-each (lambda (dir) + (for-each remove-store-references + (find-files (string-append out "/" dir) + ".*"))) + '("bin" "share/mes")) + #t)))) + (inputs `(("mes" ,%mes-minimal))))) + (define %guile-static ;; A statically-linked Guile that is relocatable--i.e., it can search ;; .scm and .go files relative to its installation directory, rather @@ -769,6 +857,10 @@ for `sh' in $PATH, and without nscd, and with static NSS modules." ;; A tarball with statically-linked MesCC binary seed. (tarball-package %mescc-tools-static-stripped)) +(define %mes-bootstrap-tarball + ;; A tarball with Mes binary seed. + (tarball-package %mes-minimal-stripped)) + (define %bootstrap-tarballs ;; A single derivation containing all the bootstrap tarballs, for ;; convenience. -- cgit v1.2.3 From 6744cef5b033c60a388d1de9a6b08c917cc51a4c Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Mon, 12 Aug 2019 17:43:03 -0400 Subject: bootstrap: Build the new reduced binary seed bootstrap on x86. * gnu/packages/make-bootstrap.scm (%bootstrap-tarballs)[inputs]: On i686-linux and x86_64-linux, substitute linux-libre-headers, Mes, and MesCC, in place of GCC, binutils, and glibc. --- gnu/packages/make-bootstrap.scm | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'gnu/packages/make-bootstrap.scm') diff --git a/gnu/packages/make-bootstrap.scm b/gnu/packages/make-bootstrap.scm index cf9f8b4633..d3b13d9d5f 100644 --- a/gnu/packages/make-bootstrap.scm +++ b/gnu/packages/make-bootstrap.scm @@ -889,9 +889,15 @@ for `sh' in $PATH, and without nscd, and with static NSS modules." %build-inputs) #t))) (inputs `(("guile-tarball" ,%guile-bootstrap-tarball) - ("gcc-tarball" ,%gcc-bootstrap-tarball) - ("binutils-tarball" ,%binutils-bootstrap-tarball) - ("glibc-tarball" ,(%glibc-bootstrap-tarball)) + ,@(match (or (%current-target-system) (%current-system)) + ((or "i686-linux" "x86_64-linux") + `(("bootstrap-mescc-tools" ,%mescc-tools-bootstrap-tarball) + ("bootstrap-mes" ,%mes-bootstrap-tarball) + ("bootstrap-linux-libre-headers" + ,%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))) (synopsis "Tarballs containing all the bootstrap binaries") (description synopsis) -- cgit v1.2.3 From fe507d7a3d83169c77b6f73a66ffa0ce59f1119d Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Sun, 11 Aug 2019 22:37:12 -0400 Subject: bootstrap: Build bootstrap bash deterministically. * gnu/packages/patches/bash-4.4-linux-pgrp-pipe.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/make-bootstrap.scm (static-bash-for-bootstrap): New variable. (%static-inputs): Use 'static-bash-for-bootstrap' instead of 'static-bash'. --- gnu/local.mk | 1 + gnu/packages/make-bootstrap.scm | 15 ++++++++--- .../patches/bash-4.4-linux-pgrp-pipe.patch | 30 ++++++++++++++++++++++ 3 files changed, 43 insertions(+), 3 deletions(-) create mode 100644 gnu/packages/patches/bash-4.4-linux-pgrp-pipe.patch (limited to 'gnu/packages/make-bootstrap.scm') diff --git a/gnu/local.mk b/gnu/local.mk index 16b63bc951..38a06e5620 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -697,6 +697,7 @@ dist_patch_DATA = \ %D%/packages/patches/avidemux-install-to-lib.patch \ %D%/packages/patches/awesome-reproducible-png.patch \ %D%/packages/patches/azr3.patch \ + %D%/packages/patches/bash-4.4-linux-pgrp-pipe.patch \ %D%/packages/patches/bash-completion-directories.patch \ %D%/packages/patches/bastet-change-source-of-unordered_set.patch \ %D%/packages/patches/bazaar-CVE-2017-14176.patch \ diff --git a/gnu/packages/make-bootstrap.scm b/gnu/packages/make-bootstrap.scm index d3b13d9d5f..2f0bb30b91 100644 --- a/gnu/packages/make-bootstrap.scm +++ b/gnu/packages/make-bootstrap.scm @@ -2,7 +2,7 @@ ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018 Ludovic Courtès ;;; Copyright © 2017 Efraim Flashner ;;; Copyright © 2018 Tobias Geerinckx-Rice -;;; Copyright © 2018 Mark H Weaver +;;; Copyright © 2018, 2019 Mark H Weaver ;;; Copyright © 2019 Jan (janneke) Nieuwenhuizen ;;; ;;; This file is part of GNU Guix. @@ -125,6 +125,15 @@ 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-4.4-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) @@ -192,7 +201,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)) + `(("bash" ,static-bash-for-bootstrap)) '())))) (tar (package (inherit tar) (arguments @@ -233,7 +242,7 @@ for `sh' in $PATH, and without nscd, and with static NSS modules." ("sed" ,sed) ("grep" ,grep) ("gawk" ,gawk))) - ("bash" ,static-bash)))) + ("bash" ,static-bash-for-bootstrap)))) (define %static-binaries (package diff --git a/gnu/packages/patches/bash-4.4-linux-pgrp-pipe.patch b/gnu/packages/patches/bash-4.4-linux-pgrp-pipe.patch new file mode 100644 index 0000000000..0d03d7ce37 --- /dev/null +++ b/gnu/packages/patches/bash-4.4-linux-pgrp-pipe.patch @@ -0,0 +1,30 @@ +Unconditionally enable PGRP_PIPE on Linux (the kernel), regardless of +the kernel version in use on the build machine. + +--- configure.ac.orig 1969-12-31 19:00:00.000000000 -0500 ++++ configure.ac 2019-08-11 22:28:26.038841961 -0400 +@@ -1092,9 +1092,7 @@ + solaris2*) LOCAL_CFLAGS=-DSOLARIS ;; + lynxos*) LOCAL_CFLAGS=-DRECYCLES_PIDS ;; + linux*) LOCAL_LDFLAGS=-rdynamic # allow dynamic loading +- case "`uname -r`" in +- 2.[[456789]]*|[[34]]*) AC_DEFINE(PGRP_PIPE) ;; +- esac ;; ++ AC_DEFINE(PGRP_PIPE) ;; + *qnx6*) LOCAL_CFLAGS="-Dqnx -Dqnx6" LOCAL_LIBS="-lncurses" ;; + *qnx*) LOCAL_CFLAGS="-Dqnx -F -3s" LOCAL_LDFLAGS="-3s" LOCAL_LIBS="-lunix -lncurses" ;; + powerux*) LOCAL_LIBS="-lgen" ;; +--- configure.orig 1969-12-31 19:00:00.000000000 -0500 ++++ configure 2019-08-11 22:28:10.166763255 -0400 +@@ -16064,10 +16064,7 @@ + solaris2*) LOCAL_CFLAGS=-DSOLARIS ;; + lynxos*) LOCAL_CFLAGS=-DRECYCLES_PIDS ;; + linux*) LOCAL_LDFLAGS=-rdynamic # allow dynamic loading +- case "`uname -r`" in +- 2.[456789]*|[34]*) $as_echo "#define PGRP_PIPE 1" >>confdefs.h +- ;; +- esac ;; ++ $as_echo "#define PGRP_PIPE 1" >>confdefs.h ;; + *qnx6*) LOCAL_CFLAGS="-Dqnx -Dqnx6" LOCAL_LIBS="-lncurses" ;; + *qnx*) LOCAL_CFLAGS="-Dqnx -F -3s" LOCAL_LDFLAGS="-3s" LOCAL_LIBS="-lunix -lncurses" ;; + powerux*) LOCAL_LIBS="-lgen" ;; -- cgit v1.2.3 From 9e6256ba0f32ab12d61c914a3fed879dac881762 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Mon, 12 Aug 2019 00:59:51 -0400 Subject: bootstrap: guile-static: Disable parallel build. * gnu/packages/make-bootstrap.scm (%guile-static)[arguments]: Override #:parallel-build? to be #f. --- gnu/packages/make-bootstrap.scm | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'gnu/packages/make-bootstrap.scm') diff --git a/gnu/packages/make-bootstrap.scm b/gnu/packages/make-bootstrap.scm index 2f0bb30b91..37bf4e9744 100644 --- a/gnu/packages/make-bootstrap.scm +++ b/gnu/packages/make-bootstrap.scm @@ -753,6 +753,10 @@ for `sh' in $PATH, and without nscd, and with static NSS modules." ((#:tests? _ #f) ;; There are uses of `dynamic-link' in ;; {foreign,coverage}.test that don't fly here. + #f) + ((#:parallel-build? _ #f) + ;; Work around the fact that the Guile build system is + ;; not deterministic when parallel-build is enabled. #f)))))) (package-with-relocatable-glibc (static-package guile)))) -- cgit v1.2.3