7159246 gmake target-specific variables fail if over 150 characters and contain semicolon
authorPetr Cvachoucek <petr.cvachoucek@oracle.com>
Tue, 17 Apr 2012 00:51:00 -0700
changeset 770 f112e7923000
parent 769 68e4ba640241
child 771 f57a88a76d61
7159246 gmake target-specific variables fail if over 150 characters and contain semicolon 7158488 MAKEFLAGS not being honored always (regression) in 3.82
components/make/patches/30723.patch
components/make/patches/33873.patch
components/make/patches/36106.patch
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/make/patches/30723.patch	Tue Apr 17 00:51:00 2012 -0700
@@ -0,0 +1,20 @@
+This patch is taken from:
+http://cvs.savannah.gnu.org/viewvc/make/main.c?root=make&r1=1.243&r2=1.244
+
+Fix Savannah bug #30723:
+expand MAKEFLAGS before we re-exec after rebuilding makefiles.
+
+bug #30723: implicit re-executing of subdirs breaks $(origin) with make-3.82
+https://savannah.gnu.org/bugs/?30723
+
+--- a/main.c	2010/07/19 07:10:53	1.243
++++ b/main.c	2010/08/10 07:35:34	1.244
+@@ -2093,7 +2093,7 @@
+             const char *pv = define_makeflags (1, 1);
+             char *p = alloca (sizeof ("MAKEFLAGS=") + strlen (pv) + 1);
+             sprintf (p, "MAKEFLAGS=%s", pv);
+-            putenv (p);
++            putenv (allocated_variable_expand (p));
+           }
+ 
+ 	  if (ISDB (DB_BASIC))
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/make/patches/33873.patch	Tue Apr 17 00:51:00 2012 -0700
@@ -0,0 +1,37 @@
+This patch is taken from:
+http://cvs.savannah.gnu.org/viewvc/make/main.c?root=make&r1=1.246&r2=1.247
+
+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.
+
+bug #33873: MAKEFLAGS=-jN gets lost on reexec
+https://savannah.gnu.org/bugs/?33873
+
+sr #107487: MAKEFLAGS not being honored always (regression) in 3.82
+https://savannah.gnu.org/support/index.php?107487
+
+--- a/main.c	2010/08/29 23:05:27	1.246
++++ b/main.c	2011/09/18 23:39:26	1.247
+@@ -2088,6 +2088,11 @@
+ 
+           ++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);
+@@ -2824,9 +2829,6 @@
+ 		       && (*(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);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/make/patches/36106.patch	Tue Apr 17 00:51:00 2012 -0700
@@ -0,0 +1,22 @@
+This patch is submitted upstream as:
+
+bug #36106: make target-specific variables fail if over 150 characters and contain semicolon
+http://savannah.gnu.org/bugs/index.php?36106
+
+--- a/read.c	2010-07-13 03:20:42.000000000 +0200
++++ b/read.c	2012-04-05 23:25:12.155011371 +0200
+@@ -1071,12 +1071,12 @@
+                after it.  */
+             if (semip)
+               {
+-                unsigned int l = p - variable_buffer;
++                unsigned int l = p2 - variable_buffer;
+                 *(--semip) = ';';
+                 collapse_continuations (semip);
+                 variable_buffer_output (p2 + strlen (p2),
+                                         semip, strlen (semip)+1);
+-                p = variable_buffer + l;
++                p2 = variable_buffer + l;
+               }
+             record_target_var (filenames, p2,
+                                vmod.override_v ? o_override : o_file,