forked from pool/kbuild
Accepting request 578503 from devel:tools:building
OBS-URL: https://build.opensuse.org/request/show/578503 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/kbuild?expand=0&rev=36
This commit is contained in:
commit
a7b7648131
16
glob-interface.patch
Normal file
16
glob-interface.patch
Normal 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
71
glob-lstat.patch
Normal 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
|
@ -1,3 +1,14 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
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
|
||||||
|
|
||||||
|
- add use-alloca.patch (bsc#1079838)
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Sun Oct 22 00:43:39 UTC 2017 - Larry.Finger@lwfinger.net
|
Sun Oct 22 00:43:39 UTC 2017 - Larry.Finger@lwfinger.net
|
||||||
|
|
||||||
|
10
kbuild.spec
10
kbuild.spec
@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# spec file for package kbuild
|
# spec file for package kbuild
|
||||||
#
|
#
|
||||||
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
|
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
|
||||||
#
|
#
|
||||||
# All modifications and additions to the file contributed by third parties
|
# All modifications and additions to the file contributed by third parties
|
||||||
# remain the property of their copyright owners, unless otherwise agreed
|
# remain the property of their copyright owners, unless otherwise agreed
|
||||||
@ -25,7 +25,7 @@ BuildRequires: flex
|
|||||||
BuildRequires: libacl-devel
|
BuildRequires: libacl-devel
|
||||||
BuildRequires: makeinfo
|
BuildRequires: makeinfo
|
||||||
Summary: Framework for writing simple makefiles for complex tasks
|
Summary: Framework for writing simple makefiles for complex tasks
|
||||||
License: GPL-2.0+
|
License: GPL-2.0-or-later
|
||||||
Group: Development/Tools/Building
|
Group: Development/Tools/Building
|
||||||
%define _svnrev 3110
|
%define _svnrev 3110
|
||||||
Version: 0.1.9998svn%{_svnrev}
|
Version: 0.1.9998svn%{_svnrev}
|
||||||
@ -42,6 +42,9 @@ Patch8: kbuild-wrong-memset.patch
|
|||||||
Patch9: ppc64le.patch
|
Patch9: ppc64le.patch
|
||||||
Patch10: aarch64.patch
|
Patch10: aarch64.patch
|
||||||
Patch11: kbuild-gcc7.patch
|
Patch11: kbuild-gcc7.patch
|
||||||
|
Patch12: use-alloca.patch
|
||||||
|
Patch13: glob-lstat.patch
|
||||||
|
Patch14: glob-interface.patch
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||||
|
|
||||||
%description
|
%description
|
||||||
@ -69,6 +72,9 @@ The goals of the kBuild framework:
|
|||||||
%patch9 -p1
|
%patch9 -p1
|
||||||
%patch10 -p1
|
%patch10 -p1
|
||||||
%patch11 -p1
|
%patch11 -p1
|
||||||
|
%patch12
|
||||||
|
%patch13 -p1
|
||||||
|
%patch14 -p1
|
||||||
|
|
||||||
%build
|
%build
|
||||||
export CFLAGS="$RPM_OPT_FLAGS"
|
export CFLAGS="$RPM_OPT_FLAGS"
|
||||||
|
148
use-alloca.patch
Normal file
148
use-alloca.patch
Normal file
@ -0,0 +1,148 @@
|
|||||||
|
--- src/kmk/glob/glob.c.orig 2018-02-20 10:56:04.477559710 +0100
|
||||||
|
+++ src/kmk/glob/glob.c 2018-02-20 10:56:51.498370508 +0100
|
||||||
|
@@ -209,8 +209,7 @@
|
||||||
|
#endif /* __GNU_LIBRARY__ || __DJGPP__ */
|
||||||
|
|
||||||
|
|
||||||
|
-#if !defined __alloca && !defined __GNU_LIBRARY__
|
||||||
|
-
|
||||||
|
+#if !defined alloca
|
||||||
|
# ifdef __GNUC__
|
||||||
|
# undef alloca
|
||||||
|
# define alloca(n) __builtin_alloca (n)
|
||||||
|
@@ -227,9 +226,6 @@
|
||||||
|
# endif /* Not _AIX. */
|
||||||
|
# endif /* sparc or HAVE_ALLOCA_H. */
|
||||||
|
# endif /* GCC. */
|
||||||
|
-
|
||||||
|
-# define __alloca alloca
|
||||||
|
-
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __GNU_LIBRARY__
|
||||||
|
@@ -558,7 +554,7 @@
|
||||||
|
char *drive_spec;
|
||||||
|
|
||||||
|
++dirlen;
|
||||||
|
- drive_spec = (char *) __alloca (dirlen + 1);
|
||||||
|
+ drive_spec = (char *) alloca (dirlen + 1);
|
||||||
|
#ifdef HAVE_MEMPCPY
|
||||||
|
*((char *) mempcpy (drive_spec, pattern, dirlen)) = '\0';
|
||||||
|
#else
|
||||||
|
@@ -574,7 +570,7 @@
|
||||||
|
from "d:/", since "d:" and "d:/" are not the same.*/
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
- newp = (char *) __alloca (dirlen + 1);
|
||||||
|
+ newp = (char *) alloca (dirlen + 1);
|
||||||
|
#ifdef HAVE_MEMPCPY
|
||||||
|
*((char *) mempcpy (newp, pattern, dirlen)) = '\0';
|
||||||
|
#else
|
||||||
|
@@ -645,7 +641,7 @@
|
||||||
|
/* `sysconf' does not support _SC_LOGIN_NAME_MAX. Try
|
||||||
|
a moderate value. */
|
||||||
|
buflen = 20;
|
||||||
|
- name = (char *) __alloca (buflen);
|
||||||
|
+ name = (char *) alloca (buflen);
|
||||||
|
|
||||||
|
success = getlogin_r (name, buflen) >= 0;
|
||||||
|
# else
|
||||||
|
@@ -664,7 +660,7 @@
|
||||||
|
/* `sysconf' does not support _SC_GETPW_R_SIZE_MAX.
|
||||||
|
Try a moderate value. */
|
||||||
|
pwbuflen = 1024;
|
||||||
|
- pwtmpbuf = (char *) __alloca (pwbuflen);
|
||||||
|
+ pwtmpbuf = (char *) alloca (pwbuflen);
|
||||||
|
|
||||||
|
while (getpwnam_r (name, &pwbuf, pwtmpbuf, pwbuflen, &p)
|
||||||
|
!= 0)
|
||||||
|
@@ -675,7 +671,7 @@
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
pwbuflen *= 2;
|
||||||
|
- pwtmpbuf = (char *) __alloca (pwbuflen);
|
||||||
|
+ pwtmpbuf = (char *) alloca (pwbuflen);
|
||||||
|
__set_errno (save);
|
||||||
|
}
|
||||||
|
# else
|
||||||
|
@@ -702,7 +698,7 @@
|
||||||
|
{
|
||||||
|
char *newp;
|
||||||
|
size_t home_len = strlen (home_dir);
|
||||||
|
- newp = (char *) __alloca (home_len + dirlen);
|
||||||
|
+ newp = (char *) alloca (home_len + dirlen);
|
||||||
|
# ifdef HAVE_MEMPCPY
|
||||||
|
mempcpy (mempcpy (newp, home_dir, home_len),
|
||||||
|
&dirname[1], dirlen);
|
||||||
|
@@ -725,7 +721,7 @@
|
||||||
|
else
|
||||||
|
{
|
||||||
|
char *newp;
|
||||||
|
- newp = (char *) __alloca (end_name - dirname);
|
||||||
|
+ newp = (char *) alloca (end_name - dirname);
|
||||||
|
# ifdef HAVE_MEMPCPY
|
||||||
|
*((char *) mempcpy (newp, dirname + 1, end_name - dirname))
|
||||||
|
= '\0';
|
||||||
|
@@ -749,7 +745,7 @@
|
||||||
|
/* `sysconf' does not support _SC_GETPW_R_SIZE_MAX. Try a
|
||||||
|
moderate value. */
|
||||||
|
buflen = 1024;
|
||||||
|
- pwtmpbuf = (char *) __alloca (buflen);
|
||||||
|
+ pwtmpbuf = (char *) alloca (buflen);
|
||||||
|
|
||||||
|
while (getpwnam_r (user_name, &pwbuf, pwtmpbuf, buflen, &p) != 0)
|
||||||
|
{
|
||||||
|
@@ -759,7 +755,7 @@
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
buflen *= 2;
|
||||||
|
- pwtmpbuf = __alloca (buflen);
|
||||||
|
+ pwtmpbuf = alloca (buflen);
|
||||||
|
__set_errno (save);
|
||||||
|
}
|
||||||
|
# else
|
||||||
|
@@ -776,7 +772,7 @@
|
||||||
|
char *newp;
|
||||||
|
size_t home_len = strlen (home_dir);
|
||||||
|
size_t rest_len = end_name == NULL ? 0 : strlen (end_name);
|
||||||
|
- newp = (char *) __alloca (home_len + rest_len + 1);
|
||||||
|
+ newp = (char *) alloca (home_len + rest_len + 1);
|
||||||
|
# ifdef HAVE_MEMPCPY
|
||||||
|
*((char *) mempcpy (mempcpy (newp, home_dir, home_len),
|
||||||
|
end_name, rest_len)) = '\0';
|
||||||
|
@@ -1268,7 +1264,7 @@
|
||||||
|
struct stat st;
|
||||||
|
size_t patlen = strlen (pattern);
|
||||||
|
size_t dirlen = strlen (directory);
|
||||||
|
- char *fullname = (char *) __alloca (dirlen + 1 + patlen + 1);
|
||||||
|
+ char *fullname = (char *) alloca (dirlen + 1 + patlen + 1);
|
||||||
|
|
||||||
|
# ifdef HAVE_MEMPCPY
|
||||||
|
mempcpy (mempcpy (mempcpy (fullname, directory, dirlen),
|
||||||
|
@@ -1299,7 +1295,7 @@
|
||||||
|
{
|
||||||
|
/* This is a special case for matching directories like in
|
||||||
|
"*a/". */
|
||||||
|
- names = (struct globlink *) __alloca (sizeof (struct globlink));
|
||||||
|
+ names = (struct globlink *) alloca (sizeof (struct globlink));
|
||||||
|
names->name = (char *) malloc (1);
|
||||||
|
if (names->name == NULL)
|
||||||
|
goto memory_error;
|
||||||
|
@@ -1358,7 +1354,7 @@
|
||||||
|
if (fnmatch (pattern, name, fnm_flags) == 0)
|
||||||
|
{
|
||||||
|
struct globlink *new = (struct globlink *)
|
||||||
|
- __alloca (sizeof (struct globlink));
|
||||||
|
+ alloca (sizeof (struct globlink));
|
||||||
|
len = NAMLEN (d);
|
||||||
|
new->name = (char *) malloc (len + 1);
|
||||||
|
if (new->name == NULL)
|
||||||
|
@@ -1383,7 +1379,7 @@
|
||||||
|
{
|
||||||
|
size_t len = strlen (pattern);
|
||||||
|
nfound = 1;
|
||||||
|
- names = (struct globlink *) __alloca (sizeof (struct globlink));
|
||||||
|
+ names = (struct globlink *) alloca (sizeof (struct globlink));
|
||||||
|
names->next = NULL;
|
||||||
|
names->name = (char *) malloc (len + 1);
|
||||||
|
if (names->name == NULL)
|
Loading…
x
Reference in New Issue
Block a user