Accepting request 578428 from home:Andreas_Schwab:Factory

- glob-lstat.patch: Do not assume glibc glob internals
- glob-interface.patch: Support GLIBC glob interface version 2

OBS-URL: https://build.opensuse.org/request/show/578428
OBS-URL: https://build.opensuse.org/package/show/devel:tools:building/kbuild?expand=0&rev=37
This commit is contained in:
Martin Pluskal 2018-02-20 19:35:36 +00:00 committed by Git OBS Bridge
parent f0f78bb736
commit 360c75bec3
4 changed files with 98 additions and 1 deletions

16
glob-interface.patch Normal file
View File

@ -0,0 +1,16 @@
Index: kbuild-0.1.9998svn3110/src/kmk/configure.in
===================================================================
--- kbuild-0.1.9998svn3110.orig/src/kmk/configure.in
+++ kbuild-0.1.9998svn3110/src/kmk/configure.in
@@ -360,10 +360,9 @@ AC_CACHE_VAL(make_cv_sys_gnu_glob, [
#include <glob.h>
#include <fnmatch.h>
-#define GLOB_INTERFACE_VERSION 1
#if !defined _LIBC && defined __GNU_LIBRARY__ && __GNU_LIBRARY__ > 1
# include <gnu-versions.h>
-# if _GNU_GLOB_INTERFACE_VERSION == GLOB_INTERFACE_VERSION
+# if _GNU_GLOB_INTERFACE_VERSION == 1 || _GNU_GLOB_INTERFACE_VERSION == 2
gnu glob
# endif
#endif

71
glob-lstat.patch Normal file
View File

@ -0,0 +1,71 @@
From 193f1e81edd6b1b56b0eb0ff8aa4b41c7b4257b4 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Sun, 24 Sep 2017 09:12:58 -0400
Subject: [PATCH] glob: Do not assume glibc glob internals.
It has been proposed that glibc glob start using gl_lstat,
which the API allows it to do. GNU 'make' should not get in
the way of this. See:
https://sourceware.org/ml/libc-alpha/2017-09/msg00409.html
* dir.c (local_lstat): New function, like local_stat.
(dir_setup_glob): Use it to initialize gl_lstat too, as the API
requires.
---
dir.c | 29 +++++++++++++++++++++++++++--
1 file changed, 27 insertions(+), 2 deletions(-)
Index: kbuild-0.1.9998svn3110/src/kmk/dir.c
===================================================================
--- kbuild-0.1.9998svn3110.orig/src/kmk/dir.c
+++ kbuild-0.1.9998svn3110/src/kmk/dir.c
@@ -1465,6 +1465,32 @@ static int dir_exists_p (const char *dir
}
#endif
+/* Similarly for lstat. */
+#if !defined(lstat) && !defined(WINDOWS32) || defined(VMS)
+# ifndef VMS
+# ifndef HAVE_SYS_STAT_H
+int lstat (const char *path, struct stat *sbuf);
+# endif
+# else
+ /* We are done with the fake lstat. Go back to the real lstat */
+# ifdef lstat
+# undef lstat
+# endif
+# endif
+# define local_lstat lstat
+#elif defined(WINDOWS32)
+/* Windows doesn't support lstat(). */
+# define local_lstat local_stat
+#else
+static int
+local_lstat (const char *path, struct stat *buf)
+{
+ int e;
+ EINTRLOOP (e, lstat (path, buf));
+ return e;
+}
+#endif
+
void
dir_setup_glob (glob_t *gl)
{
@@ -1472,15 +1498,11 @@ dir_setup_glob (glob_t *gl)
gl->gl_readdir = read_dirstream;
gl->gl_closedir = ansi_free;
gl->gl_stat = local_stat;
-#ifdef __EMX__ /* The FreeBSD implementation actually uses gl_lstat!! */
- gl->gl_lstat = local_stat;
-#endif
+ gl->gl_lstat = local_lstat;
#ifdef GLOB_WITH_EXTENDED_KMK_MEMBERS
gl->gl_exists = file_exists_p;
gl->gl_isdir = dir_exists_p;
#endif
- /* We don't bother setting gl_lstat, since glob never calls it.
- The slot is only there for compatibility with 4.4 BSD. */
}
void

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Tue Feb 20 16:26:24 UTC 2018 - schwab@suse.de
- glob-lstat.patch: Do not assume glibc glob internals
- glob-interface.patch: Support GLIBC glob interface version 2
-------------------------------------------------------------------
Tue Feb 20 10:01:52 UTC 2018 - dmueller@suse.com

View File

@ -25,7 +25,7 @@ BuildRequires: flex
BuildRequires: libacl-devel
BuildRequires: makeinfo
Summary: Framework for writing simple makefiles for complex tasks
License: GPL-2.0+
License: GPL-2.0-or-later
Group: Development/Tools/Building
%define _svnrev 3110
Version: 0.1.9998svn%{_svnrev}
@ -43,6 +43,8 @@ Patch9: ppc64le.patch
Patch10: aarch64.patch
Patch11: kbuild-gcc7.patch
Patch12: use-alloca.patch
Patch13: glob-lstat.patch
Patch14: glob-interface.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
@ -71,6 +73,8 @@ The goals of the kBuild framework:
%patch10 -p1
%patch11 -p1
%patch12
%patch13 -p1
%patch14 -p1
%build
export CFLAGS="$RPM_OPT_FLAGS"