From b2fd8f63679aa4f244c36fdca62f23c00b8eded9 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Wed, 26 Apr 2017 13:03:48 +0200 Subject: gnu: glibc/linux: Fix runtime crashes on i686 systems. * gnu/packages/patches/glibc-memchr-overflow-i686.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. * gnu/packages/commencement.scm (glibc-final-with-bootstrap-bash)[native-inputs]: Add the patch conditionally for i686 systems. * gnu/packages/base.scm (glibc/linux)[native-inputs]: Add the patch conditionally for i686 systems. [arguments]: Apply the patch conditionally on i686 systems. --- gnu/packages/base.scm | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'gnu/packages/base.scm') diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm index 9fcca45a54..6dc9e97c34 100644 --- a/gnu/packages/base.scm +++ b/gnu/packages/base.scm @@ -666,6 +666,16 @@ store.") ;; 4.7.1. ((" -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))) + `(zero? (system* "patch" "-p1" "--force" + "--input" + (assoc-ref native-inputs + "glibc-memchr-overflow-i686.patch"))) + '()) + ;; Have `system' use that Bash. (substitute* "sysdeps/posix/system.c" (("#define[[:blank:]]+SHELL_PATH.*$") @@ -709,7 +719,15 @@ store.") ;; install the message catalogs, with 'msgfmt'. (native-inputs `(("texinfo" ,texinfo) ("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 ;; Search path for packages that provide locale data. This is useful -- cgit v1.2.3