[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
21/58: gnu: commencement: glibc-mesboot0: Use Gash instead of coretutils
From: |
guix-commits |
Subject: |
21/58: gnu: commencement: glibc-mesboot0: Use Gash instead of coretutils&co. |
Date: |
Thu, 6 Feb 2020 17:52:17 -0500 (EST) |
janneke pushed a commit to branch wip-bootstrap
in repository guix.
commit 7e12996bc9056efd6d55c17a93607ece4ed2c476
Author: Jan Nieuwenhuizen <address@hidden>
AuthorDate: Sun Oct 6 21:19:35 2019 +0200
gnu: commencement: glibc-mesboot0: Use Gash instead of coretutils&co.
* gnu/packages/commencement.scm (glibc-mesboot0): Use Gash instead of
coretutils&co.
---
gnu/packages/commencement.scm | 101 +++++++++++++--------
.../patches/glibc-bootstrap-system-2.2.5.patch | 30 ++++++
2 files changed, 95 insertions(+), 36 deletions(-)
diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index 4902dea..c2d6d81 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -1481,33 +1481,31 @@ ac_cv_c_float_format='IEEE (little-endian)'
(inherit glibc)
(name "glibc-mesboot0")
(version "2.2.5")
- (source (bootstrap-origin
- (origin
- (method url-fetch)
- (uri (string-append "mirror://gnu/glibc/glibc-"
- version
- ".tar.gz"))
- (patches (search-patches "glibc-boot-2.2.5.patch"))
- (sha256
- (base32
- "1vl48i16gx6h68whjyhgnn1s57vqq32f9ygfa2fls7pdkbsqvp2q")))))
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "mirror://gnu/glibc/glibc-"
+ version
+ ".tar.gz"))
+ ;; Patch needs XZ
+ ;; (patches (search-patches "glibc-boot-2.2.5.patch"))
+ (sha256
+ (base32
+ "1vl48i16gx6h68whjyhgnn1s57vqq32f9ygfa2fls7pdkbsqvp2q"))))
(supported-systems '("i686-linux" "x86_64-linux"))
(inputs '())
(propagated-inputs '())
- (native-inputs `(("binutils" ,binutils-mesboot0)
- ("gcc" ,gcc-core-mesboot0)
-
- ("bash" ,%bootstrap-coreutils&co)
- ("coreutils" ,%bootstrap-coreutils&co)
- ("diffutils" ,diffutils-mesboot)
+ (native-inputs `(("boot-patch" ,(search-patch "glibc-boot-2.2.5.patch"))
+ ("system-patch" ,(search-patch
"glibc-bootstrap-system-2.2.5.patch"))
("headers" ,mesboot-headers)
- ("make" ,make-mesboot0)))
+ ,@(%boot-mesboot-core-inputs)
+ ("gash" ,gash-boot)))
(outputs '("out"))
(arguments
`(#:implicit-inputs? #f
#:guile ,%bootstrap-guile
#:tests? #f
#:strip-binaries? #f
+ #:validate-runpath? #f ; no dynamic executables
#:parallel-build? #f ; gcc-2.95.3 ICEs on massively parallel builds
#:make-flags (list (string-append
"SHELL="
@@ -1516,25 +1514,31 @@ ac_cv_c_float_format='IEEE (little-endian)'
#:configure-flags
(let ((out (assoc-ref %outputs "out"))
(headers (assoc-ref %build-inputs "headers")))
- (list
- "--disable-shared"
- "--enable-static"
- "--disable-sanity-checks"
- "--build=i686-unknown-linux-gnu"
- "--host=i686-unknown-linux-gnu"
- (string-append "--with-headers=" headers "/include")
- "--enable-static-nss"
- "--without-__thread"
- "--without-cvs"
- "--without-gd"
- "--without-tls"
- (string-append "--prefix=" out)))
+ `("--disable-shared"
+ "--enable-static"
+ "--disable-sanity-checks"
+ "--build=i686-unknown-linux-gnu"
+ "--host=i686-unknown-linux-gnu"
+ ,(string-append "--with-headers=" headers "/include")
+ "--enable-static-nss"
+ "--without-__thread"
+ "--without-cvs"
+ "--without-gd"
+ "--without-tls"
+ ,(string-append "--prefix=" out)))
#:phases
(modify-phases %standard-phases
+ (add-after 'unpack 'apply-boot-patch
+ (lambda* (#:key inputs #:allow-other-keys)
+ (and (let ((patch (assoc-ref inputs "boot-patch")))
+ (invoke "patch" "--force" "-p1" "-i" patch))
+ (let ((patch (assoc-ref inputs "system-patch")))
+ (invoke "patch" "--force" "-p1" "-i" patch)))))
(add-before 'configure 'setenv
(lambda* (#:key outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
(bash (assoc-ref %build-inputs "bash"))
+ (shell (string-append bash "/bin/bash"))
(gcc (assoc-ref %build-inputs "gcc"))
(headers (assoc-ref %build-inputs "headers"))
(cppflags (string-append
@@ -1542,18 +1546,43 @@ ac_cv_c_float_format='IEEE (little-endian)'
" -D MES_BOOTSTRAP=1"
" -D BOOTSTRAP_GLIBC=1"))
(cflags (string-append " -L " (getcwd))))
- (setenv "CONFIG_SHELL" (string-append bash "/bin/sh"))
- (setenv "SHELL" (getenv "CONFIG_SHELL"))
+ (setenv "CONFIG_SHELL" shell)
+ (setenv "SHELL" shell)
(setenv "CPP" (string-append gcc "/bin/gcc -E " cppflags))
(setenv "CC" (string-append gcc "/bin/gcc " cppflags cflags))
#t)))
- ;; glibc-2.2.5 needs a more classic invocation of configure
- ;; configure: warning:
CONFIG_SHELL=/gnu/store/…-bash-minimal-4.4.12/bin/bash: invalid host type
- (replace 'configure
+ (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))
- (apply invoke "./configure" configure-flags))))))))
+ (apply invoke "./configure" configure-flags)))
+ (add-after 'configure 'fixup-configure
+ (lambda _
+ (let* ((out (assoc-ref %outputs "out"))
+ (bash (assoc-ref %build-inputs "bash"))
+ (shell (string-append bash "/bin/bash"))
+ (gash (assoc-ref %build-inputs "gash"))
+ (gash (string-append gash "/bin/gash")))
+ (substitute* "config.make"
+ (("INSTALL = scripts/") "INSTALL = $(..)./scripts/"))
+ (substitute* "config.make"
+ (("INSTALL = scripts/") "INSTALL = $(..)./scripts/")
+ (("BASH = ") (string-append
+ "SHELL = " shell "
+BASH = ")))
+ ;; XXX: make-syscalls.sh does not run correctly with
+ ;; bash-mesboot0, producing a wrong sysd-syscalls.
+
+ ;; This leads to posix/uname.c getting compiled where it
+ ;; shouldn't:
+
+ ;; ../sysdeps/generic/uname.c:25: config-name.h: error 02
+ (substitute* "sysdeps/unix/make-syscalls.sh"
+ (("#!/gnu/store.*/bin/bash") (string-append "#! " gash)))
+
+ (substitute* "sysdeps/unix/Makefile"
+ ((" [{] [$][(]SHELL[)]") (string-append " { " gash))))
+ #t)))))))
(define gcc-mesboot0
(package
diff --git a/gnu/packages/patches/glibc-bootstrap-system-2.2.5.patch
b/gnu/packages/patches/glibc-bootstrap-system-2.2.5.patch
new file mode 100644
index 0000000..d11fc00
--- /dev/null
+++ b/gnu/packages/patches/glibc-bootstrap-system-2.2.5.patch
@@ -0,0 +1,30 @@
+We want to allow builds in chroots that lack /bin/sh. Thus, system(3)
+and popen(3) need to be tweaked to use the right shell. For the bootstrap
+glibc, we just use whatever `sh' can be found in $PATH. The final glibc
+instead uses the hard-coded absolute file name of `bash'.
+
+--- a/sysdeps/posix/system.c
++++ b/sysdeps/posix/system.c
+@@ -106,8 +106,8 @@ do_system (const char *line)
+ (void) UNBLOCK;
+
+ /* Exec the shell. */
+- (void) __execve (SHELL_PATH, (char *const *) new_argv, __environ);
++ (void) execvp (SHELL_NAME, (char *const *) new_argv);
+ _exit (127);
+ }
+ else if (pid < (pid_t) 0)
+ /* The fork failed. */
+--- a/libio/iopopen.c
++++ b/libio/iopopen.c
+@@ -170,7 +170,7 @@ _IO_new_proc_open (fp, command, mode)
+ for (p = proc_file_chain; p; p = p->next)
+ _IO_close (_IO_fileno ((_IO_FILE *) p));
+
+- _IO_execl ("/bin/sh", "sh", "-c", command, (char *) 0);
++ execlp ("sh", "sh", "-c", command, (char *) 0);
+ _IO__exit (127);
+ }
+ _IO_close (child_end);
+
+
- 22/58: gnu: commencement: gcc-mesboot0: Use Gash instead of coretutils&co., (continued)
- 22/58: gnu: commencement: gcc-mesboot0: Use Gash instead of coretutils&co., guix-commits, 2020/02/06
- 35/58: gnu: commencement: binutils-mesboot: Use Gash instead of coreutils&co., guix-commits, 2020/02/06
- 41/58: gnu: commencement: Add coreutils-mesboot., guix-commits, 2020/02/06
- 53/58: gnu: commencement: gnu-make-mesboot0: Rename from make-mesboot0., guix-commits, 2020/02/06
- 57/58: gnu: commencement: mes-boot: Update to 0.22., guix-commits, 2020/02/06
- 17/58: gnu: commencement: binutils-mesboot0: Use Gash instead of coretutils&co., guix-commits, 2020/02/06
- 23/58: gnu: commencement: Add tar-mesboot., guix-commits, 2020/02/06
- 26/58: gnu: commencement: Add coreutils-mesboot0., guix-commits, 2020/02/06
- 25/58: gnu: commencement: Add binutils-mesboot1., guix-commits, 2020/02/06
- 15/58: gnu: commencement: Add patch-mesboot., guix-commits, 2020/02/06
- 21/58: gnu: commencement: glibc-mesboot0: Use Gash instead of coretutils&co.,
guix-commits <=
- 51/58: gnu: commencement: %bootstrap-tarballs: Remove %bootstrap-binaries-tarball., guix-commits, 2020/02/06
- 44/58: gnu: commencement: Add gawk-boot0., guix-commits, 2020/02/06
- 31/58: gnu: commencement: Add bash-mesboot., guix-commits, 2020/02/06
- 30/58: gnu: commencement: Add gcc-core-mesboot1., guix-commits, 2020/02/06
- 36/58: gnu: commencement: glibc-headers-mesboot: Use Gash instead of coreutils&co., guix-commits, 2020/02/06
- 37/58: gnu: commencement: glibc-mesboot: Use Gash instead of coreutils&co., guix-commits, 2020/02/06
- 18/58: gnu: commencement: gcc-core-mesboot0: Use Gash instead of coretutils&co., guix-commits, 2020/02/06
- 24/58: gnu: commencement: Add grep-mesboot., guix-commits, 2020/02/06
- 32/58: gnu: commencement: Add gcc-mesboot1: Use Gash instead of coreutils&co., guix-commits, 2020/02/06
- 34/58: gnu: commencement: Add hello-mesboot., guix-commits, 2020/02/06