From f11321e933f37ce2dba0af1b4eb2a7f049bbf3e4 Mon Sep 17 00:00:00 2001 From: Anas Nashif Date: Mon, 5 Nov 2012 11:18:53 -0800 Subject: slow down parallelism --- packaging/make-3.79.1-noclock_gettime.patch | 11 -- packaging/make-3.80-getcwd.patch | 11 -- packaging/make-3.80-j8k.patch | 23 --- packaging/make-3.81-err-reporting.patch | 151 ---------------- packaging/make-3.81-jobserver.patch | 18 -- packaging/make-3.81-memory.patch | 261 ---------------------------- packaging/make-3.81-newlines.patch | 23 --- packaging/make-3.81-rlimit.patch | 111 ------------ packaging/make.spec | 124 ++++++------- tests/scripts/features/double_colon | 2 +- tests/scripts/features/parallelism | 34 ++-- tests/scripts/options/dash-l | 4 +- tests/test_driver.pl | 2 +- 13 files changed, 73 insertions(+), 702 deletions(-) delete mode 100644 packaging/make-3.79.1-noclock_gettime.patch delete mode 100644 packaging/make-3.80-getcwd.patch delete mode 100644 packaging/make-3.80-j8k.patch delete mode 100644 packaging/make-3.81-err-reporting.patch delete mode 100644 packaging/make-3.81-jobserver.patch delete mode 100644 packaging/make-3.81-memory.patch delete mode 100644 packaging/make-3.81-newlines.patch delete mode 100644 packaging/make-3.81-rlimit.patch diff --git a/packaging/make-3.79.1-noclock_gettime.patch b/packaging/make-3.79.1-noclock_gettime.patch deleted file mode 100644 index 5c94aac..0000000 --- a/packaging/make-3.79.1-noclock_gettime.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- make-3.80/configure -+++ make-3.80/configure -@@ -6794,7 +6794,7 @@ - fi - rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext - if test "$ac_cv_search_clock_gettime" = no; then -- for ac_lib in rt posix4; do -+ for ac_lib in posix4; do - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - cat >conftest.$ac_ext <<_ACEOF - #line $LINENO "configure" diff --git a/packaging/make-3.80-getcwd.patch b/packaging/make-3.80-getcwd.patch deleted file mode 100644 index e284f42..0000000 --- a/packaging/make-3.80-getcwd.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- make-3.80/make.h.jj 2002-09-11 12:55:44.000000000 -0400 -+++ make-3.80/make.h 2005-03-07 09:24:53.000000000 -0500 -@@ -474,7 +474,7 @@ extern long int lseek (); - #endif /* Not GNU C library or POSIX. */ - - #ifdef HAVE_GETCWD --# if !defined(VMS) && !defined(__DECC) -+# if !defined(VMS) && !defined(__DECC) && !defined(getcwd) - extern char *getcwd (); - #endif - #else diff --git a/packaging/make-3.80-j8k.patch b/packaging/make-3.80-j8k.patch deleted file mode 100644 index 1acd4f9..0000000 --- a/packaging/make-3.80-j8k.patch +++ /dev/null @@ -1,23 +0,0 @@ ---- make-3.80/main.c.jj 2002-08-09 21:27:17.000000000 -0400 -+++ make-3.80/main.c 2004-12-13 12:48:25.000000000 -0500 -@@ -1549,6 +1549,20 @@ int main (int argc, char ** argv) - } - } - -+#ifdef PIPE_BUF -+ if (job_slots > PIPE_BUF) -+#elif defined _POSIX_PIPE_BUF -+ if (job_slots > _POSIX_PIPE_BUF) -+#else -+ if (job_slots > 512) -+#endif -+ { -+ error (NILF, -+ _("More parallel jobs (-jN) than this platform can handle requested.")); -+ error (NILF, _("Resetting to single job (-j1) mode.")); -+ job_slots = 1; -+ } -+ - /* If we have >1 slot but no jobserver-fds, then we're a top-level make. - Set up the pipe and install the fds option for our children. */ - diff --git a/packaging/make-3.81-err-reporting.patch b/packaging/make-3.81-err-reporting.patch deleted file mode 100644 index bbab96d..0000000 --- a/packaging/make-3.81-err-reporting.patch +++ /dev/null @@ -1,151 +0,0 @@ ---- make-3.80/misc.c.jj 2002-09-12 18:15:58.000000000 -0400 -+++ make-3.80/misc.c 2005-08-22 05:46:05.000000000 -0400 -@@ -311,17 +311,31 @@ strerror (errnum) - /* Print an error message from errno. */ - -+void -+perror_with_name_err (const char *str, const char *name, int errnum) -+{ -+ error (NILF, _("%s%s: %s"), str, name, strerror (errnum)); -+} -+ - void - perror_with_name (const char *str, const char *name) - { -- error (NILF, _("%s%s: %s"), str, name, strerror (errno)); -+ perror_with_name_err (str, name, errno); - } - - /* Print an error message from errno and exit. */ - -+void -+pfatal_with_name_err (const char *name, int errnum) -+{ -+ fatal (NILF, _("%s: %s"), name, strerror (errnum)); -+ -+ /* NOTREACHED */ -+} -+ - void - pfatal_with_name (const char *name) - { -- fatal (NILF, _("%s: %s"), name, strerror (errno)); -+ pfatal_with_name_err (name, errno); - - /* NOTREACHED */ - } - ---- make-3.81/main.c.jj 2006-05-23 12:51:25.000000000 +0200 -+++ make-3.81/main.c 2006-05-23 12:50:48.000000000 +0200 -@@ -1502,13 +1502,13 @@ - strcat (template, DEFAULT_TMPFILE); - outfile = open_tmpfile (&stdin_nm, template); - if (outfile == 0) -- pfatal_with_name (_("fopen (temporary file)")); -+ pfatal_with_name_err (_("fopen (temporary file)"), errno); - while (!feof (stdin) && ! ferror (stdin)) - { - char buf[2048]; - unsigned int n = fread (buf, 1, sizeof (buf), stdin); - if (n > 0 && fwrite (buf, 1, n, outfile) != n) -- pfatal_with_name (_("fwrite (temporary file)")); -+ pfatal_with_name_err (_("fwrite (temporary file)"), errno); - } - (void) fclose (outfile); - -@@ -1681,7 +1681,7 @@ - else if ((job_rfd = dup (job_fds[0])) < 0) - { - if (errno != EBADF) -- pfatal_with_name (_("dup jobserver")); -+ pfatal_with_name_err (_("dup jobserver"), errno); - - error (NILF, - _("warning: jobserver unavailable: using -j1. Add `+' to parent make rule.")); -@@ -1721,7 +1721,7 @@ - char c = '+'; - - if (pipe (job_fds) < 0 || (job_rfd = dup (job_fds[0])) < 0) -- pfatal_with_name (_("creating jobs pipe")); -+ pfatal_with_name_err (_("creating jobs pipe"), errno); - - /* Every make assumes that it always has one job it can run. For the - submakes it's the token they were given by their parent. For the -@@ -1736,7 +1736,7 @@ - - EINTRLOOP (r, write (job_fds[1], &c, 1)); - if (r != 1) -- pfatal_with_name (_("init jobserver pipe")); -+ pfatal_with_name_err (_("init jobserver pipe"), errno); - } - - /* Fill in the jobserver_fds struct for our children. */ -@@ -2151,8 +2151,8 @@ - /* If there is a temp file from reading a makefile from stdin, get rid of - it now. */ - if (stdin_nm && unlink (stdin_nm) < 0 && errno != ENOENT) -- perror_with_name (_("unlink (temporary file): "), stdin_nm); -+ perror_with_name_err (_("unlink (temporary file): "), stdin_nm, errno); - - { - int status; - ---- make-3.81/make.h.jj 2006-05-23 12:54:45.000000000 +0200 -+++ make-3.81/make.h 2006-05-23 12:55:00.000000000 +0200 -@@ -414,6 +414,8 @@ - extern void log_working_directory PARAMS ((int)); - extern void pfatal_with_name PARAMS ((const char *)) __attribute__ ((noreturn)); - extern void perror_with_name PARAMS ((const char *, const char *)); -+extern void pfatal_with_name_err PARAMS ((const char *, int errnum)) __attribute__ ((noreturn)); -+extern void perror_with_name_err PARAMS ((const char *, const char *, int errnum)); - extern char *savestring PARAMS ((const char *, unsigned int)); - extern char *concat PARAMS ((const char *, const char *, const char *)); - extern char *xmalloc PARAMS ((unsigned int)); - ---- make-3.81/job.c.jj 2006-05-23 13:01:35.000000000 +0200 -+++ make-3.81/job.c 2006-05-23 13:50:44.000000000 +0200 -@@ -859,7 +859,7 @@ - - EINTRLOOP (r, write (job_fds[1], &token, 1)); - if (r != 1) -- pfatal_with_name (_("write jobserver")); -+ pfatal_with_name_err (_("write jobserver"), errno); - - DB (DB_JOBS, (_("Released token for child 0x%08lx (%s).\n"), - (unsigned long int) child, child->file->name)); -@@ -1699,6 +1699,7 @@ - - /* Set interruptible system calls, and read() for a job token. */ - set_child_handler_action_flags (1, waiting_jobs != NULL); -+ errno = 0; - got_token = read (job_rfd, &token, 1); - saved_errno = errno; - set_child_handler_action_flags (0, waiting_jobs != NULL); -@@ -1713,10 +1714,14 @@ - - /* If the error _wasn't_ expected (EINTR or EBADF), punt. Otherwise, - go back and reap_children(), and try again. */ -- errno = saved_errno; -- if (errno != EINTR && errno != EBADF) -- pfatal_with_name (_("read jobs pipe")); -- if (errno == EBADF) -+ if (saved_errno != EINTR && saved_errno != EBADF) -+ { -+ if (got_token == 0) -+ fatal (NILF, _("read jobs pipe EOF")); -+ else -+ pfatal_with_name_err (_("read jobs pipe"), saved_errno); -+ } -+ if (saved_errno == EBADF) - DB (DB_JOBS, ("Read returned EBADF.\n")); - } - #endif -@@ -1831,7 +1836,7 @@ - error (NILF, - _("cannot enforce load limits on this operating system")); - else -- perror_with_name (_("cannot enforce load limit: "), "getloadavg"); -+ perror_with_name_err (_("cannot enforce load limit: "), "getloadavg", errno); - } - lossage = errno; - load = 0; diff --git a/packaging/make-3.81-jobserver.patch b/packaging/make-3.81-jobserver.patch deleted file mode 100644 index df65107..0000000 --- a/packaging/make-3.81-jobserver.patch +++ /dev/null @@ -1,18 +0,0 @@ -diff -urp make-3.81/main.c make-3.81-pm/main.c ---- make-3.81/main.c 2007-09-24 15:28:34.000000000 +0200 -+++ make-3.81-pm/main.c 2007-09-24 15:32:50.000000000 +0200 -@@ -1669,8 +1669,12 @@ 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 --git a/packaging/make-3.81-memory.patch b/packaging/make-3.81-memory.patch deleted file mode 100644 index 7a7bf9f..0000000 --- a/packaging/make-3.81-memory.patch +++ /dev/null @@ -1,261 +0,0 @@ -diff -Bburpd make-3.81_orig/file.c make-3.81/file.c ---- make-3.81_orig/file.c 2006-05-23 13:59:11.000000000 +0200 -+++ make-3.81/file.c 2006-05-23 14:39:34.000000000 +0200 -@@ -490,7 +490,7 @@ expand_deps (struct file *f) - - o = subst_expand (buffer, d->name, "%", "$*", 1, 2, 0); - -- free (d->name); -+ hash_strfree (d->name); - d->name = savestring (buffer, o - buffer); - d->staticpattern = 0; /* Clear staticpattern so that we don't - re-expand %s below. */ -@@ -549,7 +549,7 @@ expand_deps (struct file *f) - dp->name[0] = '\0'; - else - { -- free (dp->name); -+ hash_strfree (dp->name); - dp->name = savestring (buffer, o - buffer); - } - } -@@ -580,7 +580,7 @@ expand_deps (struct file *f) - if (d1->file == 0) - d1->file = enter_file (d1->name); - else -- free (d1->name); -+ hash_strfree (d1->name); - d1->name = 0; - d1->staticpattern = 0; - d1->need_2nd_expansion = 0; -Only in make-3.81: file.c~ -diff -Bburpd make-3.81_orig/implicit.c make-3.81/implicit.c ---- make-3.81_orig/implicit.c 2006-05-23 13:59:11.000000000 +0200 -+++ make-3.81/implicit.c 2006-05-23 14:40:01.000000000 +0200 -@@ -864,7 +864,7 @@ pattern_search (struct file *file, int a - dep->file = enter_file (dep->name); - /* enter_file uses dep->name _if_ we created a new file. */ - if (dep->name != dep->file->name) -- free (dep->name); -+ hash_strfree (dep->name); - dep->name = 0; - dep->file->tried_implicit |= dep->changed; - } -Only in make-3.81: implicit.c~ -diff -Bburpd make-3.81_orig/main.c make-3.81/main.c ---- make-3.81_orig/main.c 2006-05-23 13:59:11.000000000 +0200 -+++ make-3.81/main.c 2006-05-23 14:40:49.000000000 +0200 -@@ -540,6 +540,7 @@ initialize_global_hash_tables (void) - init_hash_files (); - hash_init_directories (); - hash_init_function_table (); -+ init_hash_strings (); - } - - static struct file * -Only in make-3.81: main.c~ -diff -Bburpd make-3.81_orig/make.h make-3.81/make.h ---- make-3.81_orig/make.h 2006-05-23 13:59:11.000000000 +0200 -+++ make-3.81/make.h 2006-05-23 14:41:21.000000000 +0200 -@@ -431,6 +431,11 @@ extern void print_spaces PARAMS ((unsign - extern char *find_percent PARAMS ((char *)); - extern FILE *open_tmpfile PARAMS ((char **, const char *)); - -+extern void init_hash_strings PARAMS ((void)); -+extern char *hash_strdup PARAMS ((const char *)); -+extern char *hash_savestring PARAMS ((const char *, unsigned int)); -+extern void hash_strfree PARAMS ((char *)); -+ - #ifndef NO_ARCHIVES - extern int ar_name PARAMS ((char *)); - extern void ar_parse_name PARAMS ((char *, char **, char **)); -Only in make-3.81: make.h~ -diff -Bburpd make-3.81_orig/misc.c make-3.81/misc.c ---- make-3.81_orig/misc.c 2006-05-23 13:59:11.000000000 +0200 -+++ make-3.81/misc.c 2006-05-23 14:42:59.000000000 +0200 -@@ -16,8 +16,10 @@ You should have received a copy of the G - GNU Make; see the file COPYING. If not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */ - -+#include - #include "make.h" - #include "dep.h" -+#include "hash.h" - #include "debug.h" - - /* Variadic functions. We go through contortions to allow proper function -@@ -511,7 +513,7 @@ void - free_dep (struct dep *d) - { - if (d->name != 0) -- free (d->name); -+ hash_strfree (d->name); - - if (d->stem != 0) - free (d->stem); -@@ -535,7 +537,7 @@ copy_dep_chain (const struct dep *d) - bcopy ((char *) d, (char *) c, sizeof (struct dep)); - - if (c->name != 0) -- c->name = xstrdup (c->name); -+ c->name = hash_strdup (c->name); - if (c->stem != 0) - c->stem = xstrdup (c->stem); - -@@ -909,3 +911,154 @@ close_stdout (void) - exit (EXIT_FAILURE); - } - } -+ -+/* Hash table of duplicated strings. */ -+ -+struct hash_string -+{ -+ char *string; -+ unsigned int count; -+}; -+ -+static unsigned long -+string_hash_1 (key) -+ const void *key; -+{ -+ return_ISTRING_HASH_1 (((const struct hash_string *) key)->string); -+} -+ -+static unsigned long -+string_hash_2 (key) -+ const void *key; -+{ -+ return_ISTRING_HASH_2 (((const struct hash_string *) key)->string); -+} -+ -+static int -+string_hash_cmp (x, y) -+ const void *x; -+ const void *y; -+{ -+ return_ISTRING_COMPARE (((const struct hash_string *) x)->string, -+ ((const struct hash_string *) y)->string); -+} -+ -+static struct hash_table strings; -+ -+void -+init_hash_strings () -+{ -+ hash_init (&strings, 1000, string_hash_1, string_hash_2, -+ string_hash_cmp); -+} -+ -+/* Keep track duplicated string and return the old one if exists. */ -+ -+char * -+hash_strdup (ptr) -+ const char *ptr; -+{ -+ struct hash_string *h, key; -+ -+ if (*ptr == '\0') -+ return ""; -+ -+ key.string = (char *) ptr; -+ key.count = 0; -+ h = (struct hash_string *) hash_find_item (&strings, &key); -+ if (h == NULL) -+ { -+ char *result = (char *) malloc (strlen (ptr) + 1); -+ -+ if (result == NULL) -+ fatal (NILF, _("virtual memory exhausted")); -+ -+ strcpy (result, ptr); -+ -+ h = (struct hash_string *) malloc (sizeof (struct hash_string)); -+ if (h == NULL) -+ fatal (NILF, _("virtual memory exhausted")); -+ -+ h->string = result; -+ h->count = 1; -+ hash_insert (&strings, h); -+ } -+ else -+ { -+ h->count++; -+ assert (h->count != 0); -+ } -+ -+ return h->string; -+} -+ -+char * -+hash_savestring (str, length) -+ const char *str; -+ unsigned int length; -+{ -+ struct hash_string *h, key; -+ -+ if (length == 0 || *str == '\0') -+ return ""; -+ -+ key.string = alloca (length + 1); -+ key.count = 0; -+ bcopy (str, key.string, length); -+ key.string [length] = '\0'; -+ -+ h = (struct hash_string *) hash_find_item (&strings, &key); -+ if (h == NULL) -+ { -+ char *out = (char *) xmalloc (length + 1); -+ bcopy (str, out, length); -+ out[length] = '\0'; -+ -+ h = (struct hash_string *) malloc (sizeof (struct hash_string)); -+ if (h == NULL) -+ fatal (NILF, _("virtual memory exhausted")); -+ -+ h->string = out; -+ h->count = 1; -+ hash_insert (&strings, h); -+ } -+ else -+ { -+ h->count++; -+ assert (h->count != 0); -+ } -+ -+ return h->string; -+} -+ -+void -+hash_strfree (ptr) -+ char *ptr; -+{ -+ struct hash_string *h, key; -+ -+ if (*ptr == '\0') -+ return; -+ -+ key.string = ptr; -+ key.count = 0; -+ h = (struct hash_string *) hash_find_item (&strings, &key); -+ -+ /* Check if string comes from hash_strdup or hash_savestring. */ -+ if (h == NULL || h->string != ptr) -+ { -+ free (ptr); -+ return; -+ } -+ -+ h->count--; -+ if (h->count == 0) -+ { -+ struct hash_string *d; -+ -+ d = hash_delete (&strings, h); -+ assert (d == h); -+ free (h->string); -+ free (h); -+ } -+} -Only in make-3.81: misc.c~ -Only in make-3.81: read.c~ diff --git a/packaging/make-3.81-newlines.patch b/packaging/make-3.81-newlines.patch deleted file mode 100644 index d9bb313..0000000 --- a/packaging/make-3.81-newlines.patch +++ /dev/null @@ -1,23 +0,0 @@ ---- make-3.81-orig/job.c 2007-02-21 19:10:54.000000000 +0100 -+++ make-3.81-pm/job.c 2007-02-22 18:13:59.000000000 +0100 -@@ -2706,7 +2706,7 @@ - unsigned int line_len = strlen (line); - - char *new_line = (char *) alloca (shell_len + (sizeof (minus_c) - 1) -- + (line_len * 2) + 1); -+ + (line_len * 4) + 1); - char *command_ptr = NULL; /* used for batch_mode_shell mode */ - - # ifdef __EMX__ /* is this necessary? */ -@@ -2740,9 +2740,10 @@ - #endif - if (PRESERVE_BSNL) - { -- *(ap++) = '\\'; -+ *(ap++) = '\''; - *(ap++) = '\\'; - *(ap++) = '\n'; -+ *(ap++) = '\''; - } - - ++p; diff --git a/packaging/make-3.81-rlimit.patch b/packaging/make-3.81-rlimit.patch deleted file mode 100644 index f88f0fe..0000000 --- a/packaging/make-3.81-rlimit.patch +++ /dev/null @@ -1,111 +0,0 @@ -diff -urp make-3.81/job.c make-3.81-pm/job.c ---- make-3.81/job.c 2008-03-25 18:15:38.000000000 +0100 -+++ make-3.81-pm/job.c 2008-03-25 17:51:11.000000000 +0100 -@@ -2079,6 +2079,9 @@ exec_command (char **argv, char **envp) - # else - - /* Run the program. */ -+#ifdef SET_STACK_SIZE -+ restore_original_stack_rlimit (); -+#endif - environ = envp; - execvp (argv[0], argv); - -diff -urp make-3.81/main.c make-3.81-pm/main.c ---- make-3.81/main.c 2008-03-25 18:15:38.000000000 +0100 -+++ make-3.81-pm/main.c 2008-03-25 18:14:04.000000000 +0100 -@@ -44,12 +44,53 @@ Foundation, Inc., 51 Franklin St, Fifth - # include - #endif - --#if defined(HAVE_SYS_RESOURCE_H) && defined(HAVE_GETRLIMIT) && defined(HAVE_SETRLIMIT) --# define SET_STACK_SIZE --#endif -- - #ifdef SET_STACK_SIZE - # include -+/* Whether the rlimit was set successfuly */ -+static int setrlimit_succeeded = 0; -+/* Original rlim_cur */ -+static rlim_t setrlimit_orig_cur = 0; -+ -+/* Get rid of any avoidable limit on stack size so that alloca does -+ not fail. */ -+void -+set_max_stack_rlimit (void) -+{ -+ struct rlimit rlim; -+ -+ /* Back off if the limit is still set, probably due to failure in -+ restore_original_stack_rlimit. */ -+ if (setrlimit_succeeded) -+ return; -+ -+ if (getrlimit (RLIMIT_STACK, &rlim) == 0) -+ { -+ setrlimit_orig_cur = rlim.rlim_cur; -+ rlim.rlim_cur = rlim.rlim_max; -+ if (setrlimit (RLIMIT_STACK, &rlim) != -1) -+ setrlimit_succeeded = 1; -+ } -+} -+ -+/* Set the rlimit back to its original value. To be called before -+ process spawn. */ -+void -+restore_original_stack_rlimit (void) -+{ -+ struct rlimit rlim; -+ -+ if (!setrlimit_succeeded) -+ return; -+ -+ if (getrlimit (RLIMIT_STACK, &rlim) == 0) -+ { -+ rlim.rlim_cur = setrlimit_orig_cur; -+ setrlimit (RLIMIT_STACK, &rlim); -+ /* Don't reset the setrlimit_succeeded flag. This can be called -+ after vfork, in which case the flag is in memory shared with -+ the parent. */ -+ } -+} - #endif - - #ifdef _AMIGA -@@ -915,17 +956,7 @@ main (int argc, char **argv, char **envp - #endif - - #ifdef SET_STACK_SIZE -- /* Get rid of any avoidable limit on stack size. */ -- { -- struct rlimit rlim; -- -- /* Set the stack limit huge so that alloca does not fail. */ -- if (getrlimit (RLIMIT_STACK, &rlim) == 0) -- { -- rlim.rlim_cur = rlim.rlim_max; -- setrlimit (RLIMIT_STACK, &rlim); -- } -- } -+ set_max_stack_rlimit (); - #endif - - #ifdef HAVE_ATEXIT -diff -urp make-3.81/make.h make-3.81-pm/make.h ---- make-3.81/make.h 2008-03-25 18:15:38.000000000 +0100 -+++ make-3.81-pm/make.h 2008-03-25 17:51:10.000000000 +0100 -@@ -346,6 +346,13 @@ extern int strcmpi (const char *,const c - #define N_(msgid) gettext_noop (msgid) - #define S_(msg1,msg2,num) ngettext (msg1,msg2,num) - -+/* Handle rlimit */ -+#if defined(HAVE_SYS_RESOURCE_H) && defined(HAVE_GETRLIMIT) && defined(HAVE_SETRLIMIT) -+# define SET_STACK_SIZE -+void set_max_stack_rlimit (void); -+void restore_original_stack_rlimit (void); -+#endif -+ - /* Handle other OSs. */ - #if defined(HAVE_DOS_PATHS) - # define PATH_SEPARATOR_CHAR ';' -diff -urp make-3.81/w32/Makefile make-3.81-pm/w32/Makefile diff --git a/packaging/make.spec b/packaging/make.spec index 97b78f2..4ea617b 100644 --- a/packaging/make.spec +++ b/packaging/make.spec @@ -1,91 +1,71 @@ -# -# Do NOT Edit the Auto-generated Part! -# Generated by: spectacle version 0.22 -# -# >> macros -# << macros - Name: make -Version: 3.81 -Release: 1 +Url: http://www.gnu.org/software/make/make.html +Provides: gmake +PreReq: %install_info_prereq +Version: 3.82 +Release: 0 +Summary: GNU make License: GPL-2.0+ -Summary: A GNU tool which simplifies the build process for users -Url: http://www.gnu.org/software/make/ -Group: Development/Tools -Source0: ftp://ftp.gnu.org/gnu/make/make-%{version}.tar.bz2 -Source100: make.yaml -Patch0: make-3.79.1-noclock_gettime.patch -Patch1: make-3.80-j8k.patch -Patch2: make-3.80-getcwd.patch -Patch3: make-3.81-err-reporting.patch -Patch4: make-3.81-memory.patch -Patch5: make-3.81-rlimit.patch -Patch6: make-3.81-newlines.patch -Patch7: make-3.81-jobserver.patch +Group: Development/Tools/Building +Source: make-%version.tar.bz2 +Patch2: make-slowdown-parallelism.diff +Patch3: make-disable-broken-tests.diff +Patch4: make-savannah-bug30723-expand_makeflags_before_reexec.diff +Patch5: make-savannah-bug30612-handling_of_archives.diff +Patch6: make-fix_whitespace_tokenization.diff +Patch7: make-glob-faster.patch +# PATCH-FIX-UPSTREAM make-arglength.patch dimstar@opensuse.org -- http://article.gmane.org/gmane.comp.gnu.make.bugs/4219 +Patch8: make-arglength.patch +# PATCH-FIX-UPSTREAM make-parallel-build.patch dmistar@opensuse.org -- http://savannah.gnu.org/bugs/?30653 +Patch9: make-parallel-build.patch +Patch64: make-library-search-path.diff +BuildRoot: %{_tmppath}/%{name}-%{version}-build %description -A GNU tool for controlling the generation of executables and other -non-source files of a program from the program's source files. Make -allows users to build and install packages without any significant -knowledge about the details of the build process. The details about -how the program should be built are provided for make in the program's -makefile. +The GNU make command with extensive documentation. %prep %setup -q - -# make-3.79.1-noclock_gettime.patch -%patch0 -p1 -# make-3.80-j8k.patch -%patch1 -p1 -# make-3.80-getcwd.patch -%patch2 -p1 -# make-3.81-err-reporting.patch +%patch2 %patch3 -p1 -# make-3.81-memory.patch -%patch4 -p1 -# make-3.81-rlimit.patch -%patch5 -p1 -# make-3.81-newlines.patch +%patch4 +%patch5 %patch6 -p1 -# make-3.81-jobserver.patch -%patch7 -p1 -# >> setup -# << setup +%patch7 -p0 +%patch8 -p1 +%patch9 -p1 +if [ %_lib == lib64 ]; then +%patch64 +fi %build -# >> build pre -# << build pre - -%configure --disable-static \ - --disable-nls - +CFLAGS=$RPM_OPT_FLAGS \ +./configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --disable-nls make %{?_smp_mflags} -# >> build post -# << build post -%install -# >> install pre -# << install pre -%make_install - -# >> install post -ln -sf make %{buildroot}%{_bindir}/gmake -ln -sf make.1 %{buildroot}%{_mandir}/man1/gmake.1 -rm -rf %{buildroot}%{_infodir} -# << install post - - +%check +make check +%install +make DESTDIR=$RPM_BUILD_ROOT install +ln -s make $RPM_BUILD_ROOT/usr/bin/gmake +%find_lang %name +%files -f %name.lang +%defattr(-,root,root) +/usr/bin/make +/usr/bin/gmake +%doc /usr/share/info/make.info-*.gz +%doc /usr/share/info/make.info.gz +%doc /usr/share/man/man1/make.1.gz +%clean +rm -rf $RPM_BUILD_ROOT -%files -%defattr(-,root,root,-) -# >> files -%doc NEWS README COPYING AUTHORS -%{_bindir}/* -%doc %{_mandir}/man*/* -# << files +%post +%install_info --info-dir=%{_infodir} %{_infodir}/%{name}.info.gz +%postun +%install_info_delete --info-dir=%{_infodir} %{_infodir}/%{name}.info.gz +%changelog diff --git a/tests/scripts/features/double_colon b/tests/scripts/features/double_colon index 1097775..02e8f83 100644 --- a/tests/scripts/features/double_colon +++ b/tests/scripts/features/double_colon @@ -23,7 +23,7 @@ all: baz foo:: f1.h ; @echo foo FIRST foo:: f2.h ; @echo foo SECOND -bar:: ; @echo aaa; sleep 1; echo aaa done +bar:: ; @echo aaa; sleep 4; echo aaa done bar:: ; @echo bbb baz:: ; @echo aaa diff --git a/tests/scripts/features/parallelism b/tests/scripts/features/parallelism index c702c26..4097489 100644 --- a/tests/scripts/features/parallelism +++ b/tests/scripts/features/parallelism @@ -27,9 +27,9 @@ else { run_make_test(" all : def_1 def_2 def_3 -def_1 : ; \@echo ONE; $sleep_command 3 ; echo TWO -def_2 : ; \@$sleep_command 2 ; echo THREE -def_3 : ; \@$sleep_command 1 ; echo FOUR", +def_1 : ; \@echo ONE; $sleep_command 12 ; echo TWO +def_2 : ; \@$sleep_command 8 ; echo THREE +def_3 : ; \@$sleep_command 4 ; echo FOUR", '-j4', "ONE\nFOUR\nTHREE\nTWO"); # Test parallelism with included files. Here we sleep/echo while @@ -38,8 +38,8 @@ def_3 : ; \@$sleep_command 1 ; echo FOUR", run_make_test(" all: 1 2; \@echo success -include 1.inc 2.inc -1.inc: ; \@echo ONE.inc; $sleep_command 2; echo TWO.inc; echo '1: ; \@echo ONE; $sleep_command 2; echo TWO' > \$\@ -2.inc: ; \@$sleep_command 1; echo THREE.inc; echo '2: ; \@$sleep_command 1; echo THREE' > \$\@", +1.inc: ; \@echo ONE.inc; $sleep_command 8; echo TWO.inc; echo '1: ; \@echo ONE; $sleep_command 8; echo TWO' > \$\@ +2.inc: ; \@$sleep_command 4; echo THREE.inc; echo '2: ; \@$sleep_command 4; echo THREE' > \$\@", "-j4", "ONE.inc\nTHREE.inc\nTWO.inc\nONE\nTHREE\nTWO\nsuccess\n", 0, 7); @@ -57,8 +57,8 @@ ifeq (\$(INC),yes) -include 1.inc 2.inc endif -1.inc: ; \@echo ONE.inc; $sleep_command 2; echo TWO.inc; echo '1: ; \@echo ONE; $sleep_command 2; echo TWO' > \$\@ -2.inc: ; \@$sleep_command 1; echo THREE.inc; echo '2: ; \@$sleep_command 1; echo THREE' > \$\@", +1.inc: ; \@echo ONE.inc; $sleep_command 8; echo TWO.inc; echo '1: ; \@echo ONE; $sleep_command 8; echo TWO' > \$\@ +2.inc: ; \@$sleep_command 4; echo THREE.inc; echo '2: ; \@$sleep_command 4; echo THREE' > \$\@", "-j4", "ONE.inc\nTHREE.inc\nTWO.inc\nONE\nTHREE\nTWO\nsuccess\n", 0, 7); @@ -74,40 +74,40 @@ rmfiles(qw(1.inc 2.inc)); run_make_test(" export HI = \$(shell \$(\$\@.CMD)) first.CMD = echo hi -second.CMD = $sleep_command 4; echo hi +second.CMD = $sleep_command 16; echo hi .PHONY: all first second all: first second -first second: ; \@echo \$\@; $sleep_command 1; echo \$\@", - '-j2', "first\nfirst\nsecond\nsecond", 0, 7); +first second: ; \@echo \$\@; $sleep_command 4; echo \$\@", + '-j2', "first\nfirst\nsecond\nsecond", 0, 28); # Michael Matz reported a bug where if make is running in # parallel without -k and two jobs die in a row, but not too close to each # other, then make will quit without waiting for the rest of the jobs to die. run_make_test(" -.PHONY: all fail.1 fail.2 fail.3 ok -all: fail.1 ok fail.2 fail.3 +.PHONY: all fail.3 fail.6 fail.9 ok +all: fail.3 ok fail.6 fail.9 -fail.1 fail.2 fail.3: +fail.3 fail.6 fail.9: \@$sleep_command \$(patsubst fail.%,%,\$\@) \@echo Fail \@exit 1 ok: - \@$sleep_command 4 + \@$sleep_command 12 \@echo Ok done", '-rR -j5', "Fail #MAKEFILE#:6: recipe for target 'fail.1' failed -#MAKE#: *** [fail.1] Error 1 +#MAKE#: *** [fail.3] Error 1 #MAKE#: *** Waiting for unfinished jobs.... Fail #MAKEFILE#:6: recipe for target 'fail.2' failed -#MAKE#: *** [fail.2] Error 1 +#MAKE#: *** [fail.6] Error 1 Fail #MAKEFILE#:6: recipe for target 'fail.3' failed -#MAKE#: *** [fail.3] Error 1 +#MAKE#: *** [fail.9] Error 1 Ok done", 512); diff --git a/tests/scripts/options/dash-l b/tests/scripts/options/dash-l index 0b0f196..a279989 100644 --- a/tests/scripts/options/dash-l +++ b/tests/scripts/options/dash-l @@ -25,7 +25,7 @@ SHELL = /bin/sh define test if [ ! -f test-file ]; then \ - echo >> test-file; sleep 2; rm -f test-file; \ + echo >> test-file; sleep 8; rm -f test-file; \ else \ echo $@ FAILED; \ fi @@ -46,7 +46,7 @@ $mkoptions = "-l 0.0001"; $mkoptions .= " -j 4" if ($parallel_jobs); # We have to wait longer than the default (5s). -&run_make_with_options($makefile, $mkoptions, &get_logfile, 0, 8); +&run_make_with_options($makefile, $mkoptions, &get_logfile, 0, 32); $slurp = &read_file_into_string (&get_logfile(1)); if ($slurp !~ /cannot enforce load limit/) { diff --git a/tests/test_driver.pl b/tests/test_driver.pl index 2f83270..efd9f22 100644 --- a/tests/test_driver.pl +++ b/tests/test_driver.pl @@ -50,7 +50,7 @@ $test_passed = 1; # Timeout in seconds. If the test takes longer than this we'll fail it. -$test_timeout = 5; +$test_timeout = 20; # Path to Perl $perl_name = $^X; -- cgit v1.2.3