diff options
-rw-r--r-- | main/make/APKBUILD | 17 | ||||
-rw-r--r-- | main/make/make-3.82-copy-on-expand.patch | 58 | ||||
-rw-r--r-- | main/make/make-3.82-expensive_glob.patch | 116 | ||||
-rw-r--r-- | main/make/make-3.82-jobserver.patch | 19 | ||||
-rw-r--r-- | main/make/make-3.82-memory-corruption.patch | 37 | ||||
-rw-r--r-- | main/make/make-3.82-parallel-remake.patch | 39 | ||||
-rw-r--r-- | main/make/make-3.82-weird-shell.patch | 16 |
7 files changed, 299 insertions, 3 deletions
diff --git a/main/make/APKBUILD b/main/make/APKBUILD index 96ba9e78db..aa11050de2 100644 --- a/main/make/APKBUILD +++ b/main/make/APKBUILD @@ -1,7 +1,7 @@ # Maintainer: Natanael Copa <ncopa@alpinelinux.org> pkgname=make pkgver=3.82 -pkgrel=2 +pkgrel=3 pkgdesc="GNU make utility to maintain groups of programs" url="http://www.gnu.org/software/make" arch="all" @@ -9,7 +9,13 @@ license=GPL depends= subpackages="$pkgname-doc" source="ftp://ftp.gnu.org/gnu/$pkgname/$pkgname-$pkgver.tar.gz - make-3.82-savannah-bugs-30612-30723.patch" + make-3.82-savannah-bugs-30612-30723.patch + make-3.82-copy-on-expand.patch + make-3.82-memory-corruption.patch + make-3.82-jobserver.patch + make-3.82-expensive_glob.patch + make-3.82-parallel-remake.patch + " _builddir="$srcdir"/$pkgname-$pkgver prepare() { @@ -36,4 +42,9 @@ package() { } md5sums="7f7c000e3b30c6840f2e9cf86b254fac make-3.82.tar.gz -74e598a2052f7d98e3495ea9d917ecf4 make-3.82-savannah-bugs-30612-30723.patch" +74e598a2052f7d98e3495ea9d917ecf4 make-3.82-savannah-bugs-30612-30723.patch +9545e667ab5eafdef5b658941290cc26 make-3.82-copy-on-expand.patch +0436e740edbc81cf27fd598241b8dcf0 make-3.82-memory-corruption.patch +923a06973f4bbc9f27c2ca88a6940d45 make-3.82-jobserver.patch +f2ed48ea701e8ab6e5b870a3d125b71a make-3.82-expensive_glob.patch +89f8032d2f314eb6338739f024d8ecec make-3.82-parallel-remake.patch" diff --git a/main/make/make-3.82-copy-on-expand.patch b/main/make/make-3.82-copy-on-expand.patch new file mode 100644 index 0000000000..bcefa763be --- /dev/null +++ b/main/make/make-3.82-copy-on-expand.patch @@ -0,0 +1,58 @@ +fix from upstream cvs + +---------------------------- +revision 1.58 +date: 2011-08-29 12:20:19 -0400; author: psmith; state: Exp; lines: +7 -13; commitid: MdH0jSxpuIy7mqxv; +Save strings we're expanding in case an embedded eval causes them +to be freed (if they're the value of a variable that's reset for example). +See Savannah patch #7534 + +Index: expand.c +=================================================================== +RCS file: /sources/make/make/expand.c,v +retrieving revision 1.57 +retrieving revision 1.58 +diff -u -p -r1.57 -r1.58 +--- ./expand.c 7 May 2011 20:03:49 -0000 1.57 ++++ ./expand.c 29 Aug 2011 16:20:19 -0000 1.58 +@@ -197,7 +197,7 @@ variable_expand_string (char *line, cons + { + struct variable *v; + const char *p, *p1; +- char *abuf = NULL; ++ char *save; + char *o; + unsigned int line_offset; + +@@ -212,16 +212,11 @@ variable_expand_string (char *line, cons + return (variable_buffer); + } + +- /* If we want a subset of the string, allocate a temporary buffer for it. +- Most of the functions we use here don't work with length limits. */ +- if (length > 0 && string[length] != '\0') +- { +- abuf = xmalloc(length+1); +- memcpy(abuf, string, length); +- abuf[length] = '\0'; +- string = abuf; +- } +- p = string; ++ /* We need a copy of STRING: due to eval, it's possible that it will get ++ freed as we process it (it might be the value of a variable that's reset ++ for example). Also having a nil-terminated string is handy. */ ++ save = length < 0 ? xstrdup (string) : xstrndup (string, length); ++ p = save; + + while (1) + { +@@ -411,8 +406,7 @@ variable_expand_string (char *line, cons + ++p; + } + +- if (abuf) +- free (abuf); ++ free (save); + + variable_buffer_output (o, "", 1); + return (variable_buffer + line_offset); diff --git a/main/make/make-3.82-expensive_glob.patch b/main/make/make-3.82-expensive_glob.patch new file mode 100644 index 0000000000..65806fdf2b --- /dev/null +++ b/main/make/make-3.82-expensive_glob.patch @@ -0,0 +1,116 @@ +Index: read.c +=================================================================== +RCS file: /sources/make/make/read.c,v +retrieving revision 1.198 +retrieving revision 1.200 +diff -u -r1.198 -r1.200 +--- ./read.c 29 Apr 2011 15:27:39 -0000 1.198 ++++ ./read.c 7 May 2011 14:36:12 -0000 1.200 +@@ -2901,6 +2901,7 @@ + const char *name; + const char **nlist = 0; + char *tildep = 0; ++ int globme = 1; + #ifndef NO_ARCHIVES + char *arname = 0; + char *memname = 0; +@@ -3109,32 +3110,40 @@ + } + #endif /* !NO_ARCHIVES */ + +- switch (glob (name, GLOB_NOSORT|GLOB_ALTDIRFUNC, NULL, &gl)) +- { +- case GLOB_NOSPACE: +- fatal (NILF, _("virtual memory exhausted")); +- +- case 0: +- /* Success. */ +- i = gl.gl_pathc; +- nlist = (const char **)gl.gl_pathv; +- break; +- +- case GLOB_NOMATCH: +- /* If we want only existing items, skip this one. */ +- if (flags & PARSEFS_EXISTS) +- { +- i = 0; +- break; +- } +- /* FALLTHROUGH */ +- +- default: +- /* By default keep this name. */ ++ /* glob() is expensive: don't call it unless we need to. */ ++ if (!(flags & PARSEFS_EXISTS) && strpbrk (name, "?*[") == NULL) ++ { ++ globme = 0; + i = 1; + nlist = &name; +- break; +- } ++ } ++ else ++ switch (glob (name, GLOB_NOSORT|GLOB_ALTDIRFUNC, NULL, &gl)) ++ { ++ case GLOB_NOSPACE: ++ fatal (NILF, _("virtual memory exhausted")); ++ ++ case 0: ++ /* Success. */ ++ i = gl.gl_pathc; ++ nlist = (const char **)gl.gl_pathv; ++ break; ++ ++ case GLOB_NOMATCH: ++ /* If we want only existing items, skip this one. */ ++ if (flags & PARSEFS_EXISTS) ++ { ++ i = 0; ++ break; ++ } ++ /* FALLTHROUGH */ ++ ++ default: ++ /* By default keep this name. */ ++ i = 1; ++ nlist = &name; ++ break; ++ } + + /* For each matched element, add it to the list. */ + while (i-- > 0) +@@ -3174,7 +3183,8 @@ + #endif /* !NO_ARCHIVES */ + NEWELT (concat (2, prefix, nlist[i])); + +- globfree (&gl); ++ if (globme) ++ globfree (&gl); + + #ifndef NO_ARCHIVES + if (arname) +Index: tests/scripts/functions/wildcard +=================================================================== +RCS file: /sources/make/make/tests/scripts/functions/wildcard,v +retrieving revision 1.6 +retrieving revision 1.7 +diff -u -r1.6 -r1.7 +--- ./tests/scripts/functions/wildcard 13 Jun 2009 21:21:49 -0000 1.6 ++++ ./tests/scripts/functions/wildcard 7 May 2011 14:36:11 -0000 1.7 +@@ -88,4 +88,16 @@ + !, + '', "\n"); + ++# TEST #5: wildcard used to verify file existence ++ ++touch('xxx.yyy'); ++ ++run_make_test(q!exists: ; @echo file=$(wildcard xxx.yyy)!, ++ '', "file=xxx.yyy\n"); ++ ++unlink('xxx.yyy'); ++ ++run_make_test(q!exists: ; @echo file=$(wildcard xxx.yyy)!, ++ '', "file=\n"); ++ + 1; diff --git a/main/make/make-3.82-jobserver.patch b/main/make/make-3.82-jobserver.patch new file mode 100644 index 0000000000..2a855031dd --- /dev/null +++ b/main/make/make-3.82-jobserver.patch @@ -0,0 +1,19 @@ +diff -up make-3.82/main.c\~ make-3.82/main.c +--- make-3.82/main.c~ 2010-08-12 14:59:20.000000000 +0200 ++++ make-3.82/main.c 2010-08-12 15:00:07.000000000 +0200 +@@ -1756,8 +1756,11 @@ main (int argc, char **argv, char **envp + + if (job_slots > 0) + { +- close (job_fds[0]); +- close (job_fds[1]); ++ if (restarts == 0) ++ { ++ close (job_fds[0]); ++ close (job_fds[1]); ++ } + job_fds[0] = job_fds[1] = -1; + free (jobserver_fds->list); + free (jobserver_fds); + +Diff finished. Thu Aug 12 15:00:22 2010 diff --git a/main/make/make-3.82-memory-corruption.patch b/main/make/make-3.82-memory-corruption.patch new file mode 100644 index 0000000000..b52dd6e0b9 --- /dev/null +++ b/main/make/make-3.82-memory-corruption.patch @@ -0,0 +1,37 @@ +--- ./function.c 2011/04/18 01:25:20 1.121 ++++ ./function.c 2011/05/02 12:35:01 1.122 +@@ -706,7 +706,7 @@ + const char *word_iterator = argv[0]; + char buf[20]; + +- while (find_next_token (&word_iterator, (unsigned int *) 0) != 0) ++ while (find_next_token (&word_iterator, NULL) != 0) + ++i; + + sprintf (buf, "%d", i); +@@ -1133,21 +1133,14 @@ + + /* Find the maximum number of words we'll have. */ + t = argv[0]; +- wordi = 1; +- while (*t != '\0') ++ wordi = 0; ++ while ((p = find_next_token (&t, NULL)) != 0) + { +- char c = *(t++); +- +- if (! isspace ((unsigned char)c)) +- continue; +- ++ ++t; + ++wordi; +- +- while (isspace ((unsigned char)*t)) +- ++t; + } + +- words = xmalloc (wordi * sizeof (char *)); ++ words = xmalloc ((wordi == 0 ? 1 : wordi) * sizeof (char *)); + + /* Now assign pointers to each string in the array. */ + t = argv[0]; diff --git a/main/make/make-3.82-parallel-remake.patch b/main/make/make-3.82-parallel-remake.patch new file mode 100644 index 0000000000..923e60ba24 --- /dev/null +++ b/main/make/make-3.82-parallel-remake.patch @@ -0,0 +1,39 @@ +fix from upstream cvs + +---------------------------- +revision 1.247 +date: 2011-09-18 19:39:26 -0400; author: psmith; state: Exp; lines: +5 -3; commitid: 07NxO4T5PiWC82Av; +When we re-exec the master makefile in a jobserver environment, ensure +that MAKEFLAGS is set properly so the re-exec'd make runs in parallel. +See Savannah bug #33873. + +Index: main.c +=================================================================== +RCS file: /sources/make/make/main.c,v +retrieving revision 1.246 +retrieving revision 1.247 +diff -u -p -r1.246 -r1.247 +--- ./main.c 29 Aug 2010 23:05:27 -0000 1.246 ++++ ./main.c 18 Sep 2011 23:39:26 -0000 1.247 +@@ -2089,6 +2089,11 @@ main (int argc, char **argv, char **envp + + ++restarts; + ++ /* If we're re-exec'ing the first make, put back the number of ++ job slots so define_makefiles() will get it right. */ ++ if (master_job_slots) ++ job_slots = master_job_slots; ++ + /* Reset makeflags in case they were changed. */ + { + const char *pv = define_makeflags (1, 1); +@@ -2825,9 +2830,6 @@ define_makeflags (int all, int makefile) + && (*(unsigned int *) cs->value_ptr == + *(unsigned int *) cs->noarg_value)) + ADD_FLAG ("", 0); /* Optional value omitted; see below. */ +- else if (cs->c == 'j') +- /* Special case for `-j'. */ +- ADD_FLAG ("1", 1); + else + { + char *buf = alloca (30); diff --git a/main/make/make-3.82-weird-shell.patch b/main/make/make-3.82-weird-shell.patch new file mode 100644 index 0000000000..dfdaf89c9e --- /dev/null +++ b/main/make/make-3.82-weird-shell.patch @@ -0,0 +1,16 @@ +diff -up make-3.82/job.c\~ make-3.82/job.c +--- make-3.82/job.c~ 2010-08-11 16:13:33.000000000 +0200 ++++ make-3.82/job.c 2010-08-12 14:20:08.000000000 +0200 +@@ -2442,7 +2442,11 @@ construct_command_argv_internal (char *l + + /* See if it is safe to parse commands internally. */ + if (shell == 0) +- shell = default_shell; ++ { ++ shell = default_shell; ++ if (shellflags == 0) ++ shellflags = "-c"; ++ } + #ifdef WINDOWS32 + else if (strcmp (shell, default_shell)) + { |