diff options
author | Mike Frysinger <vapier@gentoo.org> | 2012-10-05 05:28:59 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2012-10-05 05:28:59 +0000 |
commit | 7758b76d397f0c91d04259d55d7a8f77f6fa8a4a (patch) | |
tree | 4a26f595f602b6bd3f37da55fc13b9833a460442 /sys-devel/make | |
parent | Bump (diff) | |
download | gentoo-2-7758b76d397f0c91d04259d55d7a8f77f6fa8a4a.tar.gz gentoo-2-7758b76d397f0c91d04259d55d7a8f77f6fa8a4a.tar.bz2 gentoo-2-7758b76d397f0c91d04259d55d7a8f77f6fa8a4a.zip |
Add some more fixes from upstream #431250 by Vladimir.
(Portage version: 2.2.0_alpha131/cvs/Linux x86_64)
Diffstat (limited to 'sys-devel/make')
-rw-r--r-- | sys-devel/make/ChangeLog | 9 | ||||
-rw-r--r-- | sys-devel/make/files/make-3.82-construct-command-line.patch | 71 | ||||
-rw-r--r-- | sys-devel/make/files/make-3.82-intermediate-parallel.patch | 62 | ||||
-rw-r--r-- | sys-devel/make/files/make-3.82-long-cmdline.patch | 105 | ||||
-rw-r--r-- | sys-devel/make/files/make-3.82-long-command-line.patch | 54 | ||||
-rw-r--r-- | sys-devel/make/make-3.82-r4.ebuild | 10 |
6 files changed, 201 insertions, 110 deletions
diff --git a/sys-devel/make/ChangeLog b/sys-devel/make/ChangeLog index 18e38db018cb..7151b4a966a0 100644 --- a/sys-devel/make/ChangeLog +++ b/sys-devel/make/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for sys-devel/make # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-devel/make/ChangeLog,v 1.101 2012/09/02 18:52:35 armin76 Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-devel/make/ChangeLog,v 1.102 2012/10/05 05:28:59 vapier Exp $ + + 05 Oct 2012; Mike Frysinger <vapier@gentoo.org> + +files/make-3.82-construct-command-line.patch, + +files/make-3.82-intermediate-parallel.patch, + +files/make-3.82-long-command-line.patch, -files/make-3.82-long-cmdline.patch, + make-3.82-r4.ebuild: + Add some more fixes from upstream #431250 by Vladimir. 02 Sep 2012; Raúl Porcel <armin76@gentoo.org> make-3.82-r3.ebuild: alpha/ia64/m68k/s390/sh/sparc stable wrt #419941 diff --git a/sys-devel/make/files/make-3.82-construct-command-line.patch b/sys-devel/make/files/make-3.82-construct-command-line.patch new file mode 100644 index 000000000000..c504c45291ba --- /dev/null +++ b/sys-devel/make/files/make-3.82-construct-command-line.patch @@ -0,0 +1,71 @@ +https://savannah.gnu.org/bugs/?23922 + +From 6f3684710a0f832533191f8657a57bc2fbba90ba Mon Sep 17 00:00:00 2001 +From: eliz <eliz> +Date: Sat, 7 May 2011 08:29:13 +0000 +Subject: [PATCH] job.c (construct_command_argv_internal): Don't assume + shellflags is always non-NULL. Escape-protect characters + special to the shell when copying the value of SHELL into + new_line. Fixes Savannah bug #23922. + +--- + ChangeLog | 7 +++++++ + job.c | 23 ++++++++++++++++------- + 2 files changed, 23 insertions(+), 7 deletions(-) + +diff --git a/job.c b/job.c +index 67b402d..c2ce84d 100644 +--- a/job.c ++++ b/job.c +@@ -2844,12 +2844,12 @@ construct_command_argv_internal (char *line, char **restp, char *shell, + + unsigned int shell_len = strlen (shell); + unsigned int line_len = strlen (line); +- unsigned int sflags_len = strlen (shellflags); ++ unsigned int sflags_len = shellflags ? strlen (shellflags) : 0; + char *command_ptr = NULL; /* used for batch_mode_shell mode */ + char *new_line; + + # ifdef __EMX__ /* is this necessary? */ +- if (!unixy_shell) ++ if (!unixy_shell && shellflags) + shellflags[0] = '/'; /* "/c" */ + # endif + +@@ -2911,19 +2911,28 @@ construct_command_argv_internal (char *line, char **restp, char *shell, + + new_argv = xmalloc (4 * sizeof (char *)); + new_argv[0] = xstrdup(shell); +- new_argv[1] = xstrdup(shellflags); ++ new_argv[1] = xstrdup(shellflags ? shellflags : ""); + new_argv[2] = line; + new_argv[3] = NULL; + return new_argv; + } + +- new_line = alloca (shell_len + 1 + sflags_len + 1 ++ new_line = alloca ((shell_len*2) + 1 + sflags_len + 1 + + (line_len*2) + 1); + ap = new_line; +- memcpy (ap, shell, shell_len); +- ap += shell_len; ++ /* Copy SHELL, escaping any characters special to the shell. If ++ we don't escape them, construct_command_argv_internal will ++ recursively call itself ad nauseam, or until stack overflow, ++ whichever happens first. */ ++ for (p = shell; *p != '\0'; ++p) ++ { ++ if (strchr (sh_chars, *p) != 0) ++ *(ap++) = '\\'; ++ *(ap++) = *p; ++ } + *(ap++) = ' '; +- memcpy (ap, shellflags, sflags_len); ++ if (shellflags) ++ memcpy (ap, shellflags, sflags_len); + ap += sflags_len; + *(ap++) = ' '; + command_ptr = ap; +-- +1.7.12 + diff --git a/sys-devel/make/files/make-3.82-intermediate-parallel.patch b/sys-devel/make/files/make-3.82-intermediate-parallel.patch new file mode 100644 index 000000000000..df9b8d475b95 --- /dev/null +++ b/sys-devel/make/files/make-3.82-intermediate-parallel.patch @@ -0,0 +1,62 @@ +https://savannah.gnu.org/bugs/?30653 +https://bugs.gentoo.org/431250 + +From d1ba0ee36b2bdd91434b5df90f0f4cceda7d6979 Mon Sep 17 00:00:00 2001 +From: psmith <psmith> +Date: Mon, 10 Sep 2012 02:36:05 +0000 +Subject: [PATCH] Force intermediate targets to be considered if their + non-intermediate parent needs to be remade. Fixes Savannah + bug #30653. + +--- + ChangeLog | 4 ++++ + remake.c | 4 ++++ + tests/scripts/features/parallelism | 17 +++++++++++++++++ + 3 files changed, 25 insertions(+) + +diff --git a/remake.c b/remake.c +index c0bf709..b1ddd23 100644 +--- a/remake.c ++++ b/remake.c +@@ -612,6 +612,10 @@ update_file_1 (struct file *file, unsigned int depth) + d->file->dontcare = file->dontcare; + } + ++ /* We may have already considered this file, when we didn't know ++ we'd need to update it. Force update_file() to consider it and ++ not prune it. */ ++ d->file->considered = !considered; + + dep_status |= update_file (d->file, depth); + +diff --git a/tests/scripts/features/parallelism b/tests/scripts/features/parallelism +index d4250f0..76d24a7 100644 +--- a/tests/scripts/features/parallelism ++++ b/tests/scripts/features/parallelism +@@ -214,6 +214,23 @@ rm main.x"); + rmfiles(qw(foo.y foo.y.in main.bar)); + } + ++# Ensure intermediate/secondary files are not pruned incorrectly. ++# See Savannah bug #30653 ++ ++utouch(-15, 'file2'); ++utouch(-10, 'file4'); ++utouch(-5, 'file1'); ++ ++run_make_test(q! ++.INTERMEDIATE: file3 ++file4: file3 ; @mv -f $< $@ ++file3: file2 ; touch $@ ++file2: file1 ; @touch $@ ++!, ++ '--no-print-directory -j2', "touch file3"); ++ ++#rmfiles('file1', 'file2', 'file3', 'file4'); ++ + if ($all_tests) { + # Jobserver FD handling is messed up in some way. + # Savannah bug #28189 +-- +1.7.12 + diff --git a/sys-devel/make/files/make-3.82-long-cmdline.patch b/sys-devel/make/files/make-3.82-long-cmdline.patch deleted file mode 100644 index f8a3ccc56a42..000000000000 --- a/sys-devel/make/files/make-3.82-long-cmdline.patch +++ /dev/null @@ -1,105 +0,0 @@ -http://bugs.gentoo.org/301116 -http://bugs.gentoo.org/300867 - -tweaked a little to avoid regenerating autotools, then rebased onto make-3.82 - -2009-07-29 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> - - * configure.in: Check for sys/user.h and linux/binfmts.h - headers. - * job.c: Include them if available. - (construct_command_argv_internal): When constructing the command - line with 'sh -c', use multiple arguments together with eval - expansion to evade the Linux per-argument length limit - MAX_ARG_STRLEN if it is defined. - Problem reported against Automake by Xan Lopez <xan@gnome.org>. - ---- job.c.orig 2010-01-15 18:36:53.000000000 +0200 -+++ job.c 2010-01-15 18:41:09.000000000 +0200 -@@ -29,6 +29,15 @@ - - #include <string.h> - -+#if defined(__linux__) /* defined (HAVE_LINUX_BINFMTS_H) && defined (HAVE_SYS_USER_H) */ -+#include <sys/user.h> -+#include <unistd.h> -+#ifndef PAGE_SIZE -+#define PAGE_SIZE sysconf(_SC_PAGE_SIZE) -+#endif -+#include <linux/binfmts.h> -+#endif -+ - /* Default shell to use. */ - #ifdef WINDOWS32 - #include <windows.h> -@@ -2697,6 +2702,15 @@ - argument list. */ - - unsigned int shell_len = strlen (shell); -+#ifdef MAX_ARG_STRLEN -+ static char eval_line[] = "eval\\ \\\"set\\ x\\;\\ shift\\;\\ "; -+#define ARG_NUMBER_DIGITS 5 -+#define EVAL_LEN (sizeof(eval_line)-1 + shell_len + 4 \ -+ + (7 + ARG_NUMBER_DIGITS) * 2 * line_len / (MAX_ARG_STRLEN - 2)) -+#else -+#define EVAL_LEN 0 -+#endif -+ char *args_ptr; - unsigned int line_len = strlen (line); - unsigned int sflags_len = strlen (shellflags); - char *command_ptr = NULL; /* used for batch_mode_shell mode */ -@@ -2700,7 +2700,7 @@ - } - - new_line = alloca (shell_len + 1 + sflags_len + 1 -- + (line_len*2) + 1); -+ + (line_len*2) + 1 + EVAL_LEN); - ap = new_line; - memcpy (ap, shell, shell_len); - ap += shell_len; -@@ -2712,6 +2727,30 @@ - ap += sflags_len; - *(ap++) = ' '; - command_ptr = ap; -+ -+#if !defined (WINDOWS32) && defined (MAX_ARG_STRLEN) -+ if (unixy_shell && line_len > MAX_ARG_STRLEN) -+ { -+ unsigned j; -+ memcpy (ap, eval_line, sizeof (eval_line) - 1); -+ ap += sizeof (eval_line) - 1; -+ for (j = 1; j <= 2 * line_len / (MAX_ARG_STRLEN - 2); j++) -+ ap += sprintf (ap, "\\$\\{%u\\}", j); -+ *ap++ = '\\'; -+ *ap++ = '"'; -+ *ap++ = ' '; -+ /* Copy only the first word of SHELL to $0. */ -+ for (p = shell; *p != '\0'; ++p) -+ { -+ if (isspace ((unsigned char)*p)) -+ break; -+ *ap++ = *p; -+ } -+ *ap++ = ' '; -+ } -+#endif -+ args_ptr = ap; -+ - for (p = line; *p != '\0'; ++p) - { - if (restp != NULL && *p == '\n') -@@ -2760,6 +2799,14 @@ - } - #endif - *ap++ = *p; -+ -+#if !defined (WINDOWS32) && defined (MAX_ARG_STRLEN) -+ if (unixy_shell && line_len > MAX_ARG_STRLEN && (ap - args_ptr > MAX_ARG_STRLEN - 2)) -+ { -+ *ap++ = ' '; -+ args_ptr = ap; -+ } -+#endif - } - if (ap == new_line + shell_len + sflags_len + 2) - /* Line was empty. */ diff --git a/sys-devel/make/files/make-3.82-long-command-line.patch b/sys-devel/make/files/make-3.82-long-command-line.patch new file mode 100644 index 000000000000..9266786e4da7 --- /dev/null +++ b/sys-devel/make/files/make-3.82-long-command-line.patch @@ -0,0 +1,54 @@ +https://savannah.gnu.org/bugs/?36451 + +From a95796de3a491d8acfc8ea94c217b90531161786 Mon Sep 17 00:00:00 2001 +From: psmith <psmith> +Date: Sun, 9 Sep 2012 23:25:07 +0000 +Subject: [PATCH] Keep the command line on the heap to avoid stack overflow. + Fixes Savannah bug #36451. + +--- + ChangeLog | 3 +++ + job.c | 13 +++++++++---- + 2 files changed, 12 insertions(+), 4 deletions(-) + +diff --git a/job.c b/job.c +index 754576b..f7b7d51 100644 +--- a/job.c ++++ b/job.c +@@ -2984,8 +2984,8 @@ construct_command_argv_internal (char *line, char **restp, char *shell, + return new_argv; + } + +- new_line = alloca ((shell_len*2) + 1 + sflags_len + 1 +- + (line_len*2) + 1); ++ new_line = xmalloc ((shell_len*2) + 1 + sflags_len + 1 ++ + (line_len*2) + 1); + ap = new_line; + /* Copy SHELL, escaping any characters special to the shell. If + we don't escape them, construct_command_argv_internal will +@@ -3052,8 +3052,11 @@ construct_command_argv_internal (char *line, char **restp, char *shell, + *ap++ = *p; + } + if (ap == new_line + shell_len + sflags_len + 2) +- /* Line was empty. */ +- return 0; ++ { ++ /* Line was empty. */ ++ free (new_line); ++ return 0; ++ } + *ap = '\0'; + + #ifdef WINDOWS32 +@@ -3194,6 +3197,8 @@ construct_command_argv_internal (char *line, char **restp, char *shell, + fatal (NILF, _("%s (line %d) Bad shell context (!unixy && !batch_mode_shell)\n"), + __FILE__, __LINE__); + #endif ++ ++ free (new_line); + } + #endif /* ! AMIGA */ + +-- +1.7.12 + diff --git a/sys-devel/make/make-3.82-r4.ebuild b/sys-devel/make/make-3.82-r4.ebuild index 776e77572bc5..f0ff076f06a2 100644 --- a/sys-devel/make/make-3.82-r4.ebuild +++ b/sys-devel/make/make-3.82-r4.ebuild @@ -1,6 +1,6 @@ -# Copyright 1999-2011 Gentoo Foundation +# Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-devel/make/make-3.82-r4.ebuild,v 1.1 2011/12/03 00:57:25 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-devel/make/make-3.82-r4.ebuild,v 1.2 2012/10/05 05:28:59 vapier Exp $ EAPI="2" @@ -12,7 +12,7 @@ SRC_URI="mirror://gnu//make/${P}.tar.bz2" LICENSE="GPL-3" SLOT="0" -#KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd" +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd" IUSE="nls static" DEPEND="nls? ( sys-devel/gettext )" @@ -26,7 +26,9 @@ src_prepare() { epatch "${FILESDIR}"/${P}-copy-on-expand.patch epatch "${FILESDIR}"/${P}-oneshell.patch epatch "${FILESDIR}"/${P}-parallel-remake.patch - epatch "${FILESDIR}"/${P}-long-cmdline.patch #300867 #301116 + epatch "${FILESDIR}"/${P}-intermediate-parallel.patch #431250 + epatch "${FILESDIR}"/${P}-construct-command-line.patch + epatch "${FILESDIR}"/${P}-long-command-line.patch } src_configure() { |