gnu: glibc: Move i686 patch to source field.
This is a rewrite of changes introduced by commitsb2fd8f6367
,c2e4f14ac8
,441e99d433
andd03b34cf19
. * gnu/packages/base.scm (glibc/linux)[source]: Add i686 patch. [arguments]: Remove conditional patch application from build phase. [native-inputs]: Remove patch. (glibc/hurd)[arguments]: Inherit pre-configure build phase from glibc/linux. * gnu/packages/commencement.scm (glibc-final-with-bootstrap-bash)[native-inputs]: Remove patch.
This commit is contained in:
parent
4953c33316
commit
ff647c3d38
|
@ -531,7 +531,8 @@ store.")
|
||||||
(modules '((guix build utils)))
|
(modules '((guix build utils)))
|
||||||
(patches (search-patches "glibc-ldd-x86_64.patch"
|
(patches (search-patches "glibc-ldd-x86_64.patch"
|
||||||
"glibc-versioned-locpath.patch"
|
"glibc-versioned-locpath.patch"
|
||||||
"glibc-o-largefile.patch"))))
|
"glibc-o-largefile.patch"
|
||||||
|
"glibc-memchr-overflow-i686.patch"))))
|
||||||
(build-system gnu-build-system)
|
(build-system gnu-build-system)
|
||||||
|
|
||||||
;; Glibc's <limits.h> refers to <linux/limit.h>, for instance, so glibc
|
;; Glibc's <limits.h> refers to <linux/limit.h>, for instance, so glibc
|
||||||
|
@ -618,19 +619,6 @@ store.")
|
||||||
;; 4.7.1.
|
;; 4.7.1.
|
||||||
((" -lgcc_s") ""))
|
((" -lgcc_s") ""))
|
||||||
|
|
||||||
;; Apply patch only on i686.
|
|
||||||
;; TODO: Move the patch to 'patches' in the next update cycle.
|
|
||||||
,@(if (string-prefix? "i686" (or (%current-target-system)
|
|
||||||
(%current-system)))
|
|
||||||
`((unless (zero? (system* "patch" "-p1" "--force"
|
|
||||||
"--input"
|
|
||||||
(or (assoc-ref native-inputs
|
|
||||||
"glibc-memchr-overflow-i686.patch")
|
|
||||||
(assoc-ref inputs
|
|
||||||
"glibc-memchr-overflow-i686.patch"))))
|
|
||||||
(error "patch failed for glibc-memchr-overflow-i686.patch")))
|
|
||||||
'())
|
|
||||||
|
|
||||||
;; Have `system' use that Bash.
|
;; Have `system' use that Bash.
|
||||||
(substitute* "sysdeps/posix/system.c"
|
(substitute* "sysdeps/posix/system.c"
|
||||||
(("#define[[:blank:]]+SHELL_PATH.*$")
|
(("#define[[:blank:]]+SHELL_PATH.*$")
|
||||||
|
@ -674,15 +662,7 @@ store.")
|
||||||
;; install the message catalogs, with 'msgfmt'.
|
;; install the message catalogs, with 'msgfmt'.
|
||||||
(native-inputs `(("texinfo" ,texinfo)
|
(native-inputs `(("texinfo" ,texinfo)
|
||||||
("perl" ,perl)
|
("perl" ,perl)
|
||||||
("gettext" ,gettext-minimal)
|
("gettext" ,gettext-minimal)))
|
||||||
|
|
||||||
;; Apply this patch only on i686 to avoid a full rebuild.
|
|
||||||
;; TODO: Move to 'patches' in the next update cycle.
|
|
||||||
,@(if (string-prefix? "i686" (or (%current-target-system)
|
|
||||||
(%current-system)))
|
|
||||||
`(("glibc-memchr-overflow-i686.patch"
|
|
||||||
,(search-patch "glibc-memchr-overflow-i686.patch")))
|
|
||||||
'())))
|
|
||||||
|
|
||||||
(native-search-paths
|
(native-search-paths
|
||||||
;; Search path for packages that provide locale data. This is useful
|
;; Search path for packages that provide locale data. This is useful
|
||||||
|
@ -731,71 +711,6 @@ with the Linux kernel.")
|
||||||
;; Add libmachuser.so and libhurduser.so to libc.so's search path.
|
;; Add libmachuser.so and libhurduser.so to libc.so's search path.
|
||||||
;; See <http://lists.gnu.org/archive/html/bug-hurd/2015-07/msg00051.html>.
|
;; See <http://lists.gnu.org/archive/html/bug-hurd/2015-07/msg00051.html>.
|
||||||
`(modify-phases ,original-phases
|
`(modify-phases ,original-phases
|
||||||
;; TODO: This is almost an exact copy of the phase of the same name
|
|
||||||
;; in glibc/linux. The only difference is that the i686 patch is
|
|
||||||
;; not applied here. In the next update cycle the patch moves to
|
|
||||||
;; the patches field and this overwritten phase won't be needed any
|
|
||||||
;; more.
|
|
||||||
(replace 'pre-configure
|
|
||||||
(lambda* (#:key inputs native-inputs outputs
|
|
||||||
#:allow-other-keys)
|
|
||||||
(let* ((out (assoc-ref outputs "out"))
|
|
||||||
(bin (string-append out "/bin"))
|
|
||||||
;; FIXME: Normally we would look it up only in INPUTS
|
|
||||||
;; but cross-base uses it as a native input.
|
|
||||||
(bash (or (assoc-ref inputs "static-bash")
|
|
||||||
(assoc-ref native-inputs "static-bash"))))
|
|
||||||
;; Install the rpc data base file under `$out/etc/rpc'.
|
|
||||||
;; FIXME: Use installFlags = [ "sysconfdir=$(out)/etc" ];
|
|
||||||
(substitute* "sunrpc/Makefile"
|
|
||||||
(("^\\$\\(inst_sysconfdir\\)/rpc(.*)$" _ suffix)
|
|
||||||
(string-append out "/etc/rpc" suffix "\n"))
|
|
||||||
(("^install-others =.*$")
|
|
||||||
(string-append "install-others = " out "/etc/rpc\n")))
|
|
||||||
|
|
||||||
(substitute* "Makeconfig"
|
|
||||||
;; According to
|
|
||||||
;; <http://www.linuxfromscratch.org/lfs/view/stable/chapter05/glibc.html>,
|
|
||||||
;; linking against libgcc_s is not needed with GCC
|
|
||||||
;; 4.7.1.
|
|
||||||
((" -lgcc_s") ""))
|
|
||||||
|
|
||||||
;; Have `system' use that Bash.
|
|
||||||
(substitute* "sysdeps/posix/system.c"
|
|
||||||
(("#define[[:blank:]]+SHELL_PATH.*$")
|
|
||||||
(format #f "#define SHELL_PATH \"~a/bin/bash\"\n"
|
|
||||||
bash)))
|
|
||||||
|
|
||||||
;; Same for `popen'.
|
|
||||||
(substitute* "libio/iopopen.c"
|
|
||||||
(("/bin/sh")
|
|
||||||
(string-append bash "/bin/sh")))
|
|
||||||
|
|
||||||
;; Same for the shell used by the 'exec' functions for
|
|
||||||
;; scripts that lack a shebang.
|
|
||||||
(substitute* (find-files "." "^paths\\.h$")
|
|
||||||
(("#define[[:blank:]]+_PATH_BSHELL[[:blank:]].*$")
|
|
||||||
(string-append "#define _PATH_BSHELL \""
|
|
||||||
bash "/bin/sh\"\n")))
|
|
||||||
|
|
||||||
;; Nscd uses __DATE__ and __TIME__ to create a string to
|
|
||||||
;; make sure the client and server come from the same
|
|
||||||
;; libc. Use something deterministic instead.
|
|
||||||
(substitute* "nscd/nscd_stat.c"
|
|
||||||
(("static const char compilation\\[21\\] =.*$")
|
|
||||||
(string-append
|
|
||||||
"static const char compilation[21] = \""
|
|
||||||
(string-take (basename out) 20) "\";\n")))
|
|
||||||
|
|
||||||
;; Make sure we don't retain a reference to the
|
|
||||||
;; bootstrap Perl.
|
|
||||||
(substitute* "malloc/mtrace.pl"
|
|
||||||
(("^#!.*")
|
|
||||||
;; The shebang can be omitted, because there's the
|
|
||||||
;; "bilingual" eval/exec magic at the top of the file.
|
|
||||||
"")
|
|
||||||
(("exec @PERL@")
|
|
||||||
"exec perl")))))
|
|
||||||
(add-after 'install 'augment-libc.so
|
(add-after 'install 'augment-libc.so
|
||||||
(lambda* (#:key outputs #:allow-other-keys)
|
(lambda* (#:key outputs #:allow-other-keys)
|
||||||
(let* ((out (assoc-ref outputs "out")))
|
(let* ((out (assoc-ref outputs "out")))
|
||||||
|
|
|
@ -510,14 +510,7 @@ the bootstrap environment."
|
||||||
(propagated-inputs `(("kernel-headers" ,(kernel-headers-boot0))))
|
(propagated-inputs `(("kernel-headers" ,(kernel-headers-boot0))))
|
||||||
(native-inputs
|
(native-inputs
|
||||||
`(("texinfo" ,texinfo-boot0)
|
`(("texinfo" ,texinfo-boot0)
|
||||||
("perl" ,perl-boot0)
|
("perl" ,perl-boot0)))
|
||||||
;; Apply this patch only on i686 to avoid a full rebuild.
|
|
||||||
;; TODO: Remove in the next update cycle.
|
|
||||||
,@(if (string-prefix? "i686" (or (%current-target-system)
|
|
||||||
(%current-system)))
|
|
||||||
`(("glibc-memchr-overflow-i686.patch"
|
|
||||||
,(search-patch "glibc-memchr-overflow-i686.patch")))
|
|
||||||
'())))
|
|
||||||
(inputs
|
(inputs
|
||||||
`(;; The boot inputs. That includes the bootstrap libc. We don't want
|
`(;; The boot inputs. That includes the bootstrap libc. We don't want
|
||||||
;; it in $CPATH, hence the 'pre-configure' phase above.
|
;; it in $CPATH, hence the 'pre-configure' phase above.
|
||||||
|
|
Loading…
Reference in New Issue