[Clfs-commits] [Cross-LFS]Cross-LFS Book branch, master, updated. clfs-2.0.0-197-gd87123b

git git at cross-lfs.org
Thu Aug 1 14:42:34 PDT 2013


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Cross-LFS Book".

The branch, master has been updated
       via  d87123b48bc31348a088c08aefc55f44e6a33f90 (commit)
      from  bb8e496acf30da829f2eeae26a787a4a91d92dae (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit d87123b48bc31348a088c08aefc55f44e6a33f90
Author: William Harrington <kb0iic at berzerkula.org>
Date:   Thu Aug 1 16:42:29 2013 -0500

    Add make 3.82 fixes patch for upstream changes.

diff --git a/BOOK/final-system/common/make.xml b/BOOK/final-system/common/make.xml
index 3090bed..198b17d 100644
--- a/BOOK/final-system/common/make.xml
+++ b/BOOK/final-system/common/make.xml
@@ -24,6 +24,10 @@
   <sect2 role="installation">
     <title>Installation of Make</title>
 
+    <para os="p1">Apply upstream fixes:</para>
+
+    <screen os="p2"><userinput>patch -Np1 -i ../&make-fixes-patch;</userinput></screen>
+
     <para os="a">Prepare Make for compilation:</para>
 
 <screen os="b"><userinput>./configure --prefix=/usr</userinput></screen>
diff --git a/BOOK/final-system/multilib/make.xml b/BOOK/final-system/multilib/make.xml
index 8f27d34..36e7a80 100644
--- a/BOOK/final-system/multilib/make.xml
+++ b/BOOK/final-system/multilib/make.xml
@@ -23,6 +23,14 @@
 
     <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
     href="../common/make.xml"
+    xpointer="xpointer(//*[@os='p1'])"/>
+
+    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
+    href="../common/make.xml"
+    xpointer="xpointer(//*[@os='p2'])"/>
+
+    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
+    href="../common/make.xml"
     xpointer="xpointer(//*[@os='a'])"/>
 
 <screen os="b"><userinput>CC="gcc ${BUILD64}" ./configure --prefix=/usr</userinput></screen>
diff --git a/BOOK/introduction/common/changelog.xml b/BOOK/introduction/common/changelog.xml
index e79386e..fb34f4f 100644
--- a/BOOK/introduction/common/changelog.xml
+++ b/BOOK/introduction/common/changelog.xml
@@ -47,6 +47,9 @@
         <listitem>
           <para>[William Harrington] - Update ISL to 0.12.1.</para>
         </listitem>
+        <listitem>
+          <para>[William Harrington] - Add Make-3.82 fixes patch.</para>
+        </listitem>
       </itemizedlist>
     </listitem>
 
diff --git a/BOOK/materials/common/patches.xml b/BOOK/materials/common/patches.xml
index 8fec123..bed14a8 100644
--- a/BOOK/materials/common/patches.xml
+++ b/BOOK/materials/common/patches.xml
@@ -104,6 +104,15 @@
     </varlistentry>
 
     <varlistentry>
+      <term>Make fixes patch - <token>&make-fixes-patch-size;</token>:</term>
+      <listitem>
+        <para>Download: <ulink
+        url="&patches-root;&make-fixes-patch;"/></para>
+        <para>MD5 sum: <literal>&make-fixes-patch-md5;</literal></para>
+      </listitem>
+    </varlistentry>
+
+    <varlistentry>
       <term>Man i18n Patch - <token>&man-i18n-patch-size;</token>:</term>
       <listitem>
         <para>Download: <ulink
diff --git a/BOOK/patches.ent b/BOOK/patches.ent
index e68c137..2ced4f3 100644
--- a/BOOK/patches.ent
+++ b/BOOK/patches.ent
@@ -49,6 +49,10 @@
 <!ENTITY m4-gets-patch-md5 "6c5013f9ae5afc78f123e96356ceec3e">
 <!ENTITY m4-gets-patch-size ".570 KB">
 
+<!ENTITY make-fixes-patch "make-&make-version;-fixes-1.patch">
+<!ENTITY make-fixes-patch-md5 "47fd2f9d09483a79630e58c5a5d544ac">
+<!ENTITY make-fixes-patch-size "9,301 KB">
+
 <!ENTITY man-i18n-patch "man-&man-version;-i18n-1.patch">
 <!ENTITY man-i18n-patch-md5 "a5aba0cb5a95a7945db8c882334b7dab">
 <!ENTITY man-i18n-patch-size "11 KB">
diff --git a/patches/make-3.82-fixes-1.patch b/patches/make-3.82-fixes-1.patch
new file mode 100644
index 0000000..6e021a3
--- /dev/null
+++ b/patches/make-3.82-fixes-1.patch
@@ -0,0 +1,331 @@
+Submitted By:            William Harrington at <kb0iic at cross-lfs dot org>
+Date:                    2013-08-01
+Initial Package Version: 3.82
+Upstream Status:         Fixed Upstream
+Origin:                  Upstream
+Description:             Several bug fixes from upstream git
+
+diff -Naur make-3.82.orig/expand.c make-3.82/expand.c
+--- make-3.82.orig/expand.c	2010-07-13 01:20:39.000000000 +0000
++++ make-3.82/expand.c	2013-08-01 20:44:22.773645293 +0000
+@@ -197,7 +197,7 @@
+ {
+   struct variable *v;
+   const char *p, *p1;
+-  char *abuf = NULL;
++  char *save;
+   char *o;
+   unsigned int line_offset;
+ 
+@@ -212,16 +212,11 @@
+       return (variable_buffer);
+     }
+ 
+-  /* If we want a subset of the string, allocate a temporary buffer for it.
+-     Most of the functions we use here don't work with length limits.  */
+-  if (length > 0 && string[length] != '\0')
+-    {
+-      abuf = xmalloc(length+1);
+-      memcpy(abuf, string, length);
+-      abuf[length] = '\0';
+-      string = abuf;
+-    }
+-  p = string;
++  /* We need a copy of STRING: due to eval, it's possible that it will get
++     freed as we process it (it might be the value of a variable that's reset
++     for example).  Also having a nil-terminated string is handy.  */
++  save = length < 0 ? xstrdup (string) : xstrndup (string, length);
++  p = save;
+ 
+   while (1)
+     {
+@@ -411,8 +406,7 @@
+       ++p;
+     }
+ 
+-  if (abuf)
+-    free (abuf);
++  free (save);
+ 
+   variable_buffer_output (o, "", 1);
+   return (variable_buffer + line_offset);
+diff -Naur make-3.82.orig/function.c make-3.82/function.c
+--- make-3.82.orig/function.c	2010-07-13 01:20:39.000000000 +0000
++++ make-3.82/function.c	2013-08-01 20:45:09.100176320 +0000
+@@ -706,7 +706,7 @@
+   const char *word_iterator = argv[0];
+   char buf[20];
+ 
+-  while (find_next_token (&word_iterator, (unsigned int *) 0) != 0)
++  while (find_next_token (&word_iterator, NULL) != 0)
+     ++i;
+ 
+   sprintf (buf, "%d", i);
+@@ -1133,21 +1133,14 @@
+ 
+   /* Find the maximum number of words we'll have.  */
+   t = argv[0];
+-  wordi = 1;
+-  while (*t != '\0')
++  wordi = 0;
++  while ((p = find_next_token (&t, NULL)) != 0)
+     {
+-      char c = *(t++);
+-
+-      if (! isspace ((unsigned char)c))
+-        continue;
+-
++      ++t;
+       ++wordi;
+-
+-      while (isspace ((unsigned char)*t))
+-        ++t;
+     }
+ 
+-  words = xmalloc (wordi * sizeof (char *));
++  words = xmalloc ((wordi == 0 ? 1 : wordi) * sizeof (char *));
+ 
+   /* Now assign pointers to each string in the array.  */
+   t = argv[0];
+diff -Naur make-3.82.orig/job.c make-3.82/job.c
+--- make-3.82.orig/job.c	2010-07-24 08:27:50.000000000 +0000
++++ make-3.82/job.c	2013-08-01 20:44:54.400222908 +0000
+@@ -29,6 +29,15 @@
+ 
+ #include <string.h>
+ 
++#if defined(__linux__) /* defined (HAVE_LINUX_BINFMTS_H) && defined (HAVE_SYS_USER_H) */
++#include <sys/user.h>
++#include <unistd.h>
++#ifndef PAGE_SIZE
++#define PAGE_SIZE sysconf(_SC_PAGE_SIZE)
++#endif
++#include <linux/binfmts.h>
++#endif
++
+ /* Default shell to use.  */
+ #ifdef WINDOWS32
+ #include <windows.h>
+@@ -2791,6 +2800,15 @@
+        argument list.  */
+ 
+     unsigned int shell_len = strlen (shell);
++#ifdef MAX_ARG_STRLEN
++    static char eval_line[] = "eval\\ \\\"set\\ x\\;\\ shift\\;\\ ";
++#define ARG_NUMBER_DIGITS 5
++#define EVAL_LEN (sizeof(eval_line)-1 + shell_len + 4 \
++                 + (7 + ARG_NUMBER_DIGITS) * 2 * line_len / (MAX_ARG_STRLEN - 2))
++#else
++#define EVAL_LEN 0
++#endif
++    char *args_ptr;
+     unsigned int line_len = strlen (line);
+     unsigned int sflags_len = strlen (shellflags);
+     char *command_ptr = NULL; /* used for batch_mode_shell mode */
+@@ -2866,7 +2884,7 @@
+       }
+ 
+     new_line = alloca (shell_len + 1 + sflags_len + 1
+-                             + (line_len*2) + 1);
++                             + (line_len*2) + 1 + EVAL_LEN);
+     ap = new_line;
+     memcpy (ap, shell, shell_len);
+     ap += shell_len;
+@@ -2875,6 +2893,30 @@
+     ap += sflags_len;
+     *(ap++) = ' ';
+     command_ptr = ap;
++
++#if !defined (WINDOWS32) && defined (MAX_ARG_STRLEN)
++    if (unixy_shell && line_len > MAX_ARG_STRLEN)
++      {
++	unsigned j;
++	memcpy (ap, eval_line, sizeof (eval_line) - 1);
++	ap += sizeof (eval_line) - 1;
++	for (j = 1; j <= 2 * line_len / (MAX_ARG_STRLEN - 2); j++)
++	  ap += sprintf (ap, "\\$\\{%u\\}", j);
++	*ap++ = '\\';
++	*ap++ = '"';
++	*ap++ = ' ';
++	/* Copy only the first word of SHELL to $0.  */
++	for (p = shell; *p != '\0'; ++p)
++	  {
++	    if (isspace ((unsigned char)*p))
++	      break;
++	    *ap++ = *p;
++	  }
++	*ap++ = ' ';
++      }
++#endif
++    args_ptr = ap;
++
+     for (p = line; *p != '\0'; ++p)
+       {
+ 	if (restp != NULL && *p == '\n')
+@@ -2922,6 +2964,14 @@
+           }
+ #endif
+ 	*ap++ = *p;
++
++#if !defined (WINDOWS32) && defined (MAX_ARG_STRLEN)
++	if (unixy_shell && line_len > MAX_ARG_STRLEN && (ap - args_ptr > MAX_ARG_STRLEN - 2))
++	  {
++	    *ap++ = ' ';
++	    args_ptr = ap;
++	  }
++#endif
+       }
+     if (ap == new_line + shell_len + sflags_len + 2)
+       /* Line was empty.  */
+diff -Naur make-3.82.orig/main.c make-3.82/main.c
+--- make-3.82.orig/main.c	2010-07-19 07:10:53.000000000 +0000
++++ make-3.82/main.c	2013-08-01 20:45:20.540147980 +0000
+@@ -1138,7 +1138,7 @@
+      a macro and some compilers (MSVC) don't like conditionals in macros.  */
+   {
+     const char *features = "target-specific order-only second-expansion"
+-                           " else-if shortest-stem undefine"
++                           " else-if shortest-stem undefine oneshell"
+ #ifndef NO_ARCHIVES
+                            " archives"
+ #endif
+@@ -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))
+diff -Naur make-3.82.orig/read.c make-3.82/read.c
+--- make-3.82.orig/read.c	2010-07-13 01:20:42.000000000 +0000
++++ make-3.82/read.c	2013-08-01 20:44:39.690263962 +0000
+@@ -2904,6 +2904,7 @@
+       const char *name;
+       const char **nlist = 0;
+       char *tildep = 0;
++      int globme = 1;
+ #ifndef NO_ARCHIVES
+       char *arname = 0;
+       char *memname = 0;
+@@ -3028,7 +3029,7 @@
+             {
+               /* This looks like the first element in an open archive group.
+                  A valid group MUST have ')' as the last character.  */
+-              const char *e = p + nlen;
++              const char *e = p;
+               do
+                 {
+                   e = next_token (e);
+@@ -3084,19 +3085,19 @@
+          Go to the next item in the string.  */
+       if (flags & PARSEFS_NOGLOB)
+         {
+-          NEWELT (concat (2, prefix, tp));
++          NEWELT (concat (2, prefix, tmpbuf));
+           continue;
+         }
+ 
+       /* If we get here we know we're doing glob expansion.
+          TP is a string in tmpbuf.  NLEN is no longer used.
+          We may need to do more work: after this NAME will be set.  */
+-      name = tp;
++      name = tmpbuf;
+ 
+       /* Expand tilde if applicable.  */
+-      if (tp[0] == '~')
++      if (tmpbuf[0] == '~')
+ 	{
+-	  tildep = tilde_expand (tp);
++	  tildep = tilde_expand (tmpbuf);
+ 	  if (tildep != 0)
+             name = tildep;
+ 	}
+@@ -3112,32 +3113,40 @@
+ 	}
+ #endif /* !NO_ARCHIVES */
+ 
+-      switch (glob (name, GLOB_NOSORT|GLOB_ALTDIRFUNC, NULL, &gl))
+-	{
+-	case GLOB_NOSPACE:
+-	  fatal (NILF, _("virtual memory exhausted"));
+-
+-	case 0:
+-          /* Success.  */
+-          i = gl.gl_pathc;
+-          nlist = (const char **)gl.gl_pathv;
+-          break;
+-
+-        case GLOB_NOMATCH:
+-          /* If we want only existing items, skip this one.  */
+-          if (flags & PARSEFS_EXISTS)
+-            {
+-              i = 0;
+-              break;
+-            }
+-          /* FALLTHROUGH */
+-
+-	default:
+-          /* By default keep this name.  */
++      /* glob() is expensive: don't call it unless we need to.  */
++      if (!(flags & PARSEFS_EXISTS) && strpbrk (name, "?*[") == NULL)
++        {
++          globme = 0;
+           i = 1;
+           nlist = &name;
+-          break;
+-	}
++        }
++      else
++        switch (glob (name, GLOB_NOSORT|GLOB_ALTDIRFUNC, NULL, &gl))
++          {
++          case GLOB_NOSPACE:
++            fatal (NILF, _("virtual memory exhausted"));
++
++          case 0:
++            /* Success.  */
++            i = gl.gl_pathc;
++            nlist = (const char **)gl.gl_pathv;
++            break;
++
++          case GLOB_NOMATCH:
++            /* If we want only existing items, skip this one.  */
++            if (flags & PARSEFS_EXISTS)
++              {
++                i = 0;
++                break;
++              }
++            /* FALLTHROUGH */
++
++          default:
++            /* By default keep this name.  */
++            i = 1;
++            nlist = &name;
++            break;
++          }
+ 
+       /* For each matched element, add it to the list.  */
+       while (i-- > 0)
+@@ -3152,7 +3161,10 @@
+             else
+               {
+                 /* We got a chain of items.  Attach them.  */
+-                (*newp)->next = found;
++                if (*newp)
++                  (*newp)->next = found;
++                else
++                  *newp = found;
+ 
+                 /* Find and set the new end.  Massage names if necessary.  */
+                 while (1)
+@@ -3174,7 +3186,8 @@
+ #endif /* !NO_ARCHIVES */
+           NEWELT (concat (2, prefix, nlist[i]));
+ 
+-      globfree (&gl);
++      if (globme)
++        globfree (&gl);
+ 
+ #ifndef NO_ARCHIVES
+       if (arname)

-----------------------------------------------------------------------

Summary of changes:
 BOOK/final-system/common/make.xml      |    4 +
 BOOK/final-system/multilib/make.xml    |    8 +
 BOOK/introduction/common/changelog.xml |    3 +
 BOOK/materials/common/patches.xml      |    9 +
 BOOK/patches.ent                       |    4 +
 patches/make-3.82-fixes-1.patch        |  331 ++++++++++++++++++++++++++++++++
 6 files changed, 359 insertions(+), 0 deletions(-)
 create mode 100644 patches/make-3.82-fixes-1.patch


hooks/post-receive
-- 
Cross-LFS Book



More information about the Clfs-commits mailing list