1 |
commit: ab5370ff4e2346be6fe3f813db7f81ab25487eae |
2 |
Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue May 31 09:04:55 2016 +0000 |
4 |
Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue May 31 09:06:40 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ab5370ff |
7 |
|
8 |
sys-devel/make: Revbump to add upstream fix for bug #583812. |
9 |
|
10 |
Package-Manager: portage-2.2.28 |
11 |
Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org> |
12 |
|
13 |
.../make/files/make-4.2-double_colon_targets.patch | 164 +++++++++++++++++++++ |
14 |
.../make-4.2-reset_stack_limit_for_re-exec.patch | 25 ++++ |
15 |
sys-devel/make/make-4.2-r2.ebuild | 51 +++++++ |
16 |
3 files changed, 240 insertions(+) |
17 |
|
18 |
diff --git a/sys-devel/make/files/make-4.2-double_colon_targets.patch b/sys-devel/make/files/make-4.2-double_colon_targets.patch |
19 |
new file mode 100644 |
20 |
index 0000000..642bd42 |
21 |
--- /dev/null |
22 |
+++ b/sys-devel/make/files/make-4.2-double_colon_targets.patch |
23 |
@@ -0,0 +1,164 @@ |
24 |
+From 4762480ae9cb8df4878286411f178d32db14eff0 Mon Sep 17 00:00:00 2001 |
25 |
+From: Paul Smith <psmith@×××.org> |
26 |
+Date: Tue, 31 May 2016 06:56:51 +0000 |
27 |
+Subject: [SV 47995] Ensure forced double-colon rules work with -j. |
28 |
+ |
29 |
+The fix for SV 44742 had a side-effect that some double-colon targets |
30 |
+were skipped. This happens because the "considered" facility assumed |
31 |
+that all targets would be visited on each walk through the dependency |
32 |
+graph: we used a bit for considered and toggled it on each pass; if |
33 |
+we didn't walk the entire graph on every pass the bit would get out |
34 |
+of sync. The new behavior after SV 44742 might return early without |
35 |
+walking the entire graph. To fix this I changed the considered value |
36 |
+to an integer which is monotonically increasing: it is then never |
37 |
+possible to incorrectly determine that a previous pass through the |
38 |
+graph already considered the current target. |
39 |
+ |
40 |
+* filedef.h (struct file): make CONSIDERED an unsigned int. |
41 |
+* main.c (main): No longer need to reset CONSIDERED. |
42 |
+* remake.c (update_goal_chain): increment CONSIDERED rather than |
43 |
+inverting it between 0<->1. |
44 |
+(update_file_1): Reset CONSIDERED to 0 so it's re-considered. |
45 |
+(check_dep): Ditto. |
46 |
+* tests/scripts/features/double_colon: Add a regression test. |
47 |
+--- |
48 |
+diff --git a/filedef.h b/filedef.h |
49 |
+index 507a027..14b4187 100644 |
50 |
+--- a/filedef.h |
51 |
++++ b/filedef.h |
52 |
+@@ -58,6 +58,8 @@ struct file |
53 |
+ FILE_TIMESTAMP last_mtime; /* File's modtime, if already known. */ |
54 |
+ FILE_TIMESTAMP mtime_before_update; /* File's modtime before any updating |
55 |
+ has been performed. */ |
56 |
++ unsigned int considered; /* equal to 'considered' if file has been |
57 |
++ considered on current scan of goal chain */ |
58 |
+ int command_flags; /* Flags OR'd in for cmds; see commands.h. */ |
59 |
+ enum update_status /* Status of the last attempt to update. */ |
60 |
+ { |
61 |
+@@ -96,8 +98,6 @@ struct file |
62 |
+ unsigned int ignore_vpath:1;/* Nonzero if we threw out VPATH name. */ |
63 |
+ unsigned int pat_searched:1;/* Nonzero if we already searched for |
64 |
+ pattern-specific variables. */ |
65 |
+- unsigned int considered:1; /* equal to 'considered' if file has been |
66 |
+- considered on current scan of goal chain */ |
67 |
+ unsigned int no_diag:1; /* True if the file failed to update and no |
68 |
+ diagnostics has been issued (dontcare). */ |
69 |
+ }; |
70 |
+diff --git a/main.c b/main.c |
71 |
+index 576f2e9..e606488 100644 |
72 |
+--- a/main.c |
73 |
++++ b/main.c |
74 |
+@@ -2262,10 +2262,6 @@ main (int argc, char **argv, char **envp) |
75 |
+ |
76 |
+ for (i = 0, d = read_files; d != 0; ++i, d = d->next) |
77 |
+ { |
78 |
+- /* Reset the considered flag; we may need to look at the file |
79 |
+- again to print an error. */ |
80 |
+- d->file->considered = 0; |
81 |
+- |
82 |
+ if (d->file->updated) |
83 |
+ { |
84 |
+ /* This makefile was updated. */ |
85 |
+diff --git a/remake.c b/remake.c |
86 |
+index df1a9e0..5d5d67a 100644 |
87 |
+--- a/remake.c |
88 |
++++ b/remake.c |
89 |
+@@ -57,8 +57,9 @@ unsigned int commands_started = 0; |
90 |
+ static struct goaldep *goal_list; |
91 |
+ static struct dep *goal_dep; |
92 |
+ |
93 |
+-/* Current value for pruning the scan of the goal chain (toggle 0/1). */ |
94 |
+-static unsigned int considered; |
95 |
++/* Current value for pruning the scan of the goal chain. |
96 |
++ All files start with considered == 0. */ |
97 |
++static unsigned int considered = 0; |
98 |
+ |
99 |
+ static enum update_status update_file (struct file *file, unsigned int depth); |
100 |
+ static enum update_status update_file_1 (struct file *file, unsigned int depth); |
101 |
+@@ -90,12 +91,12 @@ update_goal_chain (struct goaldep *goaldeps) |
102 |
+ |
103 |
+ goal_list = rebuilding_makefiles ? goaldeps : NULL; |
104 |
+ |
105 |
+- /* All files start with the considered bit 0, so the global value is 1. */ |
106 |
+- considered = 1; |
107 |
+- |
108 |
+ #define MTIME(file) (rebuilding_makefiles ? file_mtime_no_search (file) \ |
109 |
+ : file_mtime (file)) |
110 |
+ |
111 |
++ /* Start a fresh batch of consideration. */ |
112 |
++ ++considered; |
113 |
++ |
114 |
+ /* Update all the goals until they are all finished. */ |
115 |
+ |
116 |
+ while (goals != 0) |
117 |
+@@ -247,10 +248,10 @@ update_goal_chain (struct goaldep *goaldeps) |
118 |
+ } |
119 |
+ } |
120 |
+ |
121 |
+- /* If we reached the end of the dependency graph toggle the considered |
122 |
+- flag for the next pass. */ |
123 |
++ /* If we reached the end of the dependency graph update CONSIDERED |
124 |
++ for the next pass. */ |
125 |
+ if (g == 0) |
126 |
+- considered = !considered; |
127 |
++ ++considered; |
128 |
+ } |
129 |
+ |
130 |
+ if (rebuilding_makefiles) |
131 |
+@@ -615,8 +616,8 @@ update_file_1 (struct file *file, unsigned int depth) |
132 |
+ break; |
133 |
+ |
134 |
+ if (!running) |
135 |
+- /* The prereq is considered changed if the timestamp has changed while |
136 |
+- it was built, OR it doesn't exist. */ |
137 |
++ /* The prereq is considered changed if the timestamp has changed |
138 |
++ while it was built, OR it doesn't exist. */ |
139 |
+ d->changed = ((file_mtime (d->file) != mtime) |
140 |
+ || (mtime == NONEXISTENT_MTIME)); |
141 |
+ |
142 |
+@@ -650,7 +651,7 @@ update_file_1 (struct file *file, unsigned int depth) |
143 |
+ /* We may have already considered this file, when we didn't know |
144 |
+ we'd need to update it. Force update_file() to consider it and |
145 |
+ not prune it. */ |
146 |
+- d->file->considered = !considered; |
147 |
++ d->file->considered = 0; |
148 |
+ |
149 |
+ new = update_file (d->file, depth); |
150 |
+ if (new > dep_status) |
151 |
+@@ -1087,7 +1088,7 @@ check_dep (struct file *file, unsigned int depth, |
152 |
+ /* If the target was waiting for a dependency it has to be |
153 |
+ reconsidered, as that dependency might have finished. */ |
154 |
+ if (file->command_state == cs_deps_running) |
155 |
+- file->considered = !considered; |
156 |
++ file->considered = 0; |
157 |
+ |
158 |
+ set_command_state (file, cs_not_started); |
159 |
+ } |
160 |
+diff --git a/tests/scripts/features/double_colon b/tests/scripts/features/double_colon |
161 |
+index 80ddb31..58f126f 100644 |
162 |
+--- a/tests/scripts/features/double_colon |
163 |
++++ b/tests/scripts/features/double_colon |
164 |
+@@ -197,6 +197,21 @@ all:: 3 |
165 |
+ ', |
166 |
+ '-rs -j2 1 2 root', "all_one\nall_two\nroot\n"); |
167 |
+ |
168 |
++# SV 47995 : Parallel double-colon rules with FORCE |
169 |
++ |
170 |
++run_make_test(' |
171 |
++all:: ; @echo one |
172 |
++ |
173 |
++all:: joe ; @echo four |
174 |
++ |
175 |
++joe: FORCE ; touch joe-is-forced |
176 |
++ |
177 |
++FORCE: |
178 |
++', |
179 |
++ '-j5', "one\ntouch joe-is-forced\nfour\n"); |
180 |
++ |
181 |
++unlink('joe-is-forced'); |
182 |
++ |
183 |
+ # This tells the test driver that the perl test script executed properly. |
184 |
+ 1; |
185 |
+ |
186 |
+-- |
187 |
+cgit v0.9.0.2 |
188 |
|
189 |
diff --git a/sys-devel/make/files/make-4.2-reset_stack_limit_for_re-exec.patch b/sys-devel/make/files/make-4.2-reset_stack_limit_for_re-exec.patch |
190 |
new file mode 100644 |
191 |
index 0000000..3844ff1 |
192 |
--- /dev/null |
193 |
+++ b/sys-devel/make/files/make-4.2-reset_stack_limit_for_re-exec.patch |
194 |
@@ -0,0 +1,25 @@ |
195 |
+From a3d8c086d54c112fecfa2b9026a32a14f741f5f5 Mon Sep 17 00:00:00 2001 |
196 |
+From: Jeremy Devenport <jeremy.devenport@×××××.com> |
197 |
+Date: Tue, 31 May 2016 07:09:24 +0000 |
198 |
+Subject: * main.c (main): [SV 48009] Reset stack limit for make re-exec. |
199 |
+ |
200 |
+Copyright-paperwork-exempt: yes |
201 |
+--- |
202 |
+diff --git a/main.c b/main.c |
203 |
+index e606488..fa8045f 100644 |
204 |
+--- a/main.c |
205 |
++++ b/main.c |
206 |
+@@ -2454,6 +2454,11 @@ main (int argc, char **argv, char **envp) |
207 |
+ exit (WIFEXITED(r) ? WEXITSTATUS(r) : EXIT_FAILURE); |
208 |
+ } |
209 |
+ #else |
210 |
++#ifdef SET_STACK_SIZE |
211 |
++ /* Reset limits, if necessary. */ |
212 |
++ if (stack_limit.rlim_cur) |
213 |
++ setrlimit (RLIMIT_STACK, &stack_limit); |
214 |
++#endif |
215 |
+ exec_command ((char **)nargv, environ); |
216 |
+ #endif |
217 |
+ free (aargv); |
218 |
+-- |
219 |
+cgit v0.9.0.2 |
220 |
|
221 |
diff --git a/sys-devel/make/make-4.2-r2.ebuild b/sys-devel/make/make-4.2-r2.ebuild |
222 |
new file mode 100644 |
223 |
index 0000000..11fb619 |
224 |
--- /dev/null |
225 |
+++ b/sys-devel/make/make-4.2-r2.ebuild |
226 |
@@ -0,0 +1,51 @@ |
227 |
+# Copyright 1999-2016 Gentoo Foundation |
228 |
+# Distributed under the terms of the GNU General Public License v2 |
229 |
+# $Id$ |
230 |
+ |
231 |
+EAPI=5 |
232 |
+ |
233 |
+inherit flag-o-matic eutils |
234 |
+ |
235 |
+DESCRIPTION="Standard tool to compile source trees" |
236 |
+HOMEPAGE="https://www.gnu.org/software/make/make.html" |
237 |
+SRC_URI="mirror://gnu//make/${P}.tar.bz2" |
238 |
+ |
239 |
+LICENSE="GPL-3+" |
240 |
+SLOT="0" |
241 |
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~hppa-hpux ~ia64-hpux ~x86-interix ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" |
242 |
+IUSE="guile nls static" |
243 |
+ |
244 |
+CDEPEND="guile? ( >=dev-scheme/guile-1.8:= )" |
245 |
+DEPEND="${CDEPEND} |
246 |
+ nls? ( sys-devel/gettext )" |
247 |
+RDEPEND="${CDEPEND} |
248 |
+ nls? ( virtual/libintl )" |
249 |
+ |
250 |
+PATCHES=( |
251 |
+ "${FILESDIR}"/${PN}-3.82-darwin-library_search-dylib.patch |
252 |
+ "${FILESDIR}"/${PN}-4.2-double_colon_targets.patch |
253 |
+ "${FILESDIR}"/${PN}-4.2-reset_stack_limit_for_re-exec.patch |
254 |
+) |
255 |
+ |
256 |
+src_prepare() { |
257 |
+ epatch "${PATCHES[@]}" |
258 |
+} |
259 |
+ |
260 |
+src_configure() { |
261 |
+ use static && append-ldflags -static |
262 |
+ econf \ |
263 |
+ --program-prefix=g \ |
264 |
+ $(use_with guile) \ |
265 |
+ $(use_enable nls) |
266 |
+} |
267 |
+ |
268 |
+src_install() { |
269 |
+ emake DESTDIR="${D}" install |
270 |
+ dodoc AUTHORS NEWS README* |
271 |
+ if [[ ${USERLAND} == "GNU" ]] ; then |
272 |
+ # we install everywhere as 'gmake' but on GNU systems, |
273 |
+ # symlink 'make' to 'gmake' |
274 |
+ dosym gmake /usr/bin/make |
275 |
+ dosym gmake.1 /usr/share/man/man1/make.1 |
276 |
+ fi |
277 |
+} |