[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
01/03: bootstrappable: Minor style issues. WIP: also squash into `Add Me
From: |
Jan Nieuwenhuizen |
Subject: |
01/03: bootstrappable: Minor style issues. WIP: also squash into `Add Mes bootstrap.' |
Date: |
Mon, 17 Sep 2018 16:02:40 -0400 (EDT) |
janneke pushed a commit to branch wip-bootstrap
in repository guix.
commit 6764bc361184fa69129ec767868bb483810d0dd6
Author: Jan Nieuwenhuizen <address@hidden>
Date: Mon Sep 17 20:59:14 2018 +0200
bootstrappable: Minor style issues. WIP: also squash into `Add Mes
bootstrap.'
* gnu/packages/commencement.scm: Throughout:
(,@(substitute-.. -> (substitute-.. and (zero? (system* => (invoke.
---
gnu/packages/commencement.scm | 528 +++++++++++++++++++++---------------------
1 file changed, 266 insertions(+), 262 deletions(-)
diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index 4cd0ee5..74e6485 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -962,63 +962,63 @@ 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)
- ((#:phases phases)
- `(modify-phases ,phases
- (replace 'setenv
- (lambda* (#:key outputs #:allow-other-keys)
- (let ((out (assoc-ref outputs "out"))
- (bash (assoc-ref %build-inputs "bash"))
- (gcc (assoc-ref %build-inputs "gcc"))
- (glibc (assoc-ref %build-inputs "libc"))
- (kernel-headers (assoc-ref %build-inputs
"kernel-headers")))
- (setenv "CONFIG_SHELL" (string-append bash "/bin/sh"))
- (format (current-error-port) "C_INCLUDE_PATH=~a\n"
(getenv "C_INCLUDE_PATH"))
- ;; FIXME
- ;; (setenv "C_INCLUDE_PATH" (string-join
- ;; (list (string-append glibc
"/include")
- ;; (getenv
"C_INCLUDE_PATH"))
- ;; ":"))
- (setenv "C_INCLUDE_PATH" (string-append
- gcc
"/lib/gcc-lib/i686-unknown-linux-gnu/2.95.3/include"
- ":" kernel-headers "/include"
- ":" glibc "/include"))
- (format (current-error-port) "C_INCLUDE_PATH=~a\n"
(getenv "C_INCLUDE_PATH"))
- (format (current-error-port) "LIBRARY_PATH=~a\n" (getenv
"LIBRARY_PATH"))
- ;; FIXME: add glibc dirs to paths manually
- (setenv "LIBRARY_PATH" (string-join
- (list (string-append glibc
"/lib")
- (getenv "LIBRARY_PATH"))
- ":"))
- (format (current-error-port) "LIBRARY_PATH=~a\n" (getenv
"LIBRARY_PATH"))
- (with-output-to-file "config.cache"
- (lambda _
- (display "
+ (substitute-keyword-arguments (package-arguments gcc-core-mesboot)
+ ((#:phases phases)
+ `(modify-phases ,phases
+ (replace 'setenv
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out"))
+ (bash (assoc-ref %build-inputs "bash"))
+ (gcc (assoc-ref %build-inputs "gcc"))
+ (glibc (assoc-ref %build-inputs "libc"))
+ (kernel-headers (assoc-ref %build-inputs
"kernel-headers")))
+ (setenv "CONFIG_SHELL" (string-append bash "/bin/sh"))
+ (format (current-error-port) "C_INCLUDE_PATH=~a\n" (getenv
"C_INCLUDE_PATH"))
+ ;; FIXME
+ ;; (setenv "C_INCLUDE_PATH" (string-join
+ ;; (list (string-append glibc
"/include")
+ ;; (getenv "C_INCLUDE_PATH"))
+ ;; ":"))
+ (setenv "C_INCLUDE_PATH" (string-append
+ gcc
"/lib/gcc-lib/i686-unknown-linux-gnu/2.95.3/include"
+ ":" kernel-headers "/include"
+ ":" glibc "/include"))
+ (format (current-error-port) "C_INCLUDE_PATH=~a\n" (getenv
"C_INCLUDE_PATH"))
+ (format (current-error-port) "LIBRARY_PATH=~a\n" (getenv
"LIBRARY_PATH"))
+ ;; FIXME: add glibc dirs to paths manually
+ (setenv "LIBRARY_PATH" (string-join
+ (list (string-append glibc "/lib")
+ (getenv "LIBRARY_PATH"))
+ ":"))
+ (format (current-error-port) "LIBRARY_PATH=~a\n" (getenv
"LIBRARY_PATH"))
+ (with-output-to-file "config.cache"
+ (lambda _
+ (display "
ac_cv_c_float_format='IEEE (little-endian)'
")))
- #t)))
- (replace 'install2
- (lambda* (#:key outputs #:allow-other-keys)
- (let* ((out (assoc-ref outputs "out"))
- (gcc-dir (string-append
- out
"/lib/gcc-lib/i686-unknown-linux-gnu/2.95.3")))
- (and
- (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"))))))))
- ((#:configure-flags configure-flags)
- `(let ((out (assoc-ref %outputs "out")))
- `("--disable-shared"
- "--disable-werror"
- "--build=i686-unknown-linux-gnu"
- "--host=i686-unknown-linux-gnu"
- ,(string-append "--prefix=" out))))
- ((#:make-flags make-flags)
- `(let ((gcc (assoc-ref %build-inputs "gcc")))
- `("RANLIB=true"
- ,(string-append "LIBGCC2_INCLUDES=-I " gcc "/include")
- "LANGUAGES=c")))))))))
+ #t)))
+ (replace 'install2
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (gcc-dir (string-append
+ out
"/lib/gcc-lib/i686-unknown-linux-gnu/2.95.3")))
+ (and
+ (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"))))))))
+ ((#:configure-flags configure-flags)
+ `(let ((out (assoc-ref %outputs "out")))
+ `("--disable-shared"
+ "--disable-werror"
+ "--build=i686-unknown-linux-gnu"
+ "--host=i686-unknown-linux-gnu"
+ ,(string-append "--prefix=" out))))
+ ((#:make-flags make-flags)
+ `(let ((gcc (assoc-ref %build-inputs "gcc")))
+ `("RANLIB=true"
+ ,(string-append "LIBGCC2_INCLUDES=-I " gcc "/include")
+ "LANGUAGES=c"))))))))
(define binutils-mesboot
(package-with-bootstrap-guile
@@ -1035,14 +1035,14 @@ ac_cv_c_float_format='IEEE (little-endian)'
("kernel-headers" ,%bootstrap-linux-libre-headers)
("make" ,make-mesboot0)))
(arguments
- `(,@(substitute-keyword-arguments (package-arguments binutils-mesboot0)
- ((#:configure-flags configure-flags)
- '(list "--disable-nls"
- "--disable-shared"
- "--disable-werror"
- "--build=i686-unknown-linux-gnu"
- "--host=i686-unknown-linux-gnu"
- "--with-sysroot=/"))))))))
+ (substitute-keyword-arguments (package-arguments binutils-mesboot0)
+ ((#:configure-flags configure-flags)
+ '(list "--disable-nls"
+ "--disable-shared"
+ "--disable-werror"
+ "--build=i686-unknown-linux-gnu"
+ "--host=i686-unknown-linux-gnu"
+ "--with-sysroot=/")))))))
(define make-mesboot
(package-with-bootstrap-guile
@@ -1066,17 +1066,17 @@ ac_cv_c_float_format='IEEE (little-endian)'
("coreutils" ,%bootstrap-coreutils&co)
("kernel-headers" ,%bootstrap-linux-libre-headers)))
(arguments
- `(,@(substitute-keyword-arguments (package-arguments make-mesboot0)
- ((#:configure-flags configure-flags)
- `(let ((out (assoc-ref %outputs "out")))
- `(,(string-append "--prefix=" out))))
- ((#:phases phases)
- `(modify-phases ,phases
- (delete 'configure-fixup)
- (add-before 'configure 'setenv
- (lambda _
- (setenv "LIBS" "-lc -lnss_files -lnss_dns -lresolv")
- #f))))))))))
+ (substitute-keyword-arguments (package-arguments make-mesboot0)
+ ((#:configure-flags configure-flags)
+ `(let ((out (assoc-ref %outputs "out")))
+ `(,(string-append "--prefix=" out))))
+ ((#:phases phases)
+ `(modify-phases ,phases
+ (delete 'configure-fixup)
+ (add-before 'configure 'setenv
+ (lambda _
+ (setenv "LIBS" "-lc -lnss_files -lnss_dns -lresolv")
+ #f)))))))))
(define gmp-boot
(package
@@ -1140,110 +1140,112 @@ 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)
- ((#:make-flags make-flags)
- `(let* ((libc (assoc-ref %build-inputs "libc"))
- (ldflags (string-append
- "-B" libc "/lib "
- "-Wl,-dynamic-linker "
- "-Wl," libc
- ,(glibc-dynamic-linker))))
- (list (string-append "LDFLAGS=" ldflags)
- (string-append "LDFLAGS_FOR_TARGET=" ldflags))))
- ((#:phases phases)
- `(modify-phases ,phases
- ;; c&p from commencement.scm:gcc-boot0
- (add-after 'unpack 'unpack-gmp&co
- (lambda* (#:key inputs #:allow-other-keys)
- (let ((gmp (assoc-ref %build-inputs "gmp-source"))
- (mpfr (assoc-ref %build-inputs "mpfr-source"))
- (mpc (assoc-ref %build-inputs "mpc-source")))
-
- ;; To reduce the set of pre-built bootstrap inputs, build
- ;; GMP & co. from GCC.
- (for-each (lambda (source)
- (or (zero? (system* "tar" "xvf" source))
- (error "failed to unpack tarball"
- source)))
- (list gmp mpfr mpc))
-
- ;; Create symlinks like `gmp' -> `gmp-x.y.z'.
- ,@(map (lambda (lib)
- ;; Drop trailing letters, as gmp-6.0.0a unpacks
- ;; into gmp-6.0.0.
- `(symlink ,(string-trim-right
- (package-full-name lib "-")
- char-set:letter)
- ,(package-name lib)))
- (list gmp-boot mpfr-boot mpc-boot))
- #t)))
- (delete 'remove-info)
- (replace 'setenv
- (lambda* (#:key outputs #:allow-other-keys)
- (let* ((out (assoc-ref outputs "out"))
- (binutils (assoc-ref %build-inputs "binutils"))
- (bash (assoc-ref %build-inputs "bash"))
- (gcc (assoc-ref %build-inputs "gcc"))
- (glibc (assoc-ref %build-inputs "libc"))
- (kernel-headers (assoc-ref %build-inputs
"kernel-headers")))
- (setenv "CONFIG_SHELL" (string-append bash "/bin/sh"))
- (setenv "C_INCLUDE_PATH" (string-append
- gcc
"/lib/gcc-lib/i686-unknown-linux-gnu/2.95.3/include"
- ":" kernel-headers "/include"
- ":" glibc "/include"
- ":" (getcwd) "/mpfr/src"))
- (setenv "LIBRARY_PATH" (string-append glibc "/lib"
- ":" gcc "/lib"))
- (format (current-error-port) "C_INCLUDE_PATH=~a\n"
(getenv "C_INCLUDE_PATH"))
- (format (current-error-port) "LIBRARY_PATH=~a\n" (getenv
"LIBRARY_PATH"))
- #t)))
- (delete 'install2)))
- ((#:configure-flags configure-flags)
- `(let ((out (assoc-ref %outputs "out"))
- (glibc (assoc-ref %build-inputs "libc")))
- (list (string-append "--prefix=" out)
- "--build=i686-unknown-linux-gnu"
- "--host=i686-unknown-linux-gnu"
-
- (string-append "--with-native-system-header-dir=" glibc
"/include")
- (string-append "--with-build-sysroot=" glibc "/include")
-
- "--disable-bootstrap"
- "--disable-decimal-float"
- "--disable-libatomic"
- "--disable-libcilkrts"
- "--disable-libgomp"
- "--disable-libitm"
- "--disable-libmudflap"
- "--disable-libquadmath"
- "--disable-libsanitizer"
- "--disable-libssp"
- "--disable-libvtv"
- "--disable-lto"
- "--disable-lto-plugin"
- "--disable-multilib"
- "--disable-plugin"
- "--disable-threads"
- "--enable-languages=c,c++"
-
- "--enable-static"
- ;; libstdc++.so: error: depends on 'libgcc_s.so.1',
which cannot be found in RUNPATH ()
- "--disable-shared"
- "--enable-threads=single"
-
- ;; libstdc++ cannot be built at this stage
- ;; ("Link tests are not allowed after
- ;; GCC_NO_EXECUTABLES.").
- ;;; We NEED this later -- possibly add it in next
gcc-mesboot...?
- ;;;'"--disable-libstdc__-v3"
-
- ;; No pre-compiled libstdc++ headers, to save space.
- "--disable-libstdcxx-pch"
+ (substitute-keyword-arguments (package-arguments gcc-core-mesboot)
+ ((#:make-flags make-flags)
+ `(let* ((libc (assoc-ref %build-inputs "libc"))
+ (ldflags (string-append
+ "-B" libc "/lib "
+ "-Wl,-dynamic-linker "
+ "-Wl," libc
+ ,(glibc-dynamic-linker))))
+ (list (string-append "LDFLAGS=" ldflags)
+ (string-append "LDFLAGS_FOR_TARGET=" ldflags))))
+ ((#:phases phases)
+ `(modify-phases ,phases
+ ;; c&p from commencement.scm:gcc-boot0
+ (add-after 'unpack 'unpack-gmp&co
+ (lambda* (#:key inputs #:allow-other-keys)
+ (let ((gmp (assoc-ref %build-inputs "gmp-source"))
+ (mpfr (assoc-ref %build-inputs "mpfr-source"))
+ (mpc (assoc-ref %build-inputs "mpc-source")))
+
+ ;; To reduce the set of pre-built bootstrap inputs, build
+ ;; GMP & co. from GCC.
+ (for-each (lambda (source)
+ (or (invoke "tar" "xvf" source)
+ (error "failed to unpack tarball"
+ source)))
+ (list gmp mpfr mpc))
+
+ ;; Create symlinks like `gmp' -> `gmp-x.y.z'.
+ ,@(map (lambda (lib)
+ ;; Drop trailing letters, as gmp-6.0.0a unpacks
+ ;; into gmp-6.0.0.
+ `(symlink ,(string-trim-right
+ (package-full-name lib "-")
+ char-set:letter)
+ ,(package-name lib)))
+ (list gmp-boot mpfr-boot mpc-boot))
+ #t)))
+ (delete 'remove-info)
+ (replace 'setenv
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (binutils (assoc-ref %build-inputs "binutils"))
+ (bash (assoc-ref %build-inputs "bash"))
+ (gcc (assoc-ref %build-inputs "gcc"))
+ (glibc (assoc-ref %build-inputs "libc"))
+ (kernel-headers (assoc-ref %build-inputs
"kernel-headers")))
+ (setenv "CONFIG_SHELL" (string-append bash "/bin/sh"))
+ (setenv "C_INCLUDE_PATH" (string-append
+ gcc
"/lib/gcc-lib/i686-unknown-linux-gnu/2.95.3/include"
+ ":" kernel-headers "/include"
+ ":" glibc "/include"
+ ":" (getcwd) "/mpfr/src"))
+ (setenv "LIBRARY_PATH" (string-append glibc "/lib"
+ ":" gcc "/lib"))
+ (format (current-error-port) "C_INCLUDE_PATH=~a\n" (getenv
"C_INCLUDE_PATH"))
+ (format (current-error-port) "LIBRARY_PATH=~a\n" (getenv
"LIBRARY_PATH"))
+ #t)))
+ (delete 'install2)))
+ ((#:configure-flags configure-flags)
+ `(let ((out (assoc-ref %outputs "out"))
+ (glibc (assoc-ref %build-inputs "libc")))
+ (list (string-append "--prefix=" out)
+ "--build=i686-unknown-linux-gnu"
+ "--host=i686-unknown-linux-gnu"
- ;; for libcpp ...
- "--disable-build-with-cxx")))))))))
+ (string-append "--with-native-system-header-dir=" glibc
"/include")
+ (string-append "--with-build-sysroot=" glibc "/include")
+
+ "--disable-bootstrap"
+ "--disable-decimal-float"
+ "--disable-libatomic"
+ "--disable-libcilkrts"
+ "--disable-libgomp"
+ "--disable-libitm"
+ "--disable-libmudflap"
+ "--disable-libquadmath"
+ "--disable-libsanitizer"
+ "--disable-libssp"
+ "--disable-libvtv"
+ "--disable-lto"
+ "--disable-lto-plugin"
+ "--disable-multilib"
+ "--disable-plugin"
+ "--disable-threads"
+ "--enable-languages=c,c++"
+
+ "--enable-static"
+ ;; libstdc++.so: error: depends on 'libgcc_s.so.1', which
cannot be found in RUNPATH ()
+ "--disable-shared"
+ "--enable-threads=single"
+
+ ;; libstdc++ cannot be built at this stage
+ ;; ("Link tests are not allowed after
+ ;; GCC_NO_EXECUTABLES.").
+;;; We NEED this later -- possibly add it in next gcc-mesboot...?
+;;;'"--disable-libstdc__-v3"
+
+ ;; No pre-compiled libstdc++ headers, to save space.
+ "--disable-libstdcxx-pch"
+
+ ;; for libcpp ...
+ "--disable-build-with-cxx"))))))))
(define gcc-mesboot1-wrapper
+ ;; We need this so gcc-mesboot1 can be used to create shared binaries that
+ ;; have the correct interpreter and runpath to libc.
(package-with-bootstrap-guile
(package
(inherit gcc-mesboot1)
@@ -1325,90 +1327,90 @@ exec " gcc "/bin/" program
("make" ,make-mesboot)))
(arguments
- `(,@(substitute-keyword-arguments (package-arguments glibc-mesboot0)
- ((#:configure-flags configure-flags)
- `(let ((out (assoc-ref %outputs "out"))
- (headers (assoc-ref %build-inputs "headers")))
- (list
- (string-append "--prefix=" out)
- ;; Build RPC support. It seems we either need rpc/*.h,
- ;; or should patch
- ;; include/netdb.h:32:24: fatal error: rpc/netdb.h: No such
file or directory
- ;; "--enable-sanity-checks"
- "--disable-obsolete-rpc"
- "--host=i686-unknown-linux-gnu"
- (string-append "--with-headers=" headers "/include")
- "--enable-static-nss"
- "--with-pthread"
- "--without-cvs"
- "--without-gd"
- "--enable-add-ons=nptl")))
- ((#:make-flags make-flags)
- `(let ((bash (assoc-ref %build-inputs "bash")))
- (list (string-append "SHELL=" bash "/bin/sh")
- "install-bootstrap-headers=yes" "install-headers")))
- ((#:phases phases)
- `(modify-phases ,phases
- (replace 'setenv
- (lambda* (#:key outputs #:allow-other-keys)
- (let* ((out (assoc-ref outputs "out"))
- (headers (assoc-ref %build-inputs "headers"))
- (bash (assoc-ref %build-inputs "bash"))
- (coreutils (assoc-ref %build-inputs "coreutils"))
- (libc (assoc-ref %build-inputs "libc"))
- (gcc (assoc-ref %build-inputs "gcc"))
- (cppflags (string-append
- " -I " (getcwd)
"/nptl/sysdeps/pthread/bits"
- " -D BOOTSTRAP_GLIBC=1"))
- (cflags (string-append " -L " (getcwd)
- " -L " libc "/lib")))
- (setenv "libc_cv_friendly_stddef" "yes")
- (setenv "CONFIG_SHELL" (string-append bash "/bin/sh"))
- (setenv "SHELL" (getenv "CONFIG_SHELL"))
- (format (current-error-port) "CONFIG_SHELL=~s\n" (getenv
"CONFIG_SHELL"))
-
- (setenv "CPP" (string-append gcc "/bin/gcc -E "
cppflags))
- (setenv "CC" (string-append gcc "/bin/gcc " cppflags
cflags))
-
- ;; avoid -fstack-protector
- (setenv "libc_cv_ssp" "false")
- (substitute* "configure"
- (("/bin/pwd") (string-append coreutils "/bin/pwd")))
- (setenv "C_INCLUDE_PATH" (string-append libc "/include"
- headers
"/include"))
- (setenv "LIBRARY_PATH" (string-append libc "/lib")))))
- (replace 'install
- (lambda* (#:key outputs make-flags #:allow-other-keys)
- (let ((kernel-headers (assoc-ref %build-inputs
"kernel-headers"))
- (out (assoc-ref outputs "out")))
- (and (apply invoke "make" make-flags)
- (copy-recursively kernel-headers out)
- #t))))
- (replace 'configure
- (lambda* (#:key configure-flags #:allow-other-keys)
- (format (current-error-port) "running ../configure ~a\n"
(string-join configure-flags))
- (mkdir-p "build")
- (chdir "build")
- (apply invoke "../configure" configure-flags)))
- (add-after 'configure 'remove-sunrpc
- (lambda _
- (invoke "make" (string-append (getcwd) "/sysd-sorted" )
- (string-append "SHELL=" (getenv "CONFIG_SHELL")))
- (substitute* "sysd-sorted"
- ((" sunrpc") " ")
- ((" nis") " "))
- ;; 'rpcgen' needs native libc headers to be built.
- ;; (let ((libc (assoc-ref %build-inputs "libc")))
- ;; (substitute* "../sunrpc/Makefile"
- ;; (("sunrpc-CPPFLAGS =.*")
- ;; (string-append "sunrpc-CPPFLAGS ="
- ;; " -I" libc "/include\n"))))
- (substitute* "../Makefile"
- (("^SHELL := /bin/sh") (string-append "SHELL := "
(getenv "CONFIG_SHELL"))))
- (substitute* "../Makeconfig"
- (("^SHELL := /bin/sh") (string-append "SHELL := "
(getenv "CONFIG_SHELL"))))
- (substitute* "../elf/Makefile"
- (("^SHELL := /bin/sh") (string-append "SHELL := "
(getenv "CONFIG_SHELL"))))))))))))))
+ (substitute-keyword-arguments (package-arguments glibc-mesboot0)
+ ((#:configure-flags configure-flags)
+ `(let ((out (assoc-ref %outputs "out"))
+ (headers (assoc-ref %build-inputs "headers")))
+ (list
+ (string-append "--prefix=" out)
+ ;; Build RPC support. It seems we either need rpc/*.h,
+ ;; or should patch
+ ;; include/netdb.h:32:24: fatal error: rpc/netdb.h: No such file
or directory
+ ;; "--enable-sanity-checks"
+ "--disable-obsolete-rpc"
+ "--host=i686-unknown-linux-gnu"
+ (string-append "--with-headers=" headers "/include")
+ "--enable-static-nss"
+ "--with-pthread"
+ "--without-cvs"
+ "--without-gd"
+ "--enable-add-ons=nptl")))
+ ((#:make-flags make-flags)
+ `(let ((bash (assoc-ref %build-inputs "bash")))
+ (list (string-append "SHELL=" bash "/bin/sh")
+ "install-bootstrap-headers=yes" "install-headers")))
+ ((#:phases phases)
+ `(modify-phases ,phases
+ (replace 'setenv
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (headers (assoc-ref %build-inputs "headers"))
+ (bash (assoc-ref %build-inputs "bash"))
+ (coreutils (assoc-ref %build-inputs "coreutils"))
+ (libc (assoc-ref %build-inputs "libc"))
+ (gcc (assoc-ref %build-inputs "gcc"))
+ (cppflags (string-append
+ " -I " (getcwd) "/nptl/sysdeps/pthread/bits"
+ " -D BOOTSTRAP_GLIBC=1"))
+ (cflags (string-append " -L " (getcwd)
+ " -L " libc "/lib")))
+ (setenv "libc_cv_friendly_stddef" "yes")
+ (setenv "CONFIG_SHELL" (string-append bash "/bin/sh"))
+ (setenv "SHELL" (getenv "CONFIG_SHELL"))
+ (format (current-error-port) "CONFIG_SHELL=~s\n" (getenv
"CONFIG_SHELL"))
+
+ (setenv "CPP" (string-append gcc "/bin/gcc -E " cppflags))
+ (setenv "CC" (string-append gcc "/bin/gcc " cppflags cflags))
+
+ ;; avoid -fstack-protector
+ (setenv "libc_cv_ssp" "false")
+ (substitute* "configure"
+ (("/bin/pwd") (string-append coreutils "/bin/pwd")))
+ (setenv "C_INCLUDE_PATH" (string-append libc "/include"
+ headers "/include"))
+ (setenv "LIBRARY_PATH" (string-append libc "/lib")))))
+ (replace 'install
+ (lambda* (#:key outputs make-flags #:allow-other-keys)
+ (let ((kernel-headers (assoc-ref %build-inputs
"kernel-headers"))
+ (out (assoc-ref outputs "out")))
+ (and (apply invoke "make" make-flags)
+ (copy-recursively kernel-headers out)
+ #t))))
+ (replace 'configure
+ (lambda* (#:key configure-flags #:allow-other-keys)
+ (format (current-error-port) "running ../configure ~a\n"
(string-join configure-flags))
+ (mkdir-p "build")
+ (chdir "build")
+ (apply invoke "../configure" configure-flags)))
+ (add-after 'configure 'remove-sunrpc
+ (lambda _
+ (invoke "make" (string-append (getcwd) "/sysd-sorted" )
+ (string-append "SHELL=" (getenv "CONFIG_SHELL")))
+ (substitute* "sysd-sorted"
+ ((" sunrpc") " ")
+ ((" nis") " "))
+ ;; 'rpcgen' needs native libc headers to be built.
+ ;; (let ((libc (assoc-ref %build-inputs "libc")))
+ ;; (substitute* "../sunrpc/Makefile"
+ ;; (("sunrpc-CPPFLAGS =.*")
+ ;; (string-append "sunrpc-CPPFLAGS ="
+ ;; " -I" libc "/include\n"))))
+ (substitute* "../Makefile"
+ (("^SHELL := /bin/sh") (string-append "SHELL := " (getenv
"CONFIG_SHELL"))))
+ (substitute* "../Makeconfig"
+ (("^SHELL := /bin/sh") (string-append "SHELL := " (getenv
"CONFIG_SHELL"))))
+ (substitute* "../elf/Makefile"
+ (("^SHELL := /bin/sh") (string-append "SHELL := " (getenv
"CONFIG_SHELL")))))))))))))
(define glibc-mesboot
(package-with-bootstrap-guile
@@ -1558,6 +1560,8 @@ exec " gcc "/bin/" program
#t)))))))))))
(define gcc-mesboot-wrapper
+ ;; We need this so gcc-mesboot can be used to create shared binaries that
+ ;; have the correct interpreter and runpath to libc.
(package-with-bootstrap-guile
(package
(inherit gcc-mesboot1-wrapper)
@@ -1595,11 +1599,11 @@ exec " gcc "/bin/" program
"/bin/sh"))
(setenv "CC" "tcc -static")
(setenv "CPP" "tcc -E")
- (zero?
- (system* "./configure"
- (string-append "--prefix=" out))))))))))))
+ (invoke "./configure" (string-append "--prefix=" out)))))))))))
(define (%bootstrap-inputs+toolchain)
+ ;; The traditional bootstrap-inputs. For the i686-linux Reduced Binary Seed
+ ;; the actual reduced set, with now-bootstrapped toolchain.
(append (match (%current-system)
("i686-linux" `(("libc" ,glibc-mesboot)
("binutils" ,binutils-mesboot)