gnu: commencement: glibc-mesboot0: Use Gash instead of coretutils&co.
* gnu/packages/commencement.scm (glibc-mesboot0): Use Gash instead of coretutils&co.
This commit is contained in:
parent
562c6e3c52
commit
f6b911fb5f
@ -1482,33 +1482,31 @@ ac_cv_c_float_format='IEEE (little-endian)'
|
|||||||
(inherit glibc)
|
(inherit glibc)
|
||||||
(name "glibc-mesboot0")
|
(name "glibc-mesboot0")
|
||||||
(version "2.2.5")
|
(version "2.2.5")
|
||||||
(source (bootstrap-origin
|
(source (origin
|
||||||
(origin
|
(method url-fetch)
|
||||||
(method url-fetch)
|
(uri (string-append "mirror://gnu/glibc/glibc-"
|
||||||
(uri (string-append "mirror://gnu/glibc/glibc-"
|
version
|
||||||
version
|
".tar.gz"))
|
||||||
".tar.gz"))
|
;; Patch needs XZ
|
||||||
(patches (search-patches "glibc-boot-2.2.5.patch"))
|
;; (patches (search-patches "glibc-boot-2.2.5.patch"))
|
||||||
(sha256
|
(sha256
|
||||||
(base32
|
(base32
|
||||||
"1vl48i16gx6h68whjyhgnn1s57vqq32f9ygfa2fls7pdkbsqvp2q")))))
|
"1vl48i16gx6h68whjyhgnn1s57vqq32f9ygfa2fls7pdkbsqvp2q"))))
|
||||||
(supported-systems '("i686-linux" "x86_64-linux"))
|
(supported-systems '("i686-linux" "x86_64-linux"))
|
||||||
(inputs '())
|
(inputs '())
|
||||||
(propagated-inputs '())
|
(propagated-inputs '())
|
||||||
(native-inputs `(("binutils" ,binutils-mesboot0)
|
(native-inputs `(("boot-patch" ,(search-patch "glibc-boot-2.2.5.patch"))
|
||||||
("gcc" ,gcc-core-mesboot0)
|
("system-patch" ,(search-patch "glibc-bootstrap-system-2.2.5.patch"))
|
||||||
|
|
||||||
("bash" ,%bootstrap-coreutils&co)
|
|
||||||
("coreutils" ,%bootstrap-coreutils&co)
|
|
||||||
("diffutils" ,diffutils-mesboot)
|
|
||||||
("headers" ,mesboot-headers)
|
("headers" ,mesboot-headers)
|
||||||
("make" ,make-mesboot0)))
|
,@(%boot-mesboot-core-inputs)
|
||||||
|
("gash" ,gash-boot)))
|
||||||
(outputs '("out"))
|
(outputs '("out"))
|
||||||
(arguments
|
(arguments
|
||||||
`(#:implicit-inputs? #f
|
`(#:implicit-inputs? #f
|
||||||
#:guile ,%bootstrap-guile
|
#:guile ,%bootstrap-guile
|
||||||
#:tests? #f
|
#:tests? #f
|
||||||
#:strip-binaries? #f
|
#:strip-binaries? #f
|
||||||
|
#:validate-runpath? #f ; no dynamic executables
|
||||||
#:parallel-build? #f ; gcc-2.95.3 ICEs on massively parallel builds
|
#:parallel-build? #f ; gcc-2.95.3 ICEs on massively parallel builds
|
||||||
#:make-flags (list (string-append
|
#:make-flags (list (string-append
|
||||||
"SHELL="
|
"SHELL="
|
||||||
@ -1517,25 +1515,31 @@ ac_cv_c_float_format='IEEE (little-endian)'
|
|||||||
#:configure-flags
|
#:configure-flags
|
||||||
(let ((out (assoc-ref %outputs "out"))
|
(let ((out (assoc-ref %outputs "out"))
|
||||||
(headers (assoc-ref %build-inputs "headers")))
|
(headers (assoc-ref %build-inputs "headers")))
|
||||||
(list
|
`("--disable-shared"
|
||||||
"--disable-shared"
|
"--enable-static"
|
||||||
"--enable-static"
|
"--disable-sanity-checks"
|
||||||
"--disable-sanity-checks"
|
"--build=i686-unknown-linux-gnu"
|
||||||
"--build=i686-unknown-linux-gnu"
|
"--host=i686-unknown-linux-gnu"
|
||||||
"--host=i686-unknown-linux-gnu"
|
,(string-append "--with-headers=" headers "/include")
|
||||||
(string-append "--with-headers=" headers "/include")
|
"--enable-static-nss"
|
||||||
"--enable-static-nss"
|
"--without-__thread"
|
||||||
"--without-__thread"
|
"--without-cvs"
|
||||||
"--without-cvs"
|
"--without-gd"
|
||||||
"--without-gd"
|
"--without-tls"
|
||||||
"--without-tls"
|
,(string-append "--prefix=" out)))
|
||||||
(string-append "--prefix=" out)))
|
|
||||||
#:phases
|
#:phases
|
||||||
(modify-phases %standard-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
|
(add-before 'configure 'setenv
|
||||||
(lambda* (#:key outputs #:allow-other-keys)
|
(lambda* (#:key outputs #:allow-other-keys)
|
||||||
(let* ((out (assoc-ref outputs "out"))
|
(let* ((out (assoc-ref outputs "out"))
|
||||||
(bash (assoc-ref %build-inputs "bash"))
|
(bash (assoc-ref %build-inputs "bash"))
|
||||||
|
(shell (string-append bash "/bin/bash"))
|
||||||
(gcc (assoc-ref %build-inputs "gcc"))
|
(gcc (assoc-ref %build-inputs "gcc"))
|
||||||
(headers (assoc-ref %build-inputs "headers"))
|
(headers (assoc-ref %build-inputs "headers"))
|
||||||
(cppflags (string-append
|
(cppflags (string-append
|
||||||
@ -1543,18 +1547,43 @@ ac_cv_c_float_format='IEEE (little-endian)'
|
|||||||
" -D MES_BOOTSTRAP=1"
|
" -D MES_BOOTSTRAP=1"
|
||||||
" -D BOOTSTRAP_GLIBC=1"))
|
" -D BOOTSTRAP_GLIBC=1"))
|
||||||
(cflags (string-append " -L " (getcwd))))
|
(cflags (string-append " -L " (getcwd))))
|
||||||
(setenv "CONFIG_SHELL" (string-append bash "/bin/sh"))
|
(setenv "CONFIG_SHELL" shell)
|
||||||
(setenv "SHELL" (getenv "CONFIG_SHELL"))
|
(setenv "SHELL" shell)
|
||||||
(setenv "CPP" (string-append gcc "/bin/gcc -E " cppflags))
|
(setenv "CPP" (string-append gcc "/bin/gcc -E " cppflags))
|
||||||
(setenv "CC" (string-append gcc "/bin/gcc " cppflags cflags))
|
(setenv "CC" (string-append gcc "/bin/gcc " cppflags cflags))
|
||||||
#t)))
|
#t)))
|
||||||
;; glibc-2.2.5 needs a more classic invocation of configure
|
(replace 'configure ; needs classic invocation of configure
|
||||||
;; configure: warning: CONFIG_SHELL=/gnu/store/…-bash-minimal-4.4.12/bin/bash: invalid host type
|
|
||||||
(replace 'configure
|
|
||||||
(lambda* (#:key configure-flags #:allow-other-keys)
|
(lambda* (#:key configure-flags #:allow-other-keys)
|
||||||
(format (current-error-port)
|
(format (current-error-port)
|
||||||
"running ./configure ~a\n" (string-join configure-flags))
|
"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
|
(define gcc-mesboot0
|
||||||
(package
|
(package
|
||||||
|
30
gnu/packages/patches/glibc-bootstrap-system-2.2.5.patch
Normal file
30
gnu/packages/patches/glibc-bootstrap-system-2.2.5.patch
Normal file
@ -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);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user