summaryrefslogtreecommitdiff
path: root/source/d/make
diff options
context:
space:
mode:
Diffstat (limited to 'source/d/make')
-rw-r--r--source/d/make/b552b05251980f693c729e251f93f5225b400714.patch170
-rw-r--r--source/d/make/make-4.0-noclock_gettime.patch14
-rw-r--r--source/d/make/make-4.3-getcwd.patch12
-rw-r--r--source/d/make/make-4.3-j8k.patch25
-rwxr-xr-xsource/d/make/make.SlackBuild15
-rw-r--r--source/d/make/make.glibc-2.27.glob.diff32
-rw-r--r--source/d/make/make.guile30.diff13
7 files changed, 59 insertions, 222 deletions
diff --git a/source/d/make/b552b05251980f693c729e251f93f5225b400714.patch b/source/d/make/b552b05251980f693c729e251f93f5225b400714.patch
deleted file mode 100644
index 6f44ae3f..00000000
--- a/source/d/make/b552b05251980f693c729e251f93f5225b400714.patch
+++ /dev/null
@@ -1,170 +0,0 @@
-From b552b05251980f693c729e251f93f5225b400714 Mon Sep 17 00:00:00 2001
-From: Paul Smith <psmith@gnu.org>
-Date: Sat, 3 Jun 2017 16:20:51 -0400
-Subject: [SV 51159] Use a non-blocking read with pselect to avoid hangs.
-
-* posixos.c (set_blocking): Set blocking on a file descriptor.
-(jobserver_setup): Set non-blocking on the jobserver read side.
-(jobserver_parse_auth): Ditto.
-(jobserver_acquire_all): Set blocking to avoid a busy-wait loop.
-(jobserver_acquire): If the non-blocking read() returns without
-taking a token then try again.
----
- posixos.c | 97 ++++++++++++++++++++++++++++++++++++++++++++++-----------------
- 1 file changed, 71 insertions(+), 26 deletions(-)
-
-diff --git a/posixos.c b/posixos.c
-index e642d7f..dbafa51 100644
---- a/posixos.c
-+++ b/posixos.c
-@@ -62,6 +62,24 @@ make_job_rfd (void)
- #endif
- }
-
-+static void
-+set_blocking (int fd, int blocking)
-+{
-+ // If we're not using pselect() don't change the blocking
-+#ifdef HAVE_PSELECT
-+ int flags;
-+ EINTRLOOP (flags, fcntl (fd, F_GETFL));
-+ if (flags >= 0)
-+ {
-+ int r;
-+ flags = blocking ? (flags & ~O_NONBLOCK) : (flags | O_NONBLOCK);
-+ EINTRLOOP (r, fcntl (fd, F_SETFL, flags));
-+ if (r < 0)
-+ pfatal_with_name ("fcntl(O_NONBLOCK)");
-+ }
-+#endif
-+}
-+
- unsigned int
- jobserver_setup (int slots)
- {
-@@ -86,6 +104,9 @@ jobserver_setup (int slots)
- pfatal_with_name (_("init jobserver pipe"));
- }
-
-+ /* When using pselect() we want the read to be non-blocking. */
-+ set_blocking (job_fds[0], 0);
-+
- return 1;
- }
-
-@@ -121,6 +142,9 @@ jobserver_parse_auth (const char *auth)
- return 0;
- }
-
-+ /* When using pselect() we want the read to be non-blocking. */
-+ set_blocking (job_fds[0], 0);
-+
- return 1;
- }
-
-@@ -169,7 +193,10 @@ jobserver_acquire_all (void)
- {
- unsigned int tokens = 0;
-
-- /* Close the write side, so the read() won't hang. */
-+ /* Use blocking reads to wait for all outstanding jobs. */
-+ set_blocking (job_fds[0], 1);
-+
-+ /* Close the write side, so the read() won't hang forever. */
- close (job_fds[1]);
- job_fds[1] = -1;
-
-@@ -236,18 +263,12 @@ jobserver_pre_acquire (void)
- unsigned int
- jobserver_acquire (int timeout)
- {
-- sigset_t empty;
-- fd_set readfds;
- struct timespec spec;
- struct timespec *specp = NULL;
-- int r;
-- char intake;
-+ sigset_t empty;
-
- sigemptyset (&empty);
-
-- FD_ZERO (&readfds);
-- FD_SET (job_fds[0], &readfds);
--
- if (timeout)
- {
- /* Alarm after one second (is this too granular?) */
-@@ -256,28 +277,52 @@ jobserver_acquire (int timeout)
- specp = &spec;
- }
-
-- r = pselect (job_fds[0]+1, &readfds, NULL, NULL, specp, &empty);
--
-- if (r == -1)
-+ while (1)
- {
-- /* Better be SIGCHLD. */
-- if (errno != EINTR)
-- pfatal_with_name (_("pselect jobs pipe"));
-- return 0;
-- }
-+ fd_set readfds;
-+ int r;
-+ char intake;
-
-- if (r == 0)
-- /* Timeout. */
-- return 0;
-+ FD_ZERO (&readfds);
-+ FD_SET (job_fds[0], &readfds);
-
-- /* The read FD is ready: read it! */
-- EINTRLOOP (r, read (job_fds[0], &intake, 1));
-- if (r < 0)
-- pfatal_with_name (_("read jobs pipe"));
-+ r = pselect (job_fds[0]+1, &readfds, NULL, NULL, specp, &empty);
-+ if (r < 0)
-+ switch (errno)
-+ {
-+ case EINTR:
-+ /* SIGCHLD will show up as an EINTR. */
-+ return 0;
-+
-+ case EBADF:
-+ /* Someone closed the jobs pipe.
-+ That shouldn't happen but if it does we're done. */
-+ O (fatal, NILF, _("job server shut down"));
-
-- /* What does it mean if read() returns 0? It shouldn't happen because only
-- the master make can reap all the tokens and close the write side...?? */
-- return r > 0;
-+ default:
-+ pfatal_with_name (_("pselect jobs pipe"));
-+ }
-+
-+ if (r == 0)
-+ /* Timeout. */
-+ return 0;
-+
-+ /* The read FD is ready: read it! This is non-blocking. */
-+ EINTRLOOP (r, read (job_fds[0], &intake, 1));
-+
-+ if (r < 0)
-+ {
-+ /* Someone sniped our token! Try again. */
-+ if (errno == EAGAIN)
-+ continue;
-+
-+ pfatal_with_name (_("read jobs pipe"));
-+ }
-+
-+ /* read() should never return 0: only the master make can reap all the
-+ tokens and close the write side...?? */
-+ return r > 0;
-+ }
- }
-
- #else
---
-cgit v1.0-41-gc330
-
diff --git a/source/d/make/make-4.0-noclock_gettime.patch b/source/d/make/make-4.0-noclock_gettime.patch
new file mode 100644
index 00000000..f63e1fc7
--- /dev/null
+++ b/source/d/make/make-4.0-noclock_gettime.patch
@@ -0,0 +1,14 @@
+diff -up make-3.82/configure\~ make-3.82/configure
+--- make-3.82/configure~ 2010-07-28 07:41:51.000000000 +0200
++++ make-3.82/configure 2010-08-11 15:07:50.000000000 +0200
+@@ -7215,7 +7215,7 @@ return clock_gettime ();
+ return 0;
+ }
+ _ACEOF
+-for ac_lib in '' rt posix4; do
++for ac_lib in '' posix4; do
+ if test -z "$ac_lib"; then
+ ac_res="none required"
+ else
+
+Diff finished. Wed Aug 11 15:07:59 2010
diff --git a/source/d/make/make-4.3-getcwd.patch b/source/d/make/make-4.3-getcwd.patch
new file mode 100644
index 00000000..7f6f18fa
--- /dev/null
+++ b/source/d/make/make-4.3-getcwd.patch
@@ -0,0 +1,12 @@
+diff -Nrup a/src/makeint.h b/src/makeint.h
+--- a/src/makeint.h 2016-05-21 16:22:32.000000000 -0400
++++ b/src/makeint.h 2016-09-22 16:12:38.606702160 -0400
+@@ -596,7 +596,7 @@ long int lseek ();
+ # endif
+
+ # ifdef HAVE_GETCWD
+-# if !defined(VMS) && !defined(__DECC)
++# if !defined(VMS) && !defined(__DECC) && !defined(getcwd)
+ char *getcwd ();
+ # endif
+ # else
diff --git a/source/d/make/make-4.3-j8k.patch b/source/d/make/make-4.3-j8k.patch
new file mode 100644
index 00000000..60a0c7fb
--- /dev/null
+++ b/source/d/make/make-4.3-j8k.patch
@@ -0,0 +1,25 @@
+diff -Nrup a/src/main.c b/src/main.c
+--- a/src/main.c 2016-05-31 03:17:26.000000000 -0400
++++ b/src/main.c 2016-09-22 16:18:52.283889265 -0400
+@@ -2051,6 +2051,21 @@ main (int argc, char **argv, char **envp
+ }
+ #endif
+
++#ifdef PIPE_BUF
++ if (job_slots > PIPE_BUF)
++#elif defined _POSIX_PIPE_BUF
++ if (job_slots > _POSIX_PIPE_BUF)
++#else
++ if (job_slots > 512)
++#endif
++ {
++ O (error, NILF,
++ _("More parallel jobs (-jN) than this platform can handle requested."));
++ O (error, NILF, _("Resetting to single job (-j1) mode."));
++ job_slots = 1;
++ }
++
++
+ /* If we have >1 slot at this point, then we're a top-level make.
+ Set up the jobserver.
+
diff --git a/source/d/make/make.SlackBuild b/source/d/make/make.SlackBuild
index f97a27c2..01036257 100755
--- a/source/d/make/make.SlackBuild
+++ b/source/d/make/make.SlackBuild
@@ -1,6 +1,6 @@
#!/bin/bash
-# Copyright 2005-2020 Patrick J. Volkerding, Sebeka, Minnesota, USA
+# Copyright 2005-2021 Patrick J. Volkerding, Sebeka, Minnesota, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -23,8 +23,8 @@
cd $(dirname $0) ; CWD=$(pwd)
PKGNAM=make
-VERSION=${VERSION:-$(echo $PKGNAM-*.tar.bz2 | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
-BUILD=${BUILD:-8}
+VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
+BUILD=${BUILD:-2}
# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
@@ -68,7 +68,7 @@ mkdir -p $TMP $PKG
cd $TMP
rm -rf make-$VERSION
-tar xvf $CWD/make-$VERSION.tar.bz2 || exit 1
+tar xvf $CWD/make-$VERSION.tar.?z || exit 1
cd make-$VERSION || exit 1
chown -R root:root .
find . \
@@ -77,9 +77,10 @@ find . \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \+
-zcat $CWD/make.guile30.diff.gz | patch -p1 --verbose || exit 1
-zcat $CWD/make.glibc-2.27.glob.diff.gz | patch -p1 --verbose || exit 1
-zcat $CWD/b552b05251980f693c729e251f93f5225b400714.patch.gz | patch -p1 --verbose || exit 1
+# Patches from Fedora:
+zcat $CWD/make-4.0-noclock_gettime.patch.gz | patch -p1 --verbose || exit 1
+zcat $CWD/make-4.3-getcwd.patch.gz | patch -p1 --verbose || exit 1
+zcat $CWD/make-4.3-j8k.patch.gz | patch -p1 --verbose || exit 1
autoreconf -vif
diff --git a/source/d/make/make.glibc-2.27.glob.diff b/source/d/make/make.glibc-2.27.glob.diff
deleted file mode 100644
index 8d795f89..00000000
--- a/source/d/make/make.glibc-2.27.glob.diff
+++ /dev/null
@@ -1,32 +0,0 @@
-diff -u -r make-4.2.1.orig/glob/glob.c make-4.2.1/glob/glob.c
---- make-4.2.1.orig/glob/glob.c 2013-10-20 12:14:38.000000000 -0500
-+++ make-4.2.1/glob/glob.c 2018-02-16 14:41:18.956182332 -0600
-@@ -208,28 +208,9 @@
- #endif /* __GNU_LIBRARY__ || __DJGPP__ */
-
-
--#if !defined __alloca && !defined __GNU_LIBRARY__
--
--# ifdef __GNUC__
--# undef alloca
--# define alloca(n) __builtin_alloca (n)
--# else /* Not GCC. */
--# ifdef HAVE_ALLOCA_H
- # include <alloca.h>
--# else /* Not HAVE_ALLOCA_H. */
--# ifndef _AIX
--# ifdef WINDOWS32
--# include <malloc.h>
--# else
--extern char *alloca ();
--# endif /* WINDOWS32 */
--# endif /* Not _AIX. */
--# endif /* sparc or HAVE_ALLOCA_H. */
--# endif /* GCC. */
--
- # define __alloca alloca
-
--#endif
-
- #ifndef __GNU_LIBRARY__
- # define __stat stat
diff --git a/source/d/make/make.guile30.diff b/source/d/make/make.guile30.diff
deleted file mode 100644
index 8b13b14d..00000000
--- a/source/d/make/make.guile30.diff
+++ /dev/null
@@ -1,13 +0,0 @@
---- ./configure.ac.orig 2016-06-06 07:27:31.000000000 -0500
-+++ ./configure.ac 2017-12-02 12:21:41.682170019 -0600
-@@ -168,8 +168,8 @@
- # comes with it's own PC file so we have to specify them as individual
- # packages. Ugh.
- AS_IF([test "x$with_guile" != xno],
--[ PKG_CHECK_MODULES([GUILE], [guile-2.0], [have_guile=yes],
-- [PKG_CHECK_MODULES([GUILE], [guile-1.8], [have_guile=yes],
-+[ PKG_CHECK_MODULES([GUILE], [guile-3.0], [have_guile=yes],
-+ [PKG_CHECK_MODULES([GUILE], [guile-2.0], [have_guile=yes],
- [have_guile=no])])
- ])
-