<p>Martin Roth has uploaded this change for <strong>review</strong>.</p><p><a href="https://review.coreboot.org/27591">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">util/crosgcc/patches: update make-4.2.1 patches<br><br>- Add the Do-not-assume-glibc-glob-internals patch to fix segfaults.<br>- Update glob_interface_v2 patch to the patch directly from the<br>make git repository instead of translating it. This gives better<br>attributution to the original author.<br><br>Change-Id: Ibc936fc00925a4ca2170a6f5dca7c2b8d8d62f02<br>Signed-off-by: Martin Roth <gaumless@gmail.com><br>---<br>A util/crossgcc/patches/make-4.2.1_0053-glob-Do-not-assume-glibc-glob-internals.patch<br>A util/crossgcc/patches/make-4.2.1_0068-configure.ac-Support-GLIBC-glob-interface-version-2.patch<br>D util/crossgcc/patches/make-4.2.1_gnu_glob_interface_v2.patch<br>3 files changed, 95 insertions(+), 15 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://review.coreboot.org:29418/coreboot refs/changes/91/27591/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/util/crossgcc/patches/make-4.2.1_0053-glob-Do-not-assume-glibc-glob-internals.patch b/util/crossgcc/patches/make-4.2.1_0053-glob-Do-not-assume-glibc-glob-internals.patch</span><br><span>new file mode 100644</span><br><span>index 0000000..3d45025</span><br><span>--- /dev/null</span><br><span>+++ b/util/crossgcc/patches/make-4.2.1_0053-glob-Do-not-assume-glibc-glob-internals.patch</span><br><span>@@ -0,0 +1,67 @@</span><br><span style="color: hsl(120, 100%, 40%);">+From 193f1e81edd6b1b56b0eb0ff8aa4b41c7b4257b4 Mon Sep 17 00:00:00 2001</span><br><span style="color: hsl(120, 100%, 40%);">+From: Paul Eggert <eggert@cs.ucla.edu></span><br><span style="color: hsl(120, 100%, 40%);">+Date: Sun, 24 Sep 2017 09:12:58 -0400</span><br><span style="color: hsl(120, 100%, 40%);">+Subject: [PATCH 53/78] glob: Do not assume glibc glob internals.</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+It has been proposed that glibc glob start using gl_lstat,</span><br><span style="color: hsl(120, 100%, 40%);">+which the API allows it to do.  GNU 'make' should not get in</span><br><span style="color: hsl(120, 100%, 40%);">+the way of this.  See:</span><br><span style="color: hsl(120, 100%, 40%);">+https://sourceware.org/ml/libc-alpha/2017-09/msg00409.html</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+* dir.c (local_lstat): New function, like local_stat.</span><br><span style="color: hsl(120, 100%, 40%);">+(dir_setup_glob): Use it to initialize gl_lstat too, as the API</span><br><span style="color: hsl(120, 100%, 40%);">+requires.</span><br><span style="color: hsl(120, 100%, 40%);">+---</span><br><span style="color: hsl(120, 100%, 40%);">+ dir.c | 29 +++++++++++++++++++++++++++--</span><br><span style="color: hsl(120, 100%, 40%);">+ 1 file changed, 27 insertions(+), 2 deletions(-)</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+diff --git a/dir.c b/dir.c</span><br><span style="color: hsl(120, 100%, 40%);">+index adbb8a9..c343e4c 100644</span><br><span style="color: hsl(120, 100%, 40%);">+--- a/dir.c</span><br><span>++++ b/dir.c</span><br><span style="color: hsl(120, 100%, 40%);">+@@ -1299,15 +1299,40 @@ local_stat (const char *path, struct stat *buf)</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+ #endif</span><br><span style="color: hsl(120, 100%, 40%);">+ </span><br><span style="color: hsl(120, 100%, 40%);">++/* Similarly for lstat.  */</span><br><span style="color: hsl(120, 100%, 40%);">++#if !defined(lstat) && !defined(WINDOWS32) || defined(VMS)</span><br><span style="color: hsl(120, 100%, 40%);">++# ifndef VMS</span><br><span style="color: hsl(120, 100%, 40%);">++#  ifndef HAVE_SYS_STAT_H</span><br><span style="color: hsl(120, 100%, 40%);">++int lstat (const char *path, struct stat *sbuf);</span><br><span style="color: hsl(120, 100%, 40%);">++#  endif</span><br><span style="color: hsl(120, 100%, 40%);">++# else</span><br><span style="color: hsl(120, 100%, 40%);">++    /* We are done with the fake lstat.  Go back to the real lstat */</span><br><span style="color: hsl(120, 100%, 40%);">++#   ifdef lstat</span><br><span style="color: hsl(120, 100%, 40%);">++#     undef lstat</span><br><span style="color: hsl(120, 100%, 40%);">++#   endif</span><br><span style="color: hsl(120, 100%, 40%);">++# endif</span><br><span style="color: hsl(120, 100%, 40%);">++# define local_lstat lstat</span><br><span style="color: hsl(120, 100%, 40%);">++#elif defined(WINDOWS32)</span><br><span style="color: hsl(120, 100%, 40%);">++/* Windows doesn't support lstat().  */</span><br><span style="color: hsl(120, 100%, 40%);">++# define local_lstat local_stat</span><br><span style="color: hsl(120, 100%, 40%);">++#else</span><br><span style="color: hsl(120, 100%, 40%);">++static int</span><br><span style="color: hsl(120, 100%, 40%);">++local_lstat (const char *path, struct stat *buf)</span><br><span style="color: hsl(120, 100%, 40%);">++{</span><br><span style="color: hsl(120, 100%, 40%);">++  int e;</span><br><span style="color: hsl(120, 100%, 40%);">++  EINTRLOOP (e, lstat (path, buf));</span><br><span style="color: hsl(120, 100%, 40%);">++  return e;</span><br><span style="color: hsl(120, 100%, 40%);">++}</span><br><span style="color: hsl(120, 100%, 40%);">++#endif</span><br><span style="color: hsl(120, 100%, 40%);">++</span><br><span style="color: hsl(120, 100%, 40%);">+ void</span><br><span style="color: hsl(120, 100%, 40%);">+ dir_setup_glob (glob_t *gl)</span><br><span style="color: hsl(120, 100%, 40%);">+ {</span><br><span style="color: hsl(120, 100%, 40%);">+   gl->gl_opendir = open_dirstream;</span><br><span style="color: hsl(120, 100%, 40%);">+   gl->gl_readdir = read_dirstream;</span><br><span style="color: hsl(120, 100%, 40%);">+   gl->gl_closedir = free;</span><br><span style="color: hsl(120, 100%, 40%);">++  gl->gl_lstat = local_lstat;</span><br><span style="color: hsl(120, 100%, 40%);">+   gl->gl_stat = local_stat;</span><br><span style="color: hsl(120, 100%, 40%);">+-  /* We don't bother setting gl_lstat, since glob never calls it.</span><br><span style="color: hsl(120, 100%, 40%);">+-     The slot is only there for compatibility with 4.4 BSD.  */</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+ </span><br><span style="color: hsl(120, 100%, 40%);">+ void</span><br><span style="color: hsl(120, 100%, 40%);">+-- </span><br><span style="color: hsl(120, 100%, 40%);">+2.18.0</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>diff --git a/util/crossgcc/patches/make-4.2.1_0068-configure.ac-Support-GLIBC-glob-interface-version-2.patch b/util/crossgcc/patches/make-4.2.1_0068-configure.ac-Support-GLIBC-glob-interface-version-2.patch</span><br><span>new file mode 100644</span><br><span>index 0000000..53e61b8</span><br><span>--- /dev/null</span><br><span>+++ b/util/crossgcc/patches/make-4.2.1_0068-configure.ac-Support-GLIBC-glob-interface-version-2.patch</span><br><span>@@ -0,0 +1,28 @@</span><br><span style="color: hsl(120, 100%, 40%);">+From 48c8a116a914a325a0497721f5d8b58d5bba34d4 Mon Sep 17 00:00:00 2001</span><br><span style="color: hsl(120, 100%, 40%);">+From: Paul Smith <psmith@gnu.org></span><br><span style="color: hsl(120, 100%, 40%);">+Date: Sun, 19 Nov 2017 15:09:16 -0500</span><br><span style="color: hsl(120, 100%, 40%);">+Subject: [PATCH 68/78] * configure.ac: Support GLIBC glob interface version 2</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+---</span><br><span style="color: hsl(120, 100%, 40%);">+ configure.ac | 3 +--</span><br><span style="color: hsl(120, 100%, 40%);">+ 1 file changed, 1 insertion(+), 2 deletions(-)</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+diff --git a/configure.ac b/configure.ac</span><br><span style="color: hsl(120, 100%, 40%);">+index 8c72568..4710832 100644</span><br><span style="color: hsl(120, 100%, 40%);">+--- a/configure.ac</span><br><span>++++ b/configure.ac</span><br><span style="color: hsl(120, 100%, 40%);">+@@ -404,10 +404,9 @@ AC_CACHE_CHECK([if system libc has GNU glob], [make_cv_sys_gnu_glob],</span><br><span style="color: hsl(120, 100%, 40%);">+ #include <glob.h></span><br><span style="color: hsl(120, 100%, 40%);">+ #include <fnmatch.h></span><br><span style="color: hsl(120, 100%, 40%);">+ </span><br><span style="color: hsl(120, 100%, 40%);">+-#define GLOB_INTERFACE_VERSION 1</span><br><span style="color: hsl(120, 100%, 40%);">+ #if !defined _LIBC && defined __GNU_LIBRARY__ && __GNU_LIBRARY__ > 1</span><br><span style="color: hsl(120, 100%, 40%);">+ # include <gnu-versions.h></span><br><span style="color: hsl(120, 100%, 40%);">+-# if _GNU_GLOB_INTERFACE_VERSION == GLOB_INTERFACE_VERSION</span><br><span style="color: hsl(120, 100%, 40%);">++# if _GNU_GLOB_INTERFACE_VERSION == 1 || _GNU_GLOB_INTERFACE_VERSION == 2</span><br><span style="color: hsl(120, 100%, 40%);">+    gnu glob</span><br><span style="color: hsl(120, 100%, 40%);">+ # endif</span><br><span style="color: hsl(120, 100%, 40%);">+ #endif],</span><br><span style="color: hsl(120, 100%, 40%);">+-- </span><br><span style="color: hsl(120, 100%, 40%);">+2.18.0</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>diff --git a/util/crossgcc/patches/make-4.2.1_gnu_glob_interface_v2.patch b/util/crossgcc/patches/make-4.2.1_gnu_glob_interface_v2.patch</span><br><span>deleted file mode 100644</span><br><span>index 466d6fd..0000000</span><br><span>--- a/util/crossgcc/patches/make-4.2.1_gnu_glob_interface_v2.patch</span><br><span>+++ /dev/null</span><br><span>@@ -1,15 +0,0 @@</span><br><span style="color: hsl(0, 100%, 40%);">-diff -Naur make-4.2.1/configure.ac make-4.2.1/configure.ac</span><br><span>---- make-4.2.1/configure.ac</span><br><span style="color: hsl(0, 100%, 40%);">-+++ make-4.2.1/configure.ac</span><br><span style="color: hsl(0, 100%, 40%);">-@@ -399,10 +399,9 @@</span><br><span style="color: hsl(0, 100%, 40%);">- #include <glob.h></span><br><span style="color: hsl(0, 100%, 40%);">- #include <fnmatch.h></span><br><span style="color: hsl(0, 100%, 40%);">- </span><br><span style="color: hsl(0, 100%, 40%);">--#define GLOB_INTERFACE_VERSION 1</span><br><span style="color: hsl(0, 100%, 40%);">- #if !defined _LIBC && defined __GNU_LIBRARY__ && __GNU_LIBRARY__ > 1</span><br><span style="color: hsl(0, 100%, 40%);">- # include <gnu-versions.h></span><br><span style="color: hsl(0, 100%, 40%);">--# if _GNU_GLOB_INTERFACE_VERSION == GLOB_INTERFACE_VERSION</span><br><span style="color: hsl(0, 100%, 40%);">-+# if _GNU_GLOB_INTERFACE_VERSION == 1 || _GNU_GLOB_INTERFACE_VERSION == 2</span><br><span style="color: hsl(0, 100%, 40%);">-    gnu glob</span><br><span style="color: hsl(0, 100%, 40%);">- # endif</span><br><span style="color: hsl(0, 100%, 40%);">- #endif],</span><br><span></span><br></pre><p>To view, visit <a href="https://review.coreboot.org/27591">change 27591</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://review.coreboot.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://review.coreboot.org/27591"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: coreboot </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: Ibc936fc00925a4ca2170a6f5dca7c2b8d8d62f02 </div>
<div style="display:none"> Gerrit-Change-Number: 27591 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Martin Roth <martinroth@google.com> </div>