Compare commits
No commits in common. "c9-beta" and "c8" have entirely different histories.
2
.gitignore
vendored
2
.gitignore
vendored
@ -1 +1 @@
|
||||
SOURCES/make-4.3.tar.gz
|
||||
SOURCES/make-4.2.1.tar.bz2
|
||||
|
@ -1 +1 @@
|
||||
3c40e5b49b893dbb14f1e2e1f8fe89b7298cc51d SOURCES/make-4.3.tar.gz
|
||||
7d9d11eb36cfb752da1fb11bb3e521d2a3cc8830 SOURCES/make-4.2.1.tar.bz2
|
||||
|
19
SOURCES/make-4.0-newlines.patch
Normal file
19
SOURCES/make-4.0-newlines.patch
Normal file
@ -0,0 +1,19 @@
|
||||
diff -Nrup a/job.c b/job.c
|
||||
--- a/job.c 2014-02-03 18:23:45.936436714 -0500
|
||||
+++ b/job.c 2014-02-04 00:17:53.232074893 -0500
|
||||
@@ -3269,13 +3269,14 @@ construct_command_argv_internal (char *l
|
||||
#endif
|
||||
if (PRESERVE_BSNL)
|
||||
{
|
||||
- *(ap++) = '\\';
|
||||
+ *(ap++) = '\'';
|
||||
/* Only non-batch execution needs another backslash,
|
||||
because it will be passed through a recursive
|
||||
invocation of this function. */
|
||||
if (!batch_mode_shell)
|
||||
*(ap++) = '\\';
|
||||
*(ap++) = '\n';
|
||||
+ *(ap++) = '\'';
|
||||
}
|
||||
++p;
|
||||
continue;
|
16
SOURCES/make-4.0-weird-shell.patch
Normal file
16
SOURCES/make-4.0-weird-shell.patch
Normal file
@ -0,0 +1,16 @@
|
||||
diff -up make-3.82/job.c\~ make-3.82/job.c
|
||||
--- make-3.82/job.c~ 2010-08-11 16:13:33.000000000 +0200
|
||||
+++ make-3.82/job.c 2010-08-12 14:20:08.000000000 +0200
|
||||
@@ -2442,7 +2442,11 @@ construct_command_argv_internal (char *l
|
||||
|
||||
/* See if it is safe to parse commands internally. */
|
||||
if (shell == 0)
|
||||
- shell = default_shell;
|
||||
+ {
|
||||
+ shell = default_shell;
|
||||
+ if (shellflags == 0)
|
||||
+ shellflags = "-c";
|
||||
+ }
|
||||
#ifdef WINDOWS32
|
||||
else if (strcmp (shell, default_shell))
|
||||
{
|
@ -1,6 +1,6 @@
|
||||
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
|
||||
diff -Nrup a/makeint.h b/makeint.h
|
||||
--- a/makeint.h 2016-05-21 16:22:32.000000000 -0400
|
||||
+++ b/makeint.h 2016-09-22 16:12:38.606702160 -0400
|
||||
@@ -596,7 +596,7 @@ long int lseek ();
|
||||
# endif
|
||||
|
@ -1,6 +1,6 @@
|
||||
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
|
||||
diff -Nrup a/main.c b/main.c
|
||||
--- a/main.c 2016-05-31 03:17:26.000000000 -0400
|
||||
+++ b/main.c 2016-09-22 16:18:52.283889265 -0400
|
||||
@@ -2051,6 +2051,21 @@ main (int argc, char **argv, char **envp
|
||||
}
|
||||
#endif
|
67
SOURCES/make-4.2.1-glob-fix-2.patch
Normal file
67
SOURCES/make-4.2.1-glob-fix-2.patch
Normal file
@ -0,0 +1,67 @@
|
||||
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: 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(-)
|
||||
|
||||
diff --git a/dir.c b/dir.c
|
||||
index adbb8a9..c343e4c 100644
|
||||
--- a/dir.c
|
||||
+++ b/dir.c
|
||||
@@ -1299,15 +1299,40 @@ local_stat (const char *path, struct stat *buf)
|
||||
}
|
||||
#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)
|
||||
{
|
||||
gl->gl_opendir = open_dirstream;
|
||||
gl->gl_readdir = read_dirstream;
|
||||
gl->gl_closedir = free;
|
||||
+ gl->gl_lstat = local_lstat;
|
||||
gl->gl_stat = local_stat;
|
||||
- /* We don't bother setting gl_lstat, since glob never calls it.
|
||||
- The slot is only there for compatibility with 4.4 BSD. */
|
||||
}
|
||||
|
||||
void
|
||||
--
|
||||
cgit v1.0-41-gc330
|
||||
|
15
SOURCES/make-4.2.1-glob-fix-3.patch
Normal file
15
SOURCES/make-4.2.1-glob-fix-3.patch
Normal file
@ -0,0 +1,15 @@
|
||||
diff -Nrup a/configure b/configure
|
||||
--- a/configure 2018-03-18 23:53:43.991741060 -0400
|
||||
+++ b/configure 2018-03-18 23:52:52.456028175 -0400
|
||||
@@ -11481,10 +11481,9 @@ else
|
||||
#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
|
28
SOURCES/make-4.2.1-glob-fix.patch
Normal file
28
SOURCES/make-4.2.1-glob-fix.patch
Normal file
@ -0,0 +1,28 @@
|
||||
From 48c8a116a914a325a0497721f5d8b58d5bba34d4 Mon Sep 17 00:00:00 2001
|
||||
From: Paul Smith <psmith@gnu.org>
|
||||
Date: Sun, 19 Nov 2017 15:09:16 -0500
|
||||
Subject: * configure.ac: Support GLIBC glob interface version 2
|
||||
|
||||
---
|
||||
configure.ac | 3 +--
|
||||
1 file changed, 1 insertion(+), 2 deletions(-)
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index 8c72568..4710832 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -404,10 +404,9 @@ AC_CACHE_CHECK([if system libc has GNU glob], [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],
|
||||
--
|
||||
cgit v1.0-41-gc330
|
||||
|
442
SOURCES/make-4.2.1-jvar.patch
Normal file
442
SOURCES/make-4.2.1-jvar.patch
Normal file
@ -0,0 +1,442 @@
|
||||
From 0c5a9f9b92af1634dc60fa21e9ac86ed50e5d595 Mon Sep 17 00:00:00 2001
|
||||
From: Paul Smith <psmith@gnu.org>
|
||||
Date: Mon, 30 Oct 2017 12:53:49 -0400
|
||||
Subject: * main.c (main): [SV 48274] Allow -j in makefile MAKEFLAGS variable.
|
||||
|
||||
* tests/jhelp.pl: New file to allow testing parallelism without sleep.
|
||||
* tests/scripts/features/parallelism: Test this.
|
||||
* tests/scripts/features/jobserver: Update tests.
|
||||
* tests/scripts/features/output-sync: Remove useless rm command.
|
||||
---
|
||||
main.c | 80 ++++++++++++++++++++++++++--------
|
||||
tests/jhelp.pl | 63 +++++++++++++++++++++++++++
|
||||
tests/scripts/features/jobserver | 6 +--
|
||||
tests/scripts/features/output-sync | 2 +-
|
||||
tests/scripts/features/parallelism | 89 +++++++++++++++++++++-----------------
|
||||
5 files changed, 177 insertions(+), 63 deletions(-)
|
||||
create mode 100755 tests/jhelp.pl
|
||||
|
||||
diff -rupN a/main.c b/main.c
|
||||
--- a/main.c 2021-10-18 15:23:21.769274000 -0400
|
||||
+++ b/main.c 2021-10-18 15:30:43.579608645 -0400
|
||||
@@ -1482,7 +1482,7 @@ main (int argc, char **argv, char **envp
|
||||
|| output_sync == OUTPUT_SYNC_TARGET);
|
||||
OUTPUT_SET (&make_sync);
|
||||
|
||||
- /* Remember the job slots set through the environment vs. command line. */
|
||||
+ /* Parse the command line options. Remember the job slots set this way. */
|
||||
{
|
||||
int env_slots = arg_job_slots;
|
||||
arg_job_slots = INVALID_JOB_SLOTS;
|
||||
@@ -1609,41 +1609,38 @@ main (int argc, char **argv, char **envp
|
||||
/* We may move, but until we do, here we are. */
|
||||
starting_directory = current_directory;
|
||||
|
||||
- /* Set up the job_slots value and the jobserver. This can't be usefully set
|
||||
- in the makefile, and we want to verify the authorization is valid before
|
||||
- make has a chance to start using it for something else. */
|
||||
+ /* Validate the arg_job_slots configuration before we define MAKEFLAGS so
|
||||
+ users get an accurate value in their makefiles.
|
||||
+ At this point arg_job_slots is the argv setting, if there is one, else
|
||||
+ the MAKEFLAGS env setting, if there is one. */
|
||||
|
||||
if (jobserver_auth)
|
||||
{
|
||||
+ /* We're a child in an existing jobserver group. */
|
||||
if (argv_slots == INVALID_JOB_SLOTS)
|
||||
{
|
||||
+ /* There's no -j option on the command line: check authorization. */
|
||||
if (jobserver_parse_auth (jobserver_auth))
|
||||
{
|
||||
/* Success! Use the jobserver. */
|
||||
- job_slots = 0;
|
||||
goto job_setup_complete;
|
||||
}
|
||||
|
||||
+ /* Oops: we have jobserver-auth but it's invalid :(. */
|
||||
O (error, NILF, _("warning: jobserver unavailable: using -j1. Add '+' to parent make rule."));
|
||||
arg_job_slots = 1;
|
||||
}
|
||||
|
||||
- /* The user provided a -j setting on the command line: use it. */
|
||||
+ /* The user provided a -j setting on the command line so use it: we're
|
||||
+ the master make of a new jobserver group. */
|
||||
else if (!restarts)
|
||||
- /* If restarts is >0 we already printed this message. */
|
||||
- O (error, NILF,
|
||||
- _("warning: -jN forced in submake: disabling jobserver mode."));
|
||||
+ ON (error, NILF,
|
||||
+ _("warning: -j%d forced in submake: resetting jobserver mode."),
|
||||
+ argv_slots);
|
||||
|
||||
- /* We failed to use our parent's jobserver. */
|
||||
+ /* We can't use our parent's jobserver, so reset. */
|
||||
reset_jobserver ();
|
||||
- job_slots = (unsigned int)arg_job_slots;
|
||||
}
|
||||
- else if (arg_job_slots == INVALID_JOB_SLOTS)
|
||||
- /* The default is one job at a time. */
|
||||
- job_slots = 1;
|
||||
- else
|
||||
- /* Use whatever was provided. */
|
||||
- job_slots = (unsigned int)arg_job_slots;
|
||||
|
||||
job_setup_complete:
|
||||
|
||||
@@ -1999,6 +1996,9 @@ main (int argc, char **argv, char **envp
|
||||
{
|
||||
int old_builtin_rules_flag = no_builtin_rules_flag;
|
||||
int old_builtin_variables_flag = no_builtin_variables_flag;
|
||||
+ int old_arg_job_slots = arg_job_slots;
|
||||
+
|
||||
+ arg_job_slots = INVALID_JOB_SLOTS;
|
||||
|
||||
/* Decode switches again, for variables set by the makefile. */
|
||||
decode_env_switches (STRING_SIZE_TUPLE ("GNUMAKEFLAGS"));
|
||||
@@ -2011,6 +2011,24 @@ main (int argc, char **argv, char **envp
|
||||
decode_env_switches (STRING_SIZE_TUPLE ("MFLAGS"));
|
||||
#endif
|
||||
|
||||
+ /* If -j is not set in the makefile, or it was set on the command line,
|
||||
+ reset to use the previous value. */
|
||||
+ if (arg_job_slots == INVALID_JOB_SLOTS || argv_slots != INVALID_JOB_SLOTS)
|
||||
+ arg_job_slots = old_arg_job_slots;
|
||||
+
|
||||
+ else if (jobserver_auth)
|
||||
+ {
|
||||
+ /* Makefile MAKEFLAGS set -j, but we already have a jobserver.
|
||||
+ Make us the master of a new jobserver group. */
|
||||
+ if (!restarts)
|
||||
+ ON (error, NILF,
|
||||
+ _("warning: -j%d forced in makefile: resetting jobserver mode."),
|
||||
+ arg_job_slots);
|
||||
+
|
||||
+ /* We can't use our parent's jobserver, so reset. */
|
||||
+ reset_jobserver ();
|
||||
+ }
|
||||
+
|
||||
/* Reset in case the switches changed our mind. */
|
||||
syncing = (output_sync == OUTPUT_SYNC_LINE
|
||||
|| output_sync == OUTPUT_SYNC_TARGET);
|
||||
@@ -2037,8 +2055,31 @@ main (int argc, char **argv, char **envp
|
||||
undefine_default_variables ();
|
||||
}
|
||||
|
||||
+ /* Final jobserver configuration.
|
||||
+
|
||||
+ If we have jobserver_auth then we are a client in an existing jobserver
|
||||
+ group, that's already been verified OK above. If we don't have
|
||||
+ jobserver_auth and jobserver is enabled, then start a new jobserver.
|
||||
+
|
||||
+ arg_job_slots = INVALID_JOB_SLOTS if we don't want -j in MAKEFLAGS
|
||||
+
|
||||
+ arg_job_slots = # of jobs of parallelism
|
||||
+
|
||||
+ job_slots = 0 for no limits on jobs, or when limiting via jobserver.
|
||||
+
|
||||
+ job_slots = 1 for standard non-parallel mode.
|
||||
+
|
||||
+ job_slots >1 for old-style parallelism without jobservers. */
|
||||
+
|
||||
+ if (jobserver_auth)
|
||||
+ job_slots = 0;
|
||||
+ else if (arg_job_slots == INVALID_JOB_SLOTS)
|
||||
+ job_slots = 1;
|
||||
+ else
|
||||
+ job_slots = arg_job_slots;
|
||||
+
|
||||
#if defined (__MSDOS__) || defined (__EMX__) || defined (VMS)
|
||||
- if (arg_job_slots != 1
|
||||
+ if (job_slots != 1
|
||||
# ifdef __EMX__
|
||||
&& _osmode != OS2_MODE /* turn off -j if we are in DOS mode */
|
||||
# endif
|
||||
@@ -2047,7 +2088,8 @@ main (int argc, char **argv, char **envp
|
||||
O (error, NILF,
|
||||
_("Parallel jobs (-j) are not supported on this platform."));
|
||||
O (error, NILF, _("Resetting to single job (-j1) mode."));
|
||||
- arg_job_slots = job_slots = 1;
|
||||
+ arg_job_slots = INVALID_JOB_SLOTS;
|
||||
+ job_slots = 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
diff -rupN a/tests/jhelp.pl b/tests/jhelp.pl
|
||||
--- a/tests/jhelp.pl 1969-12-31 19:00:00.000000000 -0500
|
||||
+++ b/tests/jhelp.pl 2021-10-18 15:30:43.582608763 -0400
|
||||
@@ -0,0 +1,63 @@
|
||||
+#!/usr/bin/env perl
|
||||
+# -*-perl-*-
|
||||
+#
|
||||
+# This script helps us test jobserver/parallelism without a lot of unreliable
|
||||
+# (and slow) sleep calls. Written in Perl to get portable sub-second sleep.
|
||||
+#
|
||||
+# It can run the following steps based on arguments:
|
||||
+# -t <secs> : maximum # of seconds the script can run; else we fail.
|
||||
+# Default is 4 seconds.
|
||||
+# -e <word> : echo <word> to stdout
|
||||
+# -f <word> : echo <word> to stdout AND create an (empty) file named <word>
|
||||
+# -w <word> : wait for a file named <word> to exist
|
||||
+
|
||||
+# Force flush
|
||||
+$| = 1;
|
||||
+
|
||||
+my $timeout = 4;
|
||||
+
|
||||
+sub op {
|
||||
+ my ($op, $nm) = @_;
|
||||
+
|
||||
+ defined $nm or die "Missing value for $op\n";
|
||||
+
|
||||
+ if ($op eq '-e') {
|
||||
+ print "$nm\n";
|
||||
+ return 1;
|
||||
+ }
|
||||
+
|
||||
+ if ($op eq '-f') {
|
||||
+ print "$nm\n";
|
||||
+ open(my $fh, '>', $nm) or die "$nm: open: $!\n";
|
||||
+ close(my $fh);
|
||||
+ return 1;
|
||||
+ }
|
||||
+
|
||||
+ if ($op eq '-w') {
|
||||
+ if (-f $nm) {
|
||||
+ return 1;
|
||||
+ }
|
||||
+ select(undef, undef, undef, 0.1);
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ if ($op eq '-t') {
|
||||
+ $timeout = $nm;
|
||||
+ return 1;
|
||||
+ }
|
||||
+
|
||||
+ die("Invalid command: $op $nm\n");
|
||||
+}
|
||||
+
|
||||
+my $start = time();
|
||||
+while (@ARGV) {
|
||||
+ if (op($ARGV[0], $ARGV[1])) {
|
||||
+ shift;
|
||||
+ shift;
|
||||
+ }
|
||||
+ if ($start + $timeout < time()) {
|
||||
+ die("Timeout after ".(time()-$start-1)." seconds\n");
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+exit(0);
|
||||
diff -rupN a/tests/scripts/features/jobserver b/tests/scripts/features/jobserver
|
||||
--- a/tests/scripts/features/jobserver 2016-04-09 19:07:29.000000000 -0400
|
||||
+++ b/tests/scripts/features/jobserver 2021-10-18 15:30:43.585608880 -0400
|
||||
@@ -42,7 +42,7 @@ recurse: ; @echo $@: "/$(SHOW)/"; $(MAKE
|
||||
recurse2: ; @echo $@: "/$(SHOW)/"; $(MAKE) -f #MAKEFILE# all
|
||||
all:;@echo $@: "/$(SHOW)/"
|
||||
!,
|
||||
- "-j2 $np", "recurse: /-j2 --jobserver-auth=<auth> $np/\n#MAKE#[1]: warning: -jN forced in submake: disabling jobserver mode.\nrecurse2: /-j3 --jobserver-auth=<auth> $np/\nall: /-j3 --jobserver-auth=<auth> $np/\n");
|
||||
+ "-j2 $np", "recurse: /-j2 --jobserver-auth=<auth> $np/\n#MAKE#[1]: warning: -j3 forced in submake: resetting jobserver mode.\nrecurse2: /-j3 --jobserver-auth=<auth> $np/\nall: /-j3 --jobserver-auth=<auth> $np/\n");
|
||||
delete $extraENV{MAKEFLAGS};
|
||||
|
||||
# Test override of -jN with -j
|
||||
@@ -52,7 +52,7 @@ recurse: ; @echo $@: "/$(SHOW)/"; $(MAKE
|
||||
recurse2: ; @echo $@: "/$(SHOW)/"; $(MAKE) -f #MAKEFILE# all
|
||||
all:;@echo $@: "/$(SHOW)/"
|
||||
!,
|
||||
- "-j2 $np", "recurse: /-j2 --jobserver-auth=<auth> $np/\n#MAKE#[1]: warning: -jN forced in submake: disabling jobserver mode.\nrecurse2: /-j $np/\nall: /-j $np/\n");
|
||||
+ "-j2 $np", "recurse: /-j2 --jobserver-auth=<auth> $np/\n#MAKE#[1]: warning: -j0 forced in submake: resetting jobserver mode.\nrecurse2: /-j $np/\nall: /-j $np/\n");
|
||||
|
||||
# Don't put --jobserver-auth into a re-exec'd MAKEFLAGS.
|
||||
# We can't test this directly because there's no way a makefile can
|
||||
@@ -76,7 +76,7 @@ inc.mk:
|
||||
# @echo 'MAKEFLAGS = $(MAKEFLAGS)'
|
||||
@echo 'FOO = bar' > $@
|
||||
!,
|
||||
- "$np -j2", "#MAKE#[1]: warning: -jN forced in submake: disabling jobserver mode.\nall\n");
|
||||
+ "$np -j2", "#MAKE#[1]: warning: -j2 forced in submake: resetting jobserver mode.\nall\n");
|
||||
|
||||
unlink('inc.mk');
|
||||
|
||||
diff -rupN a/tests/scripts/features/output-sync b/tests/scripts/features/output-sync
|
||||
--- a/tests/scripts/features/output-sync 2016-04-23 10:09:35.000000000 -0400
|
||||
+++ b/tests/scripts/features/output-sync 2021-10-18 15:31:40.903857757 -0400
|
||||
@@ -45,7 +45,7 @@ sub output_sync_clean {
|
||||
# reliable. If things are too fast, then sometimes a different job will steal
|
||||
# the output sync lock and the output is mis-ordered from what we expect.
|
||||
sub output_sync_wait {
|
||||
- return "while [ ! -f ../mksync.$_[0] ]; do :; done; rm -f ../mksync.$_[0].wait; $sleep_command 1";
|
||||
+ return "while [ ! -f ../mksync.$_[0] ]; do :; done; $sleep_command 1";
|
||||
}
|
||||
sub output_sync_set {
|
||||
return "date > ../mksync.$_[0]";
|
||||
diff -rupN a/tests/scripts/features/parallelism b/tests/scripts/features/parallelism
|
||||
--- a/tests/scripts/features/parallelism 2016-04-11 07:50:44.000000000 -0400
|
||||
+++ b/tests/scripts/features/parallelism 2021-10-18 17:12:39.005009030 -0400
|
||||
@@ -1,17 +1,7 @@
|
||||
# -*-perl-*-
|
||||
|
||||
$description = "Test parallelism (-j) option.";
|
||||
-
|
||||
-
|
||||
-$details = "This test creates a makefile with two double-colon default
|
||||
-rules. The first rule has a series of sleep and echo commands
|
||||
-intended to run in series. The second and third have just an
|
||||
-echo statement. When make is called in this test, it is given
|
||||
-the -j option with a value of 4. This tells make that it may
|
||||
-start up to four jobs simultaneously. In this case, since the
|
||||
-first command is a sleep command, the output of the second
|
||||
-and third commands will appear before the first if indeed
|
||||
-make is running all of these commands in parallel.";
|
||||
+$details = "";
|
||||
|
||||
if (!$parallel_jobs) {
|
||||
return -1;
|
||||
@@ -24,13 +14,36 @@ else {
|
||||
$sleep_command = "sleep";
|
||||
}
|
||||
|
||||
+rmfiles(qw(ONE TWO THREE FOUR));
|
||||
|
||||
run_make_test("
|
||||
all : def_1 def_2 def_3
|
||||
-def_1 : ; \@echo ONE; $sleep_command 3 ; echo TWO
|
||||
-def_2 : ; \@$sleep_command 2 ; echo THREE
|
||||
-def_3 : ; \@$sleep_command 1 ; echo FOUR",
|
||||
+def_1 : ; \@#PERL# jhelp.pl -f ONE -w THREE -e TWO
|
||||
+def_2 : ; \@#PERL# jhelp.pl -w FOUR -f THREE
|
||||
+def_3 : ; \@#PERL# jhelp.pl -w ONE -f FOUR",
|
||||
'-j4', "ONE\nFOUR\nTHREE\nTWO");
|
||||
+rmfiles(qw(ONE TWO THREE FOUR));
|
||||
+
|
||||
+# Verify -j added to MAKEFLAGS in the makefile
|
||||
+run_make_test("
|
||||
+MAKEFLAGS += -j4
|
||||
+all : def_1 def_2 def_3
|
||||
+def_1 : ; \@#PERL# jhelp.pl -f ONE -w THREE -e TWO
|
||||
+def_2 : ; \@#PERL# jhelp.pl -w FOUR -f THREE
|
||||
+def_3 : ; \@#PERL# jhelp.pl -w ONE -f FOUR",
|
||||
+ '', "ONE\nFOUR\nTHREE\nTWO");
|
||||
+rmfiles(qw(ONE TWO THREE FOUR));
|
||||
+
|
||||
+# Command line should take precedence
|
||||
+rmfiles(qw(ONE TWO THREE FOUR));
|
||||
+run_make_test("
|
||||
+MAKEFLAGS += -j2
|
||||
+all : def_1 def_2 def_3
|
||||
+def_1 : ; \@#PERL# jhelp.pl -f ONE -w THREE -e TWO
|
||||
+def_2 : ; \@#PERL# jhelp.pl -w FOUR -f THREE
|
||||
+def_3 : ; \@#PERL# jhelp.pl -w ONE -f FOUR",
|
||||
+ '-j4', "ONE\nFOUR\nTHREE\nTWO");
|
||||
+rmfiles(qw(ONE TWO THREE FOUR));
|
||||
|
||||
# Test parallelism with included files. Here we sleep/echo while
|
||||
# building the included files, to test that they are being built in
|
||||
@@ -38,12 +51,12 @@ def_3 : ; \@$sleep_command 1 ; echo FOUR
|
||||
run_make_test("
|
||||
all: 1 2; \@echo success
|
||||
-include 1.inc 2.inc
|
||||
-1.inc: ; \@echo ONE.inc; $sleep_command 2; echo TWO.inc; echo '1: ; \@echo ONE; $sleep_command 2; echo TWO' > \$\@
|
||||
-2.inc: ; \@$sleep_command 1; echo THREE.inc; echo '2: ; \@$sleep_command 1; echo THREE' > \$\@",
|
||||
+1.inc: ; \@#PERL# jhelp.pl -f ONE.inc -w THREE.inc -f TWO.inc; echo '1: ; \@#PERL# jhelp.pl -f ONE -w THREE -f TWO' > \$\@
|
||||
+2.inc: ; \@#PERL# jhelp.pl -w ONE.inc -f THREE.inc; echo '2: ; \@#PERL# jhelp.pl -w ONE -f THREE' > \$\@",
|
||||
"-j4",
|
||||
"ONE.inc\nTHREE.inc\nTWO.inc\nONE\nTHREE\nTWO\nsuccess\n", 0, 7);
|
||||
|
||||
-rmfiles(qw(1.inc 2.inc));
|
||||
+rmfiles(qw(ONE.inc TWO.inc THREE.inc ONE TWO THREE 1.inc 2.inc));
|
||||
|
||||
|
||||
# Test parallelism with included files--this time recurse first and make
|
||||
@@ -57,12 +70,12 @@ ifeq (\$(INC),yes)
|
||||
-include 1.inc 2.inc
|
||||
endif
|
||||
|
||||
-1.inc: ; \@echo ONE.inc; $sleep_command 2; echo TWO.inc; echo '1: ; \@echo ONE; $sleep_command 2; echo TWO' > \$\@
|
||||
-2.inc: ; \@$sleep_command 1; echo THREE.inc; echo '2: ; \@$sleep_command 1; echo THREE' > \$\@",
|
||||
+1.inc: ; \@#PERL# jhelp.pl -f ONE.inc -w THREE.inc -f TWO.inc; echo '1: ; \@#PERL# jhelp.pl -f ONE -w THREE -f TWO' > \$\@
|
||||
+2.inc: ; \@#PERL# jhelp.pl -w ONE.inc -f THREE.inc; echo '2: ; \@#PERL# jhelp.pl -w ONE -f THREE' > \$\@",
|
||||
"-j4",
|
||||
"ONE.inc\nTHREE.inc\nTWO.inc\nONE\nTHREE\nTWO\nsuccess\n", 0, 7);
|
||||
|
||||
-rmfiles(qw(1.inc 2.inc));
|
||||
+rmfiles(qw(ONE.inc TWO.inc THREE.inc ONE TWO THREE 1.inc 2.inc));
|
||||
|
||||
# Grant Taylor reports a problem where tokens can be lost (not written back
|
||||
# to the pipe when they should be): this happened when there is a $(shell ...)
|
||||
@@ -90,21 +103,23 @@ run_make_test("
|
||||
.PHONY: all fail.1 fail.2 fail.3 ok
|
||||
all: fail.1 ok fail.2 fail.3
|
||||
|
||||
+.RECIPEPREFIX := >
|
||||
+
|
||||
fail.1 fail.2 fail.3:
|
||||
- \@$sleep_command \$(patsubst fail.%,%,\$\@)
|
||||
- \@echo Fail
|
||||
- \@exit 1
|
||||
+> \@$sleep_command \$(patsubst fail.%,%,\$\@)
|
||||
+> \@echo Fail
|
||||
+> \@exit 1
|
||||
|
||||
ok:
|
||||
- \@$sleep_command 4
|
||||
- \@echo Ok done",
|
||||
+> \@$sleep_command 4
|
||||
+> \@echo Ok done",
|
||||
'-rR -j5', "Fail
|
||||
-#MAKE#: *** [#MAKEFILE#:8: fail.1] Error 1
|
||||
+#MAKE#: *** [#MAKEFILE#:10: fail.1] Error 1
|
||||
#MAKE#: *** Waiting for unfinished jobs....
|
||||
Fail
|
||||
-#MAKE#: *** [#MAKEFILE#:8: fail.2] Error 1
|
||||
+#MAKE#: *** [#MAKEFILE#:10: fail.2] Error 1
|
||||
Fail
|
||||
-#MAKE#: *** [#MAKEFILE#:8: fail.3] Error 1
|
||||
+#MAKE#: *** [#MAKEFILE#:10: fail.3] Error 1
|
||||
Ok done",
|
||||
512);
|
||||
|
||||
@@ -117,13 +132,11 @@ all:; @:
|
||||
|
||||
-include foo.d
|
||||
|
||||
-foo.d: comp
|
||||
- @echo building $@
|
||||
+foo.d: comp ; @echo building $@
|
||||
|
||||
comp: mod_a.o mod_b.o; @:
|
||||
|
||||
-mod_a.o mod_b.o:
|
||||
- @exit 1
|
||||
+mod_a.o mod_b.o: ; @exit 1
|
||||
', '-j2', '');
|
||||
|
||||
|
||||
@@ -148,15 +161,15 @@ $extraENV{MAKEFLAGS} = '-j4';
|
||||
run_make_test(q!
|
||||
things = thing1 thing2
|
||||
all: $(things)
|
||||
-thing1:; @sleep 1; echo '$@ start'; sleep 2; echo '$@ end'
|
||||
-thing2:; @echo '$@ start'; sleep 2; echo '$@ end'
|
||||
+thing1:; @#PERL# jhelp.pl -w thing2start -f $@start -w thing2end -e $@end
|
||||
+thing2:; @#PERL# jhelp.pl -f $@start -w thing1start -f $@end
|
||||
-include inc.mk
|
||||
inc.mk: ; @touch $@
|
||||
!,
|
||||
- '', "thing2 start\nthing1 start\nthing2 end\nthing1 end\n");
|
||||
+ '', "thing2start\nthing1start\nthing2end\nthing1end\n");
|
||||
|
||||
delete $extraENV{MAKEFLAGS};
|
||||
-rmfiles('inc.mk');
|
||||
+rmfiles(qw(inc.mk thing1start thing1end thing2start thing2end));
|
||||
|
||||
# Ensure intermediate/secondary files are not pruned incorrectly.
|
||||
# See Savannah bug #30653
|
||||
@@ -211,7 +224,3 @@ rmfiles('file1', 'file2', 'file3', 'file
|
||||
# rmfiles(qw(dependfile output));
|
||||
|
||||
1;
|
||||
-
|
||||
-### Local Variables:
|
||||
-### eval: (setq whitespace-action (delq 'auto-cleanup whitespace-action))
|
||||
-### End:
|
164
SOURCES/make-4.2.1-nonblocking-reads.patch
Normal file
164
SOURCES/make-4.2.1-nonblocking-reads.patch
Normal file
@ -0,0 +1,164 @@
|
||||
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.
|
||||
|
||||
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
|
27
SOURCES/make-4.2.1-test-driver.patch
Normal file
27
SOURCES/make-4.2.1-test-driver.patch
Normal file
@ -0,0 +1,27 @@
|
||||
diff -Nrup a/tests/run_make_tests.pl b/tests/run_make_tests.pl
|
||||
--- a/tests/run_make_tests.pl 2016-04-04 01:38:37.000000000 -0400
|
||||
+++ b/tests/run_make_tests.pl 2018-03-19 00:46:11.329131847 -0400
|
||||
@@ -58,8 +58,8 @@ if ($^O eq 'VMS')
|
||||
*CORE::GLOBAL::rmdir = \&vms_rmdir;
|
||||
}
|
||||
|
||||
-require "test_driver.pl";
|
||||
-require "config-flags.pm";
|
||||
+require "./test_driver.pl";
|
||||
+require "./config-flags.pm";
|
||||
|
||||
# Some target systems might not have the POSIX module...
|
||||
$has_POSIX = eval { require "POSIX.pm" };
|
||||
diff -Nrup a/tests/test_driver.pl b/tests/test_driver.pl
|
||||
--- a/tests/test_driver.pl 2018-03-19 00:41:11.982406829 -0400
|
||||
+++ b/tests/test_driver.pl 2018-03-19 00:54:12.484794671 -0400
|
||||
@@ -165,7 +165,7 @@ sub toplevel
|
||||
$detail = 0; # detailed verbosity
|
||||
$keep = 0; # keep temp files around
|
||||
$workdir = "work"; # The directory where the test will start running
|
||||
- $scriptdir = "scripts"; # The directory where we find the test scripts
|
||||
+ $scriptdir = "./scripts"; # The directory where we find the test scripts
|
||||
$tmpfilesuffix = "t"; # the suffix used on tmpfiles
|
||||
$default_output_stack_level = 0; # used by attach_default_output, etc.
|
||||
$default_input_stack_level = 0; # used by attach_default_input, etc.
|
||||
|
@ -1,36 +0,0 @@
|
||||
From d79fe162c009788888faaf0317253b6f0cac7092 Mon Sep 17 00:00:00 2001
|
||||
From: Kevin Buettner <kevinb@redhat.com>
|
||||
Date: Thu, 23 Apr 2020 17:05:34 -0400
|
||||
Subject: [SV 58232] Disable inheritance of jobserver FDs for recursive make
|
||||
|
||||
A parent make will invoke a sub-make with close-on-exec disabled for
|
||||
the jobserver pipe FDs. Force close-on-exec to be to be enabled in
|
||||
the sub-make so the pipe is not always passed to child jobs.
|
||||
|
||||
I have a test case which, when invoked with a suitable -j switch,
|
||||
will hang if the recipe inherits the jobserver pipe. This test case
|
||||
was inspired by a real world case in which testing GDB on Fedora
|
||||
would hang due to some poorly written test GDB cases having been
|
||||
passed the jobserver file descriptors.
|
||||
|
||||
* src/posixos.c (jobserver_parse_auth): Call fd_noinherit() for
|
||||
jobserver pipe descriptors.
|
||||
|
||||
Copyright-paperwork-exempt: yes
|
||||
|
||||
diff --git a/src/posixos.c b/src/posixos.c
|
||||
index 525f292c..eab175a4 100644
|
||||
--- a/src/posixos.c
|
||||
+++ b/src/posixos.c
|
||||
@@ -145,6 +145,11 @@ jobserver_parse_auth (const char *auth)
|
||||
/* When using pselect() we want the read to be non-blocking. */
|
||||
set_blocking (job_fds[0], 0);
|
||||
|
||||
+ /* By default we don't send the job pipe FDs to our children.
|
||||
+ See jobserver_pre_child() and jobserver_post_child(). */
|
||||
+ fd_noinherit (job_fds[0]);
|
||||
+ fd_noinherit (job_fds[1]);
|
||||
+
|
||||
return 1;
|
||||
}
|
||||
|
@ -1,124 +0,0 @@
|
||||
From 6e6abd0cdfe4bb96f6412aebc511f10bf254a820 Mon Sep 17 00:00:00 2001
|
||||
From: Bruno Haible <bruno@clisp.org>
|
||||
Date: Sat, 23 May 2020 12:19:34 +0200
|
||||
Subject: findprog-in: Ignore directories.
|
||||
|
||||
Reported by Frederick Eaton via Dmitry Goncharov in
|
||||
<https://lists.gnu.org/archive/html/bug-gnulib/2020-03/msg00003.html>.
|
||||
|
||||
* lib/findprog-in.c (find_in_given_path): When the file found is a
|
||||
directory, set errno to EACCES and, during a PATH search, continue
|
||||
searching.
|
||||
* modules/findprog-in (Depends-on): Add sys_stat, stat.
|
||||
|
||||
diff --git a/lib/findprog-in.c b/lib/findprog-in.c
|
||||
index c254f2f588..0f76e36ca4 100644
|
||||
--- a/lib/findprog-in.c
|
||||
+++ b/lib/findprog-in.c
|
||||
@@ -26,6 +26,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
+#include <sys/stat.h>
|
||||
|
||||
#include "filename.h"
|
||||
#include "concat-filename.h"
|
||||
@@ -58,8 +59,8 @@ static const char * const suffixes[] =
|
||||
/* Note: The cmd.exe program does a different lookup: It searches according
|
||||
to the PATHEXT environment variable.
|
||||
See <https://stackoverflow.com/questions/7839150/>.
|
||||
- Also, it executes files ending .bat and .cmd directly without letting the
|
||||
- kernel interpret the program file. */
|
||||
+ Also, it executes files ending in .bat and .cmd directly without letting
|
||||
+ the kernel interpret the program file. */
|
||||
#elif defined __CYGWIN__
|
||||
"", ".exe", ".com"
|
||||
#elif defined __EMX__
|
||||
@@ -136,14 +137,26 @@ find_in_given_path (const char *progname, const char *path,
|
||||
call access() despite its design flaw. */
|
||||
if (eaccess (progpathname, X_OK) == 0)
|
||||
{
|
||||
- /* Found! */
|
||||
- if (strcmp (progpathname, progname) == 0)
|
||||
+ /* Check that the progpathname does not point to a
|
||||
+ directory. */
|
||||
+ struct stat statbuf;
|
||||
+
|
||||
+ if (stat (progpathname, &statbuf) >= 0)
|
||||
{
|
||||
- free (progpathname);
|
||||
- return progname;
|
||||
+ if (! S_ISDIR (statbuf.st_mode))
|
||||
+ {
|
||||
+ /* Found! */
|
||||
+ if (strcmp (progpathname, progname) == 0)
|
||||
+ {
|
||||
+ free (progpathname);
|
||||
+ return progname;
|
||||
+ }
|
||||
+ else
|
||||
+ return progpathname;
|
||||
+ }
|
||||
+
|
||||
+ errno = EACCES;
|
||||
}
|
||||
- else
|
||||
- return progpathname;
|
||||
}
|
||||
|
||||
if (errno != ENOENT)
|
||||
@@ -210,25 +223,37 @@ find_in_given_path (const char *progname, const char *path,
|
||||
call access() despite its design flaw. */
|
||||
if (eaccess (progpathname, X_OK) == 0)
|
||||
{
|
||||
- /* Found! */
|
||||
- if (strcmp (progpathname, progname) == 0)
|
||||
+ /* Check that the progpathname does not point to a
|
||||
+ directory. */
|
||||
+ struct stat statbuf;
|
||||
+
|
||||
+ if (stat (progpathname, &statbuf) >= 0)
|
||||
{
|
||||
- free (progpathname);
|
||||
-
|
||||
- /* Add the "./" prefix for real, that
|
||||
- xconcatenated_filename() optimized away. This
|
||||
- avoids a second PATH search when the caller uses
|
||||
- execl/execv/execlp/execvp. */
|
||||
- progpathname =
|
||||
- XNMALLOC (2 + strlen (progname) + 1, char);
|
||||
- progpathname[0] = '.';
|
||||
- progpathname[1] = NATIVE_SLASH;
|
||||
- memcpy (progpathname + 2, progname,
|
||||
- strlen (progname) + 1);
|
||||
- }
|
||||
+ if (! S_ISDIR (statbuf.st_mode))
|
||||
+ {
|
||||
+ /* Found! */
|
||||
+ if (strcmp (progpathname, progname) == 0)
|
||||
+ {
|
||||
+ free (progpathname);
|
||||
+
|
||||
+ /* Add the "./" prefix for real, that
|
||||
+ xconcatenated_filename() optimized away.
|
||||
+ This avoids a second PATH search when the
|
||||
+ caller uses execl/execv/execlp/execvp. */
|
||||
+ progpathname =
|
||||
+ XNMALLOC (2 + strlen (progname) + 1, char);
|
||||
+ progpathname[0] = '.';
|
||||
+ progpathname[1] = NATIVE_SLASH;
|
||||
+ memcpy (progpathname + 2, progname,
|
||||
+ strlen (progname) + 1);
|
||||
+ }
|
||||
+
|
||||
+ free (path_copy);
|
||||
+ return progpathname;
|
||||
+ }
|
||||
|
||||
- free (path_copy);
|
||||
- return progpathname;
|
||||
+ errno = EACCES;
|
||||
+ }
|
||||
}
|
||||
|
||||
if (errno != ENOENT)
|
166
SPECS/make.spec
166
SPECS/make.spec
@ -2,48 +2,56 @@
|
||||
Summary: A GNU tool which simplifies the build process for users
|
||||
Name: make
|
||||
Epoch: 1
|
||||
Version: 4.3
|
||||
Release: 8%{?dist}
|
||||
Version: 4.2.1
|
||||
Release: 11%{?dist}
|
||||
License: GPLv3+
|
||||
Group: Development/Tools
|
||||
URL: http://www.gnu.org/software/make/
|
||||
Source: ftp://ftp.gnu.org/gnu/make/make-%{version}.tar.gz
|
||||
Source: ftp://ftp.gnu.org/gnu/make/make-%{version}.tar.bz2
|
||||
|
||||
%if 0%{?rhel} > 0
|
||||
# This gives the user the option of saying --with guile, but defaults to WITHOUT
|
||||
%bcond_with guile
|
||||
%else
|
||||
# This gives the user the option of saying --without guile, but defaults to WITH
|
||||
%bcond_without guile
|
||||
%endif
|
||||
|
||||
Patch0: make-4.3-getcwd.patch
|
||||
Patch0: make-4.2-getcwd.patch
|
||||
Patch1: make-4.0-newlines.patch
|
||||
|
||||
# Assume we don't have clock_gettime in configure, so that
|
||||
# make is not linked against -lpthread (and thus does not
|
||||
# limit stack to 2MB).
|
||||
Patch1: make-4.0-noclock_gettime.patch
|
||||
Patch2: make-4.0-noclock_gettime.patch
|
||||
|
||||
# BZs #142691, #17374
|
||||
Patch2: make-4.3-j8k.patch
|
||||
Patch3: make-4.2-j8k.patch
|
||||
|
||||
# https://bugzilla.redhat.com/show_bug.cgi?id=1827850
|
||||
# https://savannah.gnu.org/bugs/?58232
|
||||
# Remove on next make rebase
|
||||
Patch3: make-4.3-cloexec.patch
|
||||
# Upstream: https://savannah.gnu.org/bugs/?30748
|
||||
# The default value of .SHELL_FLAGS is -c.
|
||||
Patch4: make-4.0-weird-shell.patch
|
||||
|
||||
# https://issues.redhat.com/browse/RHEL-22829
|
||||
# Remove on next make rebase
|
||||
Patch4: make-4.3-findprog.patch
|
||||
# Upstream patch: https://git.savannah.gnu.org/cgit/make.git/patch/?id=193f1e81edd6b1b56b0eb0ff8aa4b41c7b4257b4
|
||||
# Fixes wrong assumptions of glibc's glob internals.
|
||||
Patch5: make-4.2.1-glob-fix-2.patch
|
||||
# Upstream patch: https://git.savannah.gnu.org/cgit/make.git/patch/?id=48c8a116a914a325a0497721f5d8b58d5bba34d4
|
||||
# Fixes incorrect use of glibc 2.27 glob internals.
|
||||
Patch6: make-4.2.1-glob-fix.patch
|
||||
Patch7: make-4.2.1-glob-fix-3.patch
|
||||
|
||||
# autoreconf
|
||||
BuildRequires: make
|
||||
BuildRequires: autoconf, automake, gettext-devel
|
||||
# Perl 5.26 is removed the implicit CWD in @INC.
|
||||
# Provide relative path. Also provide better error for missing tests.
|
||||
Patch8: make-4.2.1-test-driver.patch
|
||||
|
||||
# Upstream patch: https://git.savannah.gnu.org/cgit/make.git/commit/?id=b552b05251980f693c729e251f93f5225b400714
|
||||
# Avoids hangs in parallel builds
|
||||
Patch9: make-4.2.1-nonblocking-reads.patch
|
||||
|
||||
# Upstream patch: https://git.savannah.gnu.org/cgit/make.git/commit/?id=0c5a9f9b92af1634dc60fa21e9ac86ed50e5d595
|
||||
# BZ 2004246 - allow setting -j within the Makefile
|
||||
Patch10: make-4.2.1-jvar.patch
|
||||
|
||||
# Unfortunately the glob patches configure.ac, so:
|
||||
BuildRequires: autoconf, automake
|
||||
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||
Requires(post): /sbin/install-info
|
||||
Requires(preun): /sbin/install-info
|
||||
BuildRequires: procps
|
||||
BuildRequires: perl-interpreter
|
||||
%if %{with guile}
|
||||
BuildRequires: pkgconfig(guile-2.2)
|
||||
%endif
|
||||
BuildRequires: gcc
|
||||
|
||||
%description
|
||||
A GNU tool for controlling the generation of executables and other
|
||||
@ -55,6 +63,7 @@ makefile.
|
||||
|
||||
%package devel
|
||||
Summary: Header file for externally visible definitions
|
||||
Group: Development/Libraries
|
||||
|
||||
%description devel
|
||||
The make-devel package contains gnumake.h.
|
||||
@ -65,19 +74,19 @@ The make-devel package contains gnumake.h.
|
||||
rm -f tests/scripts/features/parallelism.orig
|
||||
|
||||
%build
|
||||
autoreconf -vfi
|
||||
# Since we made a change to configure.ac (and configure) touch
|
||||
# the files to avoid rebuild problems with automake versioning.
|
||||
# Specifically make expects 1.15 but some systems use 1.16.1.
|
||||
touch `find . -name configure`
|
||||
touch `find . -name aclocal.m4`
|
||||
touch `find . -name Makefile.in`
|
||||
|
||||
%configure \
|
||||
%if %{with guile}
|
||||
--with-guile
|
||||
%else
|
||||
--without-guile
|
||||
%endif
|
||||
|
||||
%make_build
|
||||
%configure
|
||||
make %{?_smp_mflags}
|
||||
|
||||
%install
|
||||
%make_install
|
||||
rm -rf ${RPM_BUILD_ROOT}
|
||||
make DESTDIR=$RPM_BUILD_ROOT install
|
||||
ln -sf make ${RPM_BUILD_ROOT}/%{_bindir}/gmake
|
||||
ln -sf make.1 ${RPM_BUILD_ROOT}/%{_mandir}/man1/gmake.1
|
||||
rm -f ${RPM_BUILD_ROOT}/%{_infodir}/dir
|
||||
@ -86,10 +95,26 @@ rm -f ${RPM_BUILD_ROOT}/%{_infodir}/dir
|
||||
|
||||
%check
|
||||
echo ============TESTING===============
|
||||
/usr/bin/env LANG=C make check && true
|
||||
/usr/bin/env LANG=C make -k check && true
|
||||
echo ============END TESTING===========
|
||||
|
||||
%clean
|
||||
rm -rf ${RPM_BUILD_ROOT}
|
||||
|
||||
%post
|
||||
if [ -f %{_infodir}/make.info.gz ]; then # for --excludedocs
|
||||
/sbin/install-info %{_infodir}/make.info.gz %{_infodir}/dir --entry="* Make: (make). The GNU make utility." || :
|
||||
fi
|
||||
|
||||
%preun
|
||||
if [ $1 = 0 ]; then
|
||||
if [ -f %{_infodir}/make.info.gz ]; then # for --excludedocs
|
||||
/sbin/install-info --delete %{_infodir}/make.info.gz %{_infodir}/dir --entry="* Make: (make). The GNU make utility." || :
|
||||
fi
|
||||
fi
|
||||
|
||||
%files -f %{name}.lang
|
||||
%defattr(-,root,root)
|
||||
%license COPYING
|
||||
%doc NEWS README AUTHORS
|
||||
%{_bindir}/*
|
||||
@ -98,67 +123,28 @@ echo ============END TESTING===========
|
||||
%{_includedir}/gnumake.h
|
||||
|
||||
%files devel
|
||||
%defattr(-,root,root)
|
||||
%{_includedir}/gnumake.h
|
||||
|
||||
%changelog
|
||||
* Wed Jan 31 2024 DJ Delorie <dj@redhat.com> - 1:4.3-8
|
||||
- Don't try to execute directories (RHEL-22829)
|
||||
* Mon Oct 18 2021 DJ Delorie <dj@redhat.com> - 1:4.2.1-11
|
||||
- Allow -j in MAKEFLAGS. BZ #2004246
|
||||
|
||||
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 1:4.3-7
|
||||
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
|
||||
Related: rhbz#1991688
|
||||
* Fri Dec 20 2019 DJ Delorie <dj@redhat.com> - 1:4.2.1-10
|
||||
- Use a non-blocking read with pselect to avoid hangs. BZ #1774790
|
||||
|
||||
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 1:4.3-6
|
||||
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
|
||||
* Fri Sep 28 2018 Patsy Griffin Franklin <pfrankli@redhat.com> 1:4.2.1-9
|
||||
- Add -k to make check to insure that all tests are run even if failures
|
||||
occur.
|
||||
|
||||
* Fri Feb 19 2021 DJ Delorie <dj@redhat.com> - 1:4.3-5
|
||||
- Allow users to build with or without guile support as desired.
|
||||
- Allow derivative downstreams to default to disabling guile support.
|
||||
* Fri Jul 20 2018 Patsy Griffin Franklin <pfrankli@redhat.com> 1:4.2.1-8
|
||||
- Do not enable Guile support. (#1569105)
|
||||
|
||||
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1:4.3-4
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
|
||||
|
||||
* Wed Jul 29 2020 DJ Delorie <dj@redhat.com> - 1:4.3-3
|
||||
- Disable inheritance of jobserver FDs for recursive make. BZ #1827850
|
||||
|
||||
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1:4.3-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
|
||||
|
||||
* Wed Mar 11 2020 DJ Delorie <dj@redhat.com> - 1:4.3-1
|
||||
- Rebase to make-4.3. Remove obsolete patches.
|
||||
|
||||
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1:4.2.1-16
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
|
||||
|
||||
* Fri Dec 06 2019 DJ Delorie <dj@redhat.com> - 1:4.2.1-15
|
||||
- Use a non-blocking read with pselect to avoid hangs. BZ #1556839
|
||||
|
||||
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1:4.2.1-14
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
|
||||
|
||||
* Sun Feb 17 2019 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1:4.2.1-13
|
||||
- Run autoreconf
|
||||
|
||||
* Sun Feb 17 2019 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1:4.2.1-12
|
||||
- Switch to latest guile version
|
||||
|
||||
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1:4.2.1-11
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
|
||||
|
||||
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1:4.2.1-10
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
|
||||
|
||||
* Wed Apr 25 2018 Patsy Griffin Franklin <pfrankli@redhat.com> 1:4.2.1-9
|
||||
* Mon Jun 11 2018 Patsy Griffin Franklin <pfrankli@redhat.com> 1:4.2.1-7
|
||||
- Fix build failure caused by automake versioning differences related
|
||||
to the glob changes.
|
||||
to the glob changes. (#1589769)
|
||||
- Fix testing failure due to Perl changes related to expanding paths.
|
||||
|
||||
* Tue Feb 20 2018 Rex Dieter <rdieter@fedoraproject.org> - 1:4.2.1-8
|
||||
- BR: gcc, rebuild (guile)
|
||||
|
||||
* Thu Feb 08 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1:4.2.1-7
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
|
||||
|
||||
* Fri Feb 02 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1:4.2.1-6
|
||||
- Fix wrong assumptions of glibc's glob internals
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user