1 |
vapier 11/12/03 00:57:25 |
2 |
|
3 |
Added: make-3.82-parallel-remake.patch |
4 |
make-3.82-copy-on-expand.patch |
5 |
make-3.82-long-cmdline.patch |
6 |
make-3.82-oneshell.patch |
7 |
Log: |
8 |
Add some more fixes from upstream, and forward port the long cmdline patch from 3.81 #300867 by Alexander Vershilov. |
9 |
|
10 |
(Portage version: 2.2.0_alpha75/cvs/Linux x86_64) |
11 |
|
12 |
Revision Changes Path |
13 |
1.1 sys-devel/make/files/make-3.82-parallel-remake.patch |
14 |
|
15 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-devel/make/files/make-3.82-parallel-remake.patch?rev=1.1&view=markup |
16 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-devel/make/files/make-3.82-parallel-remake.patch?rev=1.1&content-type=text/plain |
17 |
|
18 |
Index: make-3.82-parallel-remake.patch |
19 |
=================================================================== |
20 |
fix from upstream cvs |
21 |
|
22 |
---------------------------- |
23 |
revision 1.247 |
24 |
date: 2011-09-18 19:39:26 -0400; author: psmith; state: Exp; lines: +5 -3; commitid: 07NxO4T5PiWC82Av; |
25 |
When we re-exec the master makefile in a jobserver environment, ensure |
26 |
that MAKEFLAGS is set properly so the re-exec'd make runs in parallel. |
27 |
See Savannah bug #33873. |
28 |
|
29 |
Index: main.c |
30 |
=================================================================== |
31 |
RCS file: /sources/make/make/main.c,v |
32 |
retrieving revision 1.246 |
33 |
retrieving revision 1.247 |
34 |
diff -u -p -r1.246 -r1.247 |
35 |
--- main.c 29 Aug 2010 23:05:27 -0000 1.246 |
36 |
+++ main.c 18 Sep 2011 23:39:26 -0000 1.247 |
37 |
@@ -2089,6 +2089,11 @@ main (int argc, char **argv, char **envp |
38 |
|
39 |
++restarts; |
40 |
|
41 |
+ /* If we're re-exec'ing the first make, put back the number of |
42 |
+ job slots so define_makefiles() will get it right. */ |
43 |
+ if (master_job_slots) |
44 |
+ job_slots = master_job_slots; |
45 |
+ |
46 |
/* Reset makeflags in case they were changed. */ |
47 |
{ |
48 |
const char *pv = define_makeflags (1, 1); |
49 |
@@ -2825,9 +2830,6 @@ define_makeflags (int all, int makefile) |
50 |
&& (*(unsigned int *) cs->value_ptr == |
51 |
*(unsigned int *) cs->noarg_value)) |
52 |
ADD_FLAG ("", 0); /* Optional value omitted; see below. */ |
53 |
- else if (cs->c == 'j') |
54 |
- /* Special case for `-j'. */ |
55 |
- ADD_FLAG ("1", 1); |
56 |
else |
57 |
{ |
58 |
char *buf = alloca (30); |
59 |
|
60 |
|
61 |
|
62 |
1.1 sys-devel/make/files/make-3.82-copy-on-expand.patch |
63 |
|
64 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-devel/make/files/make-3.82-copy-on-expand.patch?rev=1.1&view=markup |
65 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-devel/make/files/make-3.82-copy-on-expand.patch?rev=1.1&content-type=text/plain |
66 |
|
67 |
Index: make-3.82-copy-on-expand.patch |
68 |
=================================================================== |
69 |
fix from upstream cvs |
70 |
|
71 |
---------------------------- |
72 |
revision 1.58 |
73 |
date: 2011-08-29 12:20:19 -0400; author: psmith; state: Exp; lines: +7 -13; commitid: MdH0jSxpuIy7mqxv; |
74 |
Save strings we're expanding in case an embedded eval causes them |
75 |
to be freed (if they're the value of a variable that's reset for example). |
76 |
See Savannah patch #7534 |
77 |
|
78 |
Index: expand.c |
79 |
=================================================================== |
80 |
RCS file: /sources/make/make/expand.c,v |
81 |
retrieving revision 1.57 |
82 |
retrieving revision 1.58 |
83 |
diff -u -p -r1.57 -r1.58 |
84 |
--- expand.c 7 May 2011 20:03:49 -0000 1.57 |
85 |
+++ expand.c 29 Aug 2011 16:20:19 -0000 1.58 |
86 |
@@ -197,7 +197,7 @@ variable_expand_string (char *line, cons |
87 |
{ |
88 |
struct variable *v; |
89 |
const char *p, *p1; |
90 |
- char *abuf = NULL; |
91 |
+ char *save; |
92 |
char *o; |
93 |
unsigned int line_offset; |
94 |
|
95 |
@@ -212,16 +212,11 @@ variable_expand_string (char *line, cons |
96 |
return (variable_buffer); |
97 |
} |
98 |
|
99 |
- /* If we want a subset of the string, allocate a temporary buffer for it. |
100 |
- Most of the functions we use here don't work with length limits. */ |
101 |
- if (length > 0 && string[length] != '\0') |
102 |
- { |
103 |
- abuf = xmalloc(length+1); |
104 |
- memcpy(abuf, string, length); |
105 |
- abuf[length] = '\0'; |
106 |
- string = abuf; |
107 |
- } |
108 |
- p = string; |
109 |
+ /* We need a copy of STRING: due to eval, it's possible that it will get |
110 |
+ freed as we process it (it might be the value of a variable that's reset |
111 |
+ for example). Also having a nil-terminated string is handy. */ |
112 |
+ save = length < 0 ? xstrdup (string) : xstrndup (string, length); |
113 |
+ p = save; |
114 |
|
115 |
while (1) |
116 |
{ |
117 |
@@ -411,8 +406,7 @@ variable_expand_string (char *line, cons |
118 |
++p; |
119 |
} |
120 |
|
121 |
- if (abuf) |
122 |
- free (abuf); |
123 |
+ free (save); |
124 |
|
125 |
variable_buffer_output (o, "", 1); |
126 |
return (variable_buffer + line_offset); |
127 |
|
128 |
|
129 |
|
130 |
1.1 sys-devel/make/files/make-3.82-long-cmdline.patch |
131 |
|
132 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-devel/make/files/make-3.82-long-cmdline.patch?rev=1.1&view=markup |
133 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-devel/make/files/make-3.82-long-cmdline.patch?rev=1.1&content-type=text/plain |
134 |
|
135 |
Index: make-3.82-long-cmdline.patch |
136 |
=================================================================== |
137 |
http://bugs.gentoo.org/301116 |
138 |
http://bugs.gentoo.org/300867 |
139 |
|
140 |
tweaked a little to avoid regenerating autotools, then rebased onto make-3.82 |
141 |
|
142 |
2009-07-29 Ralf Wildenhues <Ralf.Wildenhues@×××.de> |
143 |
|
144 |
* configure.in: Check for sys/user.h and linux/binfmts.h |
145 |
headers. |
146 |
* job.c: Include them if available. |
147 |
(construct_command_argv_internal): When constructing the command |
148 |
line with 'sh -c', use multiple arguments together with eval |
149 |
expansion to evade the Linux per-argument length limit |
150 |
MAX_ARG_STRLEN if it is defined. |
151 |
Problem reported against Automake by Xan Lopez <xan@×××××.org>. |
152 |
|
153 |
--- job.c.orig 2010-01-15 18:36:53.000000000 +0200 |
154 |
+++ job.c 2010-01-15 18:41:09.000000000 +0200 |
155 |
@@ -29,6 +29,15 @@ |
156 |
|
157 |
#include <string.h> |
158 |
|
159 |
+#if defined(__linux__) /* defined (HAVE_LINUX_BINFMTS_H) && defined (HAVE_SYS_USER_H) */ |
160 |
+#include <sys/user.h> |
161 |
+#include <unistd.h> |
162 |
+#ifndef PAGE_SIZE |
163 |
+#define PAGE_SIZE sysconf(_SC_PAGE_SIZE) |
164 |
+#endif |
165 |
+#include <linux/binfmts.h> |
166 |
+#endif |
167 |
+ |
168 |
/* Default shell to use. */ |
169 |
#ifdef WINDOWS32 |
170 |
#include <windows.h> |
171 |
@@ -2697,6 +2702,15 @@ |
172 |
argument list. */ |
173 |
|
174 |
unsigned int shell_len = strlen (shell); |
175 |
+#ifdef MAX_ARG_STRLEN |
176 |
+ static char eval_line[] = "eval\\ \\\"set\\ x\\;\\ shift\\;\\ "; |
177 |
+#define ARG_NUMBER_DIGITS 5 |
178 |
+#define EVAL_LEN (sizeof(eval_line)-1 + shell_len + 4 \ |
179 |
+ + (7 + ARG_NUMBER_DIGITS) * 2 * line_len / (MAX_ARG_STRLEN - 2)) |
180 |
+#else |
181 |
+#define EVAL_LEN 0 |
182 |
+#endif |
183 |
+ char *args_ptr; |
184 |
unsigned int line_len = strlen (line); |
185 |
unsigned int sflags_len = strlen (shellflags); |
186 |
char *command_ptr = NULL; /* used for batch_mode_shell mode */ |
187 |
@@ -2700,7 +2700,7 @@ |
188 |
} |
189 |
|
190 |
new_line = alloca (shell_len + 1 + sflags_len + 1 |
191 |
- + (line_len*2) + 1); |
192 |
+ + (line_len*2) + 1 + EVAL_LEN); |
193 |
ap = new_line; |
194 |
memcpy (ap, shell, shell_len); |
195 |
ap += shell_len; |
196 |
@@ -2712,6 +2727,30 @@ |
197 |
ap += sflags_len; |
198 |
*(ap++) = ' '; |
199 |
command_ptr = ap; |
200 |
+ |
201 |
+#if !defined (WINDOWS32) && defined (MAX_ARG_STRLEN) |
202 |
+ if (unixy_shell && line_len > MAX_ARG_STRLEN) |
203 |
+ { |
204 |
+ unsigned j; |
205 |
+ memcpy (ap, eval_line, sizeof (eval_line) - 1); |
206 |
+ ap += sizeof (eval_line) - 1; |
207 |
+ for (j = 1; j <= 2 * line_len / (MAX_ARG_STRLEN - 2); j++) |
208 |
+ ap += sprintf (ap, "\\$\\{%u\\}", j); |
209 |
+ *ap++ = '\\'; |
210 |
+ *ap++ = '"'; |
211 |
+ *ap++ = ' '; |
212 |
+ /* Copy only the first word of SHELL to $0. */ |
213 |
+ for (p = shell; *p != '\0'; ++p) |
214 |
+ { |
215 |
+ if (isspace ((unsigned char)*p)) |
216 |
+ break; |
217 |
+ *ap++ = *p; |
218 |
+ } |
219 |
+ *ap++ = ' '; |
220 |
+ } |
221 |
+#endif |
222 |
+ args_ptr = ap; |
223 |
+ |
224 |
for (p = line; *p != '\0'; ++p) |
225 |
{ |
226 |
if (restp != NULL && *p == '\n') |
227 |
@@ -2760,6 +2799,14 @@ |
228 |
} |
229 |
#endif |
230 |
*ap++ = *p; |
231 |
+ |
232 |
+#if !defined (WINDOWS32) && defined (MAX_ARG_STRLEN) |
233 |
+ if (unixy_shell && line_len > MAX_ARG_STRLEN && (ap - args_ptr > MAX_ARG_STRLEN - 2)) |
234 |
+ { |
235 |
+ *ap++ = ' '; |
236 |
+ args_ptr = ap; |
237 |
+ } |
238 |
+#endif |
239 |
} |
240 |
if (ap == new_line + shell_len + sflags_len + 2) |
241 |
/* Line was empty. */ |
242 |
|
243 |
|
244 |
|
245 |
1.1 sys-devel/make/files/make-3.82-oneshell.patch |
246 |
|
247 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-devel/make/files/make-3.82-oneshell.patch?rev=1.1&view=markup |
248 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-devel/make/files/make-3.82-oneshell.patch?rev=1.1&content-type=text/plain |
249 |
|
250 |
Index: make-3.82-oneshell.patch |
251 |
=================================================================== |
252 |
fix from upstream cvs |
253 |
|
254 |
---------------------------- |
255 |
revision 1.245 |
256 |
date: 2010-08-13 22:50:14 -0400; author: psmith; state: Exp; lines: +1 -1; commitid: 4UaslPqQHZTs5wKu; |
257 |
- Add oneshell to $(.FEATURES) (forgot that!) |
258 |
|
259 |
Index: main.c |
260 |
=================================================================== |
261 |
RCS file: /sources/make/make/main.c,v |
262 |
retrieving revision 1.244 |
263 |
retrieving revision 1.245 |
264 |
diff -u -p -r1.244 -r1.245 |
265 |
--- main.c 10 Aug 2010 07:35:34 -0000 1.244 |
266 |
+++ main.c 14 Aug 2010 02:50:14 -0000 1.245 |
267 |
@@ -1138,7 +1138,7 @@ main (int argc, char **argv, char **envp |
268 |
a macro and some compilers (MSVC) don't like conditionals in macros. */ |
269 |
{ |
270 |
const char *features = "target-specific order-only second-expansion" |
271 |
- " else-if shortest-stem undefine" |
272 |
+ " else-if shortest-stem undefine oneshell" |
273 |
#ifndef NO_ARCHIVES |
274 |
" archives" |
275 |
#endif |