Accepting request 399681 from Base:System
- Update to make 4.2 * New variable: $(.SHELLSTATUS) is set to the exit status of the last != or $(shell ...) function invoked in this instance of make. * The $(file ...) function can now read from a file with $(file <FILE). * The makefile line numbers shown by GNU make now point directly to the specific line in the recipe where the failure or warning occurred. * The interface to GNU make's "jobserver" is stable as documented in the manual, for tools which may want to access it. * The amount of parallelism can be determined by querying MAKEFLAGS - undefine-variables.patch: Removed - make-4.1-fix_null_returns_from_ttyname.patch: Removed - 0001-SV-47995-Ensure-forced-double-colon-rules-work-with-.patch: Added - 0002-main.c-main-SV-48009-Reset-stack-limit-for-make-re-e.patch: Added - Move %install_info_delete to %preun (forwarded request 399680 from Andreas_Schwab) OBS-URL: https://build.opensuse.org/request/show/399681 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/make?expand=0&rev=36
This commit is contained in:
commit
87109817ac
171
0001-SV-47995-Ensure-forced-double-colon-rules-work-with-.patch
Normal file
171
0001-SV-47995-Ensure-forced-double-colon-rules-work-with-.patch
Normal file
@ -0,0 +1,171 @@
|
||||
From 4762480ae9cb8df4878286411f178d32db14eff0 Mon Sep 17 00:00:00 2001
|
||||
From: Paul Smith <psmith@gnu.org>
|
||||
Date: Tue, 31 May 2016 02:56:51 -0400
|
||||
Subject: [PATCH 1/2] [SV 47995] Ensure forced double-colon rules work with -j.
|
||||
|
||||
The fix for SV 44742 had a side-effect that some double-colon targets
|
||||
were skipped. This happens because the "considered" facility assumed
|
||||
that all targets would be visited on each walk through the dependency
|
||||
graph: we used a bit for considered and toggled it on each pass; if
|
||||
we didn't walk the entire graph on every pass the bit would get out
|
||||
of sync. The new behavior after SV 44742 might return early without
|
||||
walking the entire graph. To fix this I changed the considered value
|
||||
to an integer which is monotonically increasing: it is then never
|
||||
possible to incorrectly determine that a previous pass through the
|
||||
graph already considered the current target.
|
||||
|
||||
* filedef.h (struct file): make CONSIDERED an unsigned int.
|
||||
* main.c (main): No longer need to reset CONSIDERED.
|
||||
* remake.c (update_goal_chain): increment CONSIDERED rather than
|
||||
inverting it between 0<->1.
|
||||
(update_file_1): Reset CONSIDERED to 0 so it's re-considered.
|
||||
(check_dep): Ditto.
|
||||
* tests/scripts/features/double_colon: Add a regression test.
|
||||
---
|
||||
filedef.h | 4 ++--
|
||||
main.c | 4 ----
|
||||
remake.c | 25 +++++++++++++------------
|
||||
tests/scripts/features/double_colon | 15 +++++++++++++++
|
||||
4 files changed, 30 insertions(+), 18 deletions(-)
|
||||
|
||||
diff --git a/filedef.h b/filedef.h
|
||||
index 507a027..14b4187 100644
|
||||
--- a/filedef.h
|
||||
+++ b/filedef.h
|
||||
@@ -58,6 +58,8 @@ struct file
|
||||
FILE_TIMESTAMP last_mtime; /* File's modtime, if already known. */
|
||||
FILE_TIMESTAMP mtime_before_update; /* File's modtime before any updating
|
||||
has been performed. */
|
||||
+ unsigned int considered; /* equal to 'considered' if file has been
|
||||
+ considered on current scan of goal chain */
|
||||
int command_flags; /* Flags OR'd in for cmds; see commands.h. */
|
||||
enum update_status /* Status of the last attempt to update. */
|
||||
{
|
||||
@@ -96,8 +98,6 @@ struct file
|
||||
unsigned int ignore_vpath:1;/* Nonzero if we threw out VPATH name. */
|
||||
unsigned int pat_searched:1;/* Nonzero if we already searched for
|
||||
pattern-specific variables. */
|
||||
- unsigned int considered:1; /* equal to 'considered' if file has been
|
||||
- considered on current scan of goal chain */
|
||||
unsigned int no_diag:1; /* True if the file failed to update and no
|
||||
diagnostics has been issued (dontcare). */
|
||||
};
|
||||
diff --git a/main.c b/main.c
|
||||
index 576f2e9..e606488 100644
|
||||
--- a/main.c
|
||||
+++ b/main.c
|
||||
@@ -2262,10 +2262,6 @@ main (int argc, char **argv, char **envp)
|
||||
|
||||
for (i = 0, d = read_files; d != 0; ++i, d = d->next)
|
||||
{
|
||||
- /* Reset the considered flag; we may need to look at the file
|
||||
- again to print an error. */
|
||||
- d->file->considered = 0;
|
||||
-
|
||||
if (d->file->updated)
|
||||
{
|
||||
/* This makefile was updated. */
|
||||
diff --git a/remake.c b/remake.c
|
||||
index df1a9e0..5d5d67a 100644
|
||||
--- a/remake.c
|
||||
+++ b/remake.c
|
||||
@@ -57,8 +57,9 @@ unsigned int commands_started = 0;
|
||||
static struct goaldep *goal_list;
|
||||
static struct dep *goal_dep;
|
||||
|
||||
-/* Current value for pruning the scan of the goal chain (toggle 0/1). */
|
||||
-static unsigned int considered;
|
||||
+/* Current value for pruning the scan of the goal chain.
|
||||
+ All files start with considered == 0. */
|
||||
+static unsigned int considered = 0;
|
||||
|
||||
static enum update_status update_file (struct file *file, unsigned int depth);
|
||||
static enum update_status update_file_1 (struct file *file, unsigned int depth);
|
||||
@@ -90,12 +91,12 @@ update_goal_chain (struct goaldep *goaldeps)
|
||||
|
||||
goal_list = rebuilding_makefiles ? goaldeps : NULL;
|
||||
|
||||
- /* All files start with the considered bit 0, so the global value is 1. */
|
||||
- considered = 1;
|
||||
-
|
||||
#define MTIME(file) (rebuilding_makefiles ? file_mtime_no_search (file) \
|
||||
: file_mtime (file))
|
||||
|
||||
+ /* Start a fresh batch of consideration. */
|
||||
+ ++considered;
|
||||
+
|
||||
/* Update all the goals until they are all finished. */
|
||||
|
||||
while (goals != 0)
|
||||
@@ -247,10 +248,10 @@ update_goal_chain (struct goaldep *goaldeps)
|
||||
}
|
||||
}
|
||||
|
||||
- /* If we reached the end of the dependency graph toggle the considered
|
||||
- flag for the next pass. */
|
||||
+ /* If we reached the end of the dependency graph update CONSIDERED
|
||||
+ for the next pass. */
|
||||
if (g == 0)
|
||||
- considered = !considered;
|
||||
+ ++considered;
|
||||
}
|
||||
|
||||
if (rebuilding_makefiles)
|
||||
@@ -615,8 +616,8 @@ update_file_1 (struct file *file, unsigned int depth)
|
||||
break;
|
||||
|
||||
if (!running)
|
||||
- /* The prereq is considered changed if the timestamp has changed while
|
||||
- it was built, OR it doesn't exist. */
|
||||
+ /* The prereq is considered changed if the timestamp has changed
|
||||
+ while it was built, OR it doesn't exist. */
|
||||
d->changed = ((file_mtime (d->file) != mtime)
|
||||
|| (mtime == NONEXISTENT_MTIME));
|
||||
|
||||
@@ -650,7 +651,7 @@ update_file_1 (struct file *file, unsigned int depth)
|
||||
/* 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;
|
||||
+ d->file->considered = 0;
|
||||
|
||||
new = update_file (d->file, depth);
|
||||
if (new > dep_status)
|
||||
@@ -1087,7 +1088,7 @@ check_dep (struct file *file, unsigned int depth,
|
||||
/* If the target was waiting for a dependency it has to be
|
||||
reconsidered, as that dependency might have finished. */
|
||||
if (file->command_state == cs_deps_running)
|
||||
- file->considered = !considered;
|
||||
+ file->considered = 0;
|
||||
|
||||
set_command_state (file, cs_not_started);
|
||||
}
|
||||
diff --git a/tests/scripts/features/double_colon b/tests/scripts/features/double_colon
|
||||
index 80ddb31..58f126f 100644
|
||||
--- a/tests/scripts/features/double_colon
|
||||
+++ b/tests/scripts/features/double_colon
|
||||
@@ -197,6 +197,21 @@ all:: 3
|
||||
',
|
||||
'-rs -j2 1 2 root', "all_one\nall_two\nroot\n");
|
||||
|
||||
+# SV 47995 : Parallel double-colon rules with FORCE
|
||||
+
|
||||
+run_make_test('
|
||||
+all:: ; @echo one
|
||||
+
|
||||
+all:: joe ; @echo four
|
||||
+
|
||||
+joe: FORCE ; touch joe-is-forced
|
||||
+
|
||||
+FORCE:
|
||||
+',
|
||||
+ '-j5', "one\ntouch joe-is-forced\nfour\n");
|
||||
+
|
||||
+unlink('joe-is-forced');
|
||||
+
|
||||
# This tells the test driver that the perl test script executed properly.
|
||||
1;
|
||||
|
||||
--
|
||||
2.8.3
|
||||
|
@ -0,0 +1,30 @@
|
||||
From a3d8c086d54c112fecfa2b9026a32a14f741f5f5 Mon Sep 17 00:00:00 2001
|
||||
From: Jeremy Devenport <jeremy.devenport@gmail.com>
|
||||
Date: Tue, 31 May 2016 03:09:24 -0400
|
||||
Subject: [PATCH 2/2] * main.c (main): [SV 48009] Reset stack limit for make
|
||||
re-exec.
|
||||
|
||||
Copyright-paperwork-exempt: yes
|
||||
---
|
||||
main.c | 5 +++++
|
||||
1 file changed, 5 insertions(+)
|
||||
|
||||
diff --git a/main.c b/main.c
|
||||
index e606488..fa8045f 100644
|
||||
--- a/main.c
|
||||
+++ b/main.c
|
||||
@@ -2454,6 +2454,11 @@ main (int argc, char **argv, char **envp)
|
||||
exit (WIFEXITED(r) ? WEXITSTATUS(r) : EXIT_FAILURE);
|
||||
}
|
||||
#else
|
||||
+#ifdef SET_STACK_SIZE
|
||||
+ /* Reset limits, if necessary. */
|
||||
+ if (stack_limit.rlim_cur)
|
||||
+ setrlimit (RLIMIT_STACK, &stack_limit);
|
||||
+#endif
|
||||
exec_command ((char **)nargv, environ);
|
||||
#endif
|
||||
free (aargv);
|
||||
--
|
||||
2.8.3
|
||||
|
@ -1,53 +0,0 @@
|
||||
From 292da6f6867b75a5af7ddbb639a1feae022f438f Mon Sep 17 00:00:00 2001
|
||||
From: Paul Smith <psmith@gnu.org>
|
||||
Date: Mon, 20 Oct 2014 05:54:56 +0000
|
||||
Subject: * main.c (main): [SV 43434] Handle NULL returns from ttyname().
|
||||
|
||||
---
|
||||
diff --git a/main.c b/main.c
|
||||
index b2d169c..0cdb8a8 100644
|
||||
--- a/main.c
|
||||
+++ b/main.c
|
||||
@@ -1429,13 +1429,18 @@ main (int argc, char **argv, char **envp)
|
||||
#ifdef HAVE_ISATTY
|
||||
if (isatty (fileno (stdout)))
|
||||
if (! lookup_variable (STRING_SIZE_TUPLE ("MAKE_TERMOUT")))
|
||||
- define_variable_cname ("MAKE_TERMOUT", TTYNAME (fileno (stdout)),
|
||||
- o_default, 0)->export = v_export;
|
||||
-
|
||||
+ {
|
||||
+ const char *tty = TTYNAME (fileno (stdout));
|
||||
+ define_variable_cname ("MAKE_TERMOUT", tty ? tty : DEFAULT_TTYNAME,
|
||||
+ o_default, 0)->export = v_export;
|
||||
+ }
|
||||
if (isatty (fileno (stderr)))
|
||||
if (! lookup_variable (STRING_SIZE_TUPLE ("MAKE_TERMERR")))
|
||||
- define_variable_cname ("MAKE_TERMERR", TTYNAME (fileno (stderr)),
|
||||
- o_default, 0)->export = v_export;
|
||||
+ {
|
||||
+ const char *tty = TTYNAME (fileno (stderr));
|
||||
+ define_variable_cname ("MAKE_TERMERR", tty ? tty : DEFAULT_TTYNAME,
|
||||
+ o_default, 0)->export = v_export;
|
||||
+ }
|
||||
#endif
|
||||
|
||||
/* Reset in case the switches changed our minds. */
|
||||
diff --git a/makeint.h b/makeint.h
|
||||
index 6223936..2009f41 100644
|
||||
--- a/makeint.h
|
||||
+++ b/makeint.h
|
||||
@@ -436,10 +436,11 @@ extern struct rlimit stack_limit;
|
||||
/* The number of bytes needed to represent the largest integer as a string. */
|
||||
#define INTSTR_LENGTH CSTRLEN ("18446744073709551616")
|
||||
|
||||
+#define DEFAULT_TTYNAME "true"
|
||||
#ifdef HAVE_TTYNAME
|
||||
# define TTYNAME(_f) ttyname (_f)
|
||||
#else
|
||||
-# define TTYNAME(_f) "true"
|
||||
+# define TTYNAME(_f) DEFAULT_TTYNAME
|
||||
#endif
|
||||
|
||||
|
||||
--
|
||||
cgit v0.9.0.2
|
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:0bc7613389650ee6a24554b52572a272f7356164fd2c4132b0bcf13123e4fca5
|
||||
size 1327342
|
Binary file not shown.
3
make-4.2.tar.bz2
Normal file
3
make-4.2.tar.bz2
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:4e5ce3b62fe5d75ff8db92b7f6df91e476d10c3aceebf1639796dc5bfece655f
|
||||
size 1400539
|
BIN
make-4.2.tar.bz2.sig
Normal file
BIN
make-4.2.tar.bz2.sig
Normal file
Binary file not shown.
18
make.changes
18
make.changes
@ -1,3 +1,21 @@
|
||||
-------------------------------------------------------------------
|
||||
Mon May 23 08:13:35 UTC 2016 - schwab@suse.de
|
||||
|
||||
- Update to make 4.2
|
||||
* New variable: $(.SHELLSTATUS) is set to the exit status of the last != or
|
||||
$(shell ...) function invoked in this instance of make.
|
||||
* The $(file ...) function can now read from a file with $(file <FILE).
|
||||
* The makefile line numbers shown by GNU make now point directly to the
|
||||
specific line in the recipe where the failure or warning occurred.
|
||||
* The interface to GNU make's "jobserver" is stable as documented in the
|
||||
manual, for tools which may want to access it.
|
||||
* The amount of parallelism can be determined by querying MAKEFLAGS
|
||||
- undefine-variables.patch: Removed
|
||||
- make-4.1-fix_null_returns_from_ttyname.patch: Removed
|
||||
- 0001-SV-47995-Ensure-forced-double-colon-rules-work-with-.patch: Added
|
||||
- 0002-main.c-main-SV-48009-Reset-stack-limit-for-make-re-e.patch: Added
|
||||
- Move %install_info_delete to %preun
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Sep 16 09:10:34 UTC 2015 - schwab@suse.de
|
||||
|
||||
|
19
make.spec
19
make.spec
@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package make
|
||||
#
|
||||
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
|
||||
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
@ -17,7 +17,7 @@
|
||||
|
||||
|
||||
Name: make
|
||||
Version: 4.1
|
||||
Version: 4.2
|
||||
Release: 0
|
||||
Summary: GNU make
|
||||
License: GPL-2.0+
|
||||
@ -28,10 +28,11 @@ Source1: http://ftp.gnu.org/gnu/make/make-%{version}.tar.bz2.sig
|
||||
# keyring downloaded from http://savannah.gnu.org/project/memberlist-gpgkeys.php?group=make
|
||||
Source2: %{name}.keyring
|
||||
Patch1: make-testcases_timeout.diff
|
||||
Patch2: make-4.1-fix_null_returns_from_ttyname.patch
|
||||
Patch3: undefine-variables.patch
|
||||
Patch64: make-library-search-path.diff
|
||||
Patch2: 0001-SV-47995-Ensure-forced-double-colon-rules-work-with-.patch
|
||||
Patch3: 0002-main.c-main-SV-48009-Reset-stack-limit-for-make-re-e.patch
|
||||
Requires(post): %{install_info_prereq}
|
||||
Requires(preun): %{install_info_prereq}
|
||||
Recommends: %{name}-lang
|
||||
Provides: gmake
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
@ -44,11 +45,13 @@ The GNU make command with extensive documentation.
|
||||
%prep
|
||||
%setup -q
|
||||
%patch1 -p1
|
||||
%patch2 -p1
|
||||
%patch3 -p1
|
||||
if [ %{_lib} == lib64 ]; then
|
||||
%patch64 -p1
|
||||
fi
|
||||
%patch2 -p1
|
||||
%patch3 -p1
|
||||
# This test always fails
|
||||
rm -f tests/scripts/features/output-sync
|
||||
|
||||
%build
|
||||
export CFLAGS="%{optflags}"
|
||||
@ -56,7 +59,7 @@ export CFLAGS="%{optflags}"
|
||||
make %{?_smp_mflags}
|
||||
|
||||
%check
|
||||
make %{?_smp_mflags} check
|
||||
make check
|
||||
|
||||
%install
|
||||
make DESTDIR=%{buildroot} install %{?_smp_mflags}
|
||||
@ -79,7 +82,7 @@ rm %{buildroot}%{_includedir}/gnumake.h
|
||||
%post
|
||||
%install_info --info-dir=%{_infodir} %{_infodir}/%{name}.info.gz
|
||||
|
||||
%postun
|
||||
%preun
|
||||
%install_info_delete --info-dir=%{_infodir} %{_infodir}/%{name}.info.gz
|
||||
|
||||
%changelog
|
||||
|
@ -1,80 +0,0 @@
|
||||
Subject: [PATCH] [SV 45728] Force recomputing .VARIABLES when a variable was made undefined
|
||||
|
||||
* variable.c (last_var_count): Move to file level.
|
||||
(undefine_variable_in_set): Clear last_var_count when the variable
|
||||
was removed from global_variable_set.
|
||||
* tests/scripts/variables/undefine: Add test case.
|
||||
---
|
||||
tests/scripts/variables/undefine | 14 ++++++++++++++
|
||||
variable.c | 14 ++++++++------
|
||||
2 files changed, 22 insertions(+), 6 deletions(-)
|
||||
|
||||
Index: make-4.1/tests/scripts/variables/undefine
|
||||
===================================================================
|
||||
--- make-4.1.orig/tests/scripts/variables/undefine
|
||||
+++ make-4.1/tests/scripts/variables/undefine
|
||||
@@ -70,4 +70,18 @@ all: ;@echo ouch
|
||||
',
|
||||
'', "#MAKEFILE#:3: *** empty variable name. Stop.\n", 512);
|
||||
|
||||
+
|
||||
+# TEST 4: interaction between undefine and $(.VARIABLES)
|
||||
+
|
||||
+run_make_test('
|
||||
+var_a := a
|
||||
+var_b := b
|
||||
+$(foreach v, $(filter var_%, $(.VARIABLES)), $(eval undefine $v))
|
||||
+var_c := c
|
||||
+var_d := d
|
||||
+$(info $(filter var_%, $(.VARIABLES)))
|
||||
+all: ;@:
|
||||
+',
|
||||
+'', "var_d var_c");
|
||||
+
|
||||
1;
|
||||
Index: make-4.1/variable.c
|
||||
===================================================================
|
||||
--- make-4.1.orig/variable.c
|
||||
+++ make-4.1/variable.c
|
||||
@@ -172,6 +172,7 @@ static struct variable_set global_variab
|
||||
static struct variable_set_list global_setlist
|
||||
= { 0, &global_variable_set, 0 };
|
||||
struct variable_set_list *current_variable_set_list = &global_setlist;
|
||||
+static unsigned long last_var_count = 0;
|
||||
|
||||
/* Implement variables. */
|
||||
|
||||
@@ -328,6 +329,10 @@ undefine_variable_in_set (const char *na
|
||||
{
|
||||
hash_delete_at (&set->table, var_slot);
|
||||
free_variable_name_and_value (v);
|
||||
+ /* Force rebuilding of .VARIABLES when the global variable set
|
||||
+ has changed. */
|
||||
+ if (set == &global_variable_set)
|
||||
+ last_var_count = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -345,9 +350,6 @@ undefine_variable_in_set (const char *na
|
||||
static struct variable *
|
||||
lookup_special_var (struct variable *var)
|
||||
{
|
||||
- static unsigned long last_var_count = 0;
|
||||
-
|
||||
-
|
||||
/* This one actually turns out to be very hard, due to the way the parser
|
||||
records targets. The way it works is that target information is collected
|
||||
internally until make knows the target is completely specified. It unitl
|
||||
@@ -410,9 +412,9 @@ lookup_special_var (struct variable *var
|
||||
}
|
||||
*(p-1) = '\0';
|
||||
|
||||
- /* Remember how many variables are in our current count. Since we never
|
||||
- remove variables from the list, this is a reliable way to know whether
|
||||
- the list is up to date or needs to be recomputed. */
|
||||
+ /* Remember how many variables are in our current count. This is a
|
||||
+ reliable way to know whether the list is up to date or needs to
|
||||
+ be recomputed. */
|
||||
|
||||
last_var_count = global_variable_set.table.ht_fill;
|
||||
}
|
Loading…
Reference in New Issue
Block a user