Accepting request 1032930 from Base:System

- reset-sigpipe.patch: Reset SIGPIPE in children (forwarded request 1032929 from Andreas_Schwab)

OBS-URL: https://build.opensuse.org/request/show/1032930
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/make?expand=0&rev=48
This commit is contained in:
Dominique Leuenberger 2022-11-07 12:51:19 +00:00 committed by Git OBS Bridge
commit 354e97f204
12 changed files with 209 additions and 1135 deletions

View File

@ -1,30 +0,0 @@
diff --git a/lib/findprog-in.c b/lib/findprog-in.c
index c254f2f..d89ec00 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"
@@ -190,6 +191,7 @@ find_in_given_path (const char *progname, const char *path,
dir = ".";
/* Try all platform-dependent suffixes. */
+ struct stat st;
for (i = 0; i < sizeof (suffixes) / sizeof (suffixes[0]); i++)
{
const char *suffix = suffixes[i];
@@ -208,7 +210,8 @@ find_in_given_path (const char *progname, const char *path,
use it. On other systems, let's hope that this program
is not installed setuid or setgid, so that it is ok to
call access() despite its design flaw. */
- if (eaccess (progpathname, X_OK) == 0)
+ if (eaccess (progpathname, X_OK) == 0 &&
+ stat(progpathname, &st) == 0 && S_ISREG(st.st_mode))
{
/* Found! */
if (strcmp (progpathname, progname) == 0)

File diff suppressed because it is too large Load Diff

View File

@ -1,43 +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: [PATCH] [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
---
src/posixos.c | 5 +++++
1 file changed, 5 insertions(+)
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;
}
--
2.37.2

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e05fdde47c5f7ca45cb697e973894ff4f5d79e13b750ed57d7b66d8defc78e19
size 2317073

Binary file not shown.

3
make-4.4.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:581f4d4e872da74b3941c874215898a7d35802f03732bdccee1d4a7979105d18
size 2307891

BIN
make-4.4.tar.gz.sig Normal file

Binary file not shown.

View File

@ -1,17 +0,0 @@
---
tests/test_driver.pl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: make-4.3/tests/test_driver.pl
===================================================================
--- make-4.3.orig/tests/test_driver.pl
+++ make-4.3/tests/test_driver.pl
@@ -52,7 +52,7 @@ $tests_passed = 0;
$test_passed = 1;
# Timeout in seconds. If the test takes longer than this we'll fail it.
-$test_timeout = 5;
+$test_timeout = 8;
$test_timeout = 10 if $^O eq 'VMS';
# Path to Perl

View File

@ -1,3 +1,115 @@
-------------------------------------------------------------------
Wed Nov 2 15:39:46 UTC 2022 - Andreas Schwab <schwab@suse.de>
- reset-sigpipe.patch: Reset SIGPIPE in children
-------------------------------------------------------------------
Mon Oct 31 13:31:57 UTC 2022 - Andreas Schwab <schwab@suse.de>
- Update to make 4.4
* WARNING: Future backward-incompatibility!
In the NEXT release of GNU Make, pattern rules will implement the same
behavior change for multiple targets as explicit grouped targets
* WARNING: Backward-incompatibility!
GNU Make now uses temporary files in more situations than previous releases.
* WARNING: Backward-incompatibility!
Previously each target in a explicit grouped target rule was considered
individually: if the targets needed by the build were not out of date the
recipe was not run even if other targets in the group were out of date. Now
if any of the grouped targets are needed by the build, then if any of the
grouped targets are out of date the recipe is run and all targets in the
group are considered updated.
* WARNING: Backward-incompatibility!
Previously if --no-print-directory was seen anywhere in the environment or
command line it would take precedence over any --print-directory. Now, the
last setting of directory printing options seen will be used, so a command
line such as "--no-print-directory -w" _will_ show directory entry/exits.
* WARNING: Backward-incompatibility!
Previously the order in which makefiles were remade was not explicitly
stated, but it was (roughly) the inverse of the order in which they were
processed by make. In this release, the order in which makefiles are
rebuilt is the same order in which make processed them, and this is defined
to be true in the GNU Make manual.
* WARNING: Backward-incompatibility!
Previously only simple (one-letter) options were added to the MAKEFLAGS
variable that was visible while parsing makefiles. Now, all options are
available in MAKEFLAGS. If you want to check MAKEFLAGS for a one-letter
option, expanding "$(firstword -$(MAKEFLAGS))" is a reliable way to return
the set of one-letter options which can be examined via findstring, etc.
* WARNING: Backward-incompatibility!
Previously makefile variables marked as export were not exported to commands
started by the $(shell ...) function. Now, all exported variables are
exported to $(shell ...). If this leads to recursion during expansion, then
for backward-compatibility the value from the original environment is used.
To detect this change search for 'shell-export' in the .FEATURES variable.
* WARNING: New build requirement
GNU Make utilizes facilities from GNU Gnulib: Gnulib requires certain C99
features in the C compiler and so these features are required by GNU Make:
https://www.gnu.org/software/gnulib/manual/html_node/C99-features-assumed.html
The configure script should verify the compiler has these features.
* New feature: The .WAIT special target
If the .WAIT target appears between two prerequisites of a target, then
GNU Make will wait for all of the targets to the left of .WAIT in the list
to complete before starting any of the targets to the right of .WAIT.
* New feature: .NOTPARALLEL accepts prerequisites
If the .NOTPARALLEL special target has prerequisites then all prerequisites
of those targets will be run serially (as if .WAIT was specified between
each prerequisite).
* New feature: The .NOTINTERMEDIATE special target
.NOTINTERMEDIATE disables intermediate behavior for specific files, for all
files built using a pattern, or for the entire makefile.
* New feature: The $(let ...) function
This function allows user-defined functions to define a set of local
variables: values can be assigned to these variables from within the
user-defined function and they will not impact global variable assignments.
* New feature: The $(intcmp ...) function
This function allows conditional evaluation controlled by a numerical
comparison.
* New feature: Improved support for -l / --load-average
On systems that provide /proc/loadavg (Linux), GNU Make will use it to
determine the number of runnable jobs and use this as the current load,
avoiding the need for heuristics.
* New feature: The --shuffle command line option
This option reorders goals and prerequisites to simulate non-determinism
that may be seen using parallel build. Shuffle mode allows a form of "fuzz
testing" of parallel builds to verify that all prerequisites are correctly
described in the makefile.
* New feature: The --jobserver-style command line option and named pipes
A new jobserver method is used on systems where mkfifo(3) is supported.
* GNU Make has sometimes chosen unexpected, and sub-optimal, chains of
implicit rules due to the definition of "ought to exist" in the implicit
rule search algorithm, which considered any prerequisite mentioned in the
makefile as "ought to exist". This algorithm has been modified to prefer
prerequisites mentioned explicitly in the target being built and only if
that results in no matching rule, will GNU Make consider prerequisites
mentioned in other targets as "ought to exist".
* GNU Make was performing secondary expansion of all targets, even targets
which didn't need to be considered during the build. In this release
only targets which are considered will be secondarily expanded.
* If the MAKEFLAGS variable is modified in a makefile, it will be re-parsed
immediately rather than after all makefiles have been read.
* The -I option accepts an argument "-" (e.g., "-I-") which means "reset the
list of search directories to empty".
* New debug option "print" will show the recipe to be run, even when silent
mode is set, and new debug option "why" will show why a target is rebuilt
(which prerequisites caused the target to be considered out of date).
* The existing --trace option is made equivalent to --debug=print,why
* Target-specific variables can now be marked "unexport".
* Exporting / unexporting target-specific variables is handled correctly, so
that the attribute of the most specific variable setting is used.
* Special targets like .POSIX are detected upon definition, ensuring that any
change in behavior takes effect immediately, before the next line is parsed.
* When the pipe-based jobserver is enabled and GNU Make decides it is invoking
a non-make sub-process and closes the jobserver pipes, it will now add a new
option to the MAKEFLAGS environment variable that disables the jobserver.
* A long-standing issue with the directory cache has been resolved: changes
made as a side-effect of some other target's recipe are now noticed as
expected.
- jobserver-noinherit.patch, jobserver-fifo.patch: Removed
- test-driver.patch: Removed
- fix-57962.patch: Removed
- make-testcases_timeout.diff: Removed
------------------------------------------------------------------- -------------------------------------------------------------------
Wed Aug 17 15:05:38 UTC 2022 - Andreas Schwab <schwab@suse.de> Wed Aug 17 15:05:38 UTC 2022 - Andreas Schwab <schwab@suse.de>

View File

@ -17,7 +17,7 @@
Name: make Name: make
Version: 4.3 Version: 4.4
Release: 0 Release: 0
Summary: GNU make Summary: GNU make
License: GPL-2.0-or-later License: GPL-2.0-or-later
@ -27,15 +27,8 @@ Source: https://ftp.gnu.org/gnu/make/make-%{version}.tar.gz
Source1: https://ftp.gnu.org/gnu/make/make-%{version}.tar.gz.sig Source1: https://ftp.gnu.org/gnu/make/make-%{version}.tar.gz.sig
# keyring downloaded from https://savannah.gnu.org/project/memberlist-gpgkeys.php?group=make&download=1 # keyring downloaded from https://savannah.gnu.org/project/memberlist-gpgkeys.php?group=make&download=1
Source2: %{name}.keyring Source2: %{name}.keyring
Patch1: make-testcases_timeout.diff Patch: reset-sigpipe.patch
Patch2: fix-57962.patch
Patch3: jobserver-noinherit.patch
Patch4: jobserver-fifo.patch
Patch5: test-driver.patch
Patch64: make-library-search-path.diff Patch64: make-library-search-path.diff
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: makeinfo
BuildRequires: pkgconfig BuildRequires: pkgconfig
Requires(post): %{install_info_prereq} Requires(post): %{install_info_prereq}
Requires(preun):%{install_info_prereq} Requires(preun):%{install_info_prereq}
@ -48,23 +41,17 @@ The GNU make command with extensive documentation.
%prep %prep
%setup -q %setup -q
%patch1 -p1 %patch -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
if [ %{_lib} = lib64 ]; then if [ %{_lib} = lib64 ]; then
%patch64 -p1 %patch64 -p1
fi fi
%build %build
autoreconf -fi
export CFLAGS="%{optflags}"
%configure %configure
make %{?_smp_mflags} %make_build
%check %check
make %{?_smp_mflags} check || { %make_build check || {
for f in tests/work/*/*.diff; do for f in tests/work/*/*.diff; do
test -f "$f" || continue test -f "$f" || continue
printf "++++++++++++++ %s ++++++++++++++\n" "${f##*/}" printf "++++++++++++++ %s ++++++++++++++\n" "${f##*/}"

89
reset-sigpipe.patch Normal file
View File

@ -0,0 +1,89 @@
From 8a9e8592c9893385b5c4dd529f39333c7d7efab1 Mon Sep 17 00:00:00 2001
From: Andreas Schwab <schwab@suse.de>
Date: Wed, 2 Nov 2022 15:50:52 +0100
Subject: [PATCH] [SV 63307] Reset SIGPIPE in spawned children
* configure.ac: Check for posix_spawnattr_setsigdefault.
* src/job.c (child_execute_job): Reset SIGPIPE in the child
process.
* src/job.h (sigpipe_ignored): Declare.
* src/main.c (main): Remember if SIGPIPE was inherited as ignored.
---
configure.ac | 2 +-
src/job.c | 24 ++++++++++++++++++++++++
src/job.h | 2 ++
src/main.c | 2 +-
4 files changed, 28 insertions(+), 2 deletions(-)
Index: make-4.4/src/job.c
===================================================================
--- make-4.4.orig/src/job.c
+++ make-4.4/src/job.c
@@ -261,6 +261,10 @@ unsigned long job_counter = 0;
/* Number of jobserver tokens this instance is currently using. */
unsigned int jobserver_tokens = 0;
+
+/* Whether SIGPIPE was ignored on entry. */
+
+int sigpipe_ignored;
#ifdef WINDOWS32
@@ -2305,6 +2309,12 @@ child_execute_job (struct childbase *chi
/* We are the child. */
unblock_all_sigs ();
+ /* Unignore SIPIPE. */
+#ifdef SIGPIPE
+ if (!sigpipe_ignored)
+ bsd_signal (SIGPIPE, SIG_DFL);
+#endif
+
#ifdef SET_STACK_SIZE
/* Reset limits, if necessary. */
if (stack_limit.rlim_cur)
@@ -2347,6 +2357,18 @@ child_execute_job (struct childbase *chi
}
#endif /* have posix_spawnattr_setsigmask() */
+ /* Unignore SIGPIPE. */
+ if (!sigpipe_ignored)
+ {
+ sigset_t mask;
+ sigemptyset (&mask);
+ sigaddset (&mask, SIGPIPE);
+ r = posix_spawnattr_setsigdefault (&attr, &mask);
+ if (r != 0)
+ goto cleanup;
+ flags |= POSIX_SPAWN_SETSIGDEF;
+ }
+
/* USEVFORK can give significant speedup on systems where it's available. */
#ifdef POSIX_SPAWN_USEVFORK
flags |= POSIX_SPAWN_USEVFORK;
Index: make-4.4/src/job.h
===================================================================
--- make-4.4.orig/src/job.h
+++ make-4.4/src/job.h
@@ -88,5 +88,7 @@ pid_t exec_command (char **argv, char **
void unblock_all_sigs (void);
+extern int sigpipe_ignored;
+
extern unsigned int job_slots_used;
extern unsigned int jobserver_tokens;
Index: make-4.4/src/main.c
===================================================================
--- make-4.4.orig/src/main.c
+++ make-4.4/src/main.c
@@ -1184,7 +1184,7 @@ main (int argc, char **argv, char **envp
/* Don't die if our stdout sends us SIGPIPE. */
#ifdef SIGPIPE
- bsd_signal (SIGPIPE, SIG_IGN);
+ sigpipe_ignored = bsd_signal (SIGPIPE, SIG_IGN) == SIG_IGN;
#endif
#ifdef HAVE_ATEXIT

View File

@ -1,23 +0,0 @@
Index: make-4.3/Makefile.am
===================================================================
--- make-4.3.orig/Makefile.am
+++ make-4.3/Makefile.am
@@ -161,8 +161,8 @@ check-regression: tests/config-flags.pm
rm -f tests/$$f; ln -s ../srctests/$$f tests; \
done; fi ;; \
esac; \
- echo "cd tests && $(PERL) $(PERLFLAGS) ./run_make_tests.pl -srcdir $(abs_top_srcdir) -make ../make$(EXEEXT) $(MAKETESTFLAGS)"; \
- cd tests && $(PERL) $(PERLFLAGS) ./run_make_tests.pl -srcdir '$(abs_top_srcdir)' -make '../make$(EXEEXT)' $(MAKETESTFLAGS); \
+ echo "cd tests && $(PERL) $(PERLFLAGS) -I. ./run_make_tests.pl -srcdir $(abs_top_srcdir) -make ../make$(EXEEXT) $(MAKETESTFLAGS)"; \
+ cd tests && $(PERL) $(PERLFLAGS) -I. ./run_make_tests.pl -srcdir '$(abs_top_srcdir)' -make '../make$(EXEEXT)' $(MAKETESTFLAGS); \
else \
echo "Can't find a working Perl ($(PERL)); the test suite requires Perl."; \
fi; \
Index: make-4.3/tests/run_make_tests
===================================================================
--- make-4.3.orig/tests/run_make_tests
+++ make-4.3/tests/run_make_tests
@@ -1,2 +1,2 @@
#!/bin/sh
-exec perl $0.pl ${1+"$@"}
+exec perl -I ${0%/*} $0.pl ${1+"$@"}