make: update to 4.4.1.

This commit is contained in:
André Cerqueira 2023-07-16 12:47:07 +01:00 committed by Duncan Overbruck
parent 55375a044b
commit 5524e52f44
2 changed files with 5 additions and 211 deletions

View File

@ -1,207 +0,0 @@
From 9c29c1b082fd59b57f3c15b17900ca1da0db8ad1 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sat, 18 Apr 2020 19:57:44 +0200
Subject: [PATCH] Revert "[SV 40236] Handle included file open failures
properly."
This reverts commit c5ccc4930c3805604813def4455bc2e90635349e.
This commit breaks build of openjdk9 at very least.
---
src/main.c | 25 +++++++++-----------
src/read.c | 42 +++++++++++++++++++---------------
tests/scripts/features/include | 23 -------------------
3 files changed, 34 insertions(+), 56 deletions(-)
diff --git a/src/main.c b/src/main.c
index bcba2d1..6c892a8 100644
--- a/src/main.c
+++ b/src/main.c
@@ -2180,7 +2180,8 @@ main (int argc, char **argv, char **envp)
{
/* Update any makefiles if necessary. */
- FILE_TIMESTAMP *makefile_mtimes;
+ FILE_TIMESTAMP *makefile_mtimes = 0;
+ unsigned int mm_idx = 0;
char **aargv = NULL;
const char **nargv;
int nargc;
@@ -2188,22 +2189,12 @@ main (int argc, char **argv, char **envp)
DB (DB_BASIC, (_("Updating makefiles....\n")));
- {
- struct goaldep *d;
- unsigned int num_mkfiles = 0;
- for (d = read_files; d != NULL; d = d->next)
- ++num_mkfiles;
-
- makefile_mtimes = alloca (num_mkfiles * sizeof (FILE_TIMESTAMP));
- }
-
/* Remove any makefiles we don't want to try to update. Record the
current modtimes of the others so we can compare them later. */
{
- struct goaldep *d = read_files;
- struct goaldep *last = NULL;
- unsigned int mm_idx = 0;
-
+ register struct goaldep *d, *last;
+ last = 0;
+ d = read_files;
while (d != 0)
{
struct file *f;
@@ -2237,6 +2228,9 @@ main (int argc, char **argv, char **envp)
}
else
{
+ makefile_mtimes = xrealloc (makefile_mtimes,
+ (mm_idx+1)
+ * sizeof (FILE_TIMESTAMP));
makefile_mtimes[mm_idx++] = file_mtime_no_search (d->file);
last = d;
d = d->next;
@@ -2496,6 +2490,9 @@ main (int argc, char **argv, char **envp)
free (aargv);
break;
}
+
+ /* Free the makefile mtimes. */
+ free (makefile_mtimes);
}
/* Set up 'MAKEFLAGS' again for the normal targets. */
diff --git a/src/read.c b/src/read.c
index db52a55..39b5885 100644
--- a/src/read.c
+++ b/src/read.c
@@ -321,11 +321,7 @@ eval_makefile (const char *filename, unsigned short flags)
struct ebuffer ebuf;
const floc *curfile;
char *expanded = 0;
-
- /* Create a new goaldep entry. */
- deps = alloc_goaldep ();
- deps->next = read_files;
- read_files = deps;
+ int makefile_errno;
ebuf.floc.filenm = filename; /* Use the original file name. */
ebuf.floc.lineno = 1;
@@ -356,12 +352,13 @@ eval_makefile (const char *filename, unsigned short flags)
filename = expanded;
}
- errno = 0;
ENULLLOOP (ebuf.fp, fopen (filename, "r"));
- deps->error = errno;
+
+ /* Save the error code so we print the right message later. */
+ makefile_errno = errno;
/* Check for unrecoverable errors: out of mem or FILE slots. */
- switch (deps->error)
+ switch (makefile_errno)
{
#ifdef EMFILE
case EMFILE:
@@ -371,7 +368,7 @@ eval_makefile (const char *filename, unsigned short flags)
#endif
case ENOMEM:
{
- const char *err = strerror (deps->error);
+ const char *err = strerror (makefile_errno);
OS (fatal, reading_file, "%s", err);
}
}
@@ -395,8 +392,14 @@ eval_makefile (const char *filename, unsigned short flags)
}
}
- /* Enter the final name for this makefile as a goaldep. */
+ /* Now we have the final name for this makefile. Enter it into
+ the cache. */
filename = strcache_add (filename);
+
+ /* Add FILENAME to the chain of read makefiles. */
+ deps = alloc_goaldep ();
+ deps->next = read_files;
+ read_files = deps;
deps->file = lookup_file (filename);
if (deps->file == 0)
deps->file = enter_file (filename);
@@ -405,19 +408,17 @@ eval_makefile (const char *filename, unsigned short flags)
free (expanded);
+ /* If the makefile can't be found at all, give up entirely. */
+
if (ebuf.fp == 0)
{
- /* The makefile can't be read at all, give up entirely.
- If we did some searching errno has the error from the last attempt,
- rather from FILENAME itself: recover the more accurate one. */
- errno = deps->error;
- deps->file->last_mtime = NONEXISTENT_MTIME;
+ /* If we did some searching, errno has the error from the last
+ attempt, rather from FILENAME itself. Store it in case the
+ caller wants to use it in a message. */
+ errno = makefile_errno;
return deps;
}
- /* Success; clear errno. */
- deps->error = 0;
-
/* Avoid leaking the makefile to children. */
fd_noinherit (fileno (ebuf.fp));
@@ -908,7 +909,10 @@ eval (struct ebuffer *ebuf, int set_default)
struct goaldep *d = eval_makefile (files->name, flags);
if (errno)
- d->floc = *fstart;
+ {
+ d->error = (unsigned short)errno;
+ d->floc = *fstart;
+ }
free_ns (files);
files = next;
diff --git a/tests/scripts/features/include b/tests/scripts/features/include
index 0c63c06..67f8e65 100644
--- a/tests/scripts/features/include
+++ b/tests/scripts/features/include
@@ -237,27 +237,4 @@ inc1: foo; echo > $@
rmfiles('inc1');
}
-# Including files that can't be read should show an error
-if (defined $ERR_unreadable_file) {
- create_file('inc1', 'FOO := foo');
- chmod 0000, 'inc1';
-
- run_make_test(q!
-include inc1
-all:;@echo $(FOO)
-!,
- '', "#MAKEFILE#:2: inc1: $ERR_unreadable_file\n#MAKE#: *** No rule to make target 'inc1'. Stop.", 512);
-
-# Unreadable files that we know how to successfully recreate should work
-
- run_make_test(sprintf(q!
-all:;@echo $(FOO)
-include inc1
-inc1:; @%s $@ && echo FOO := bar > $@
-!, $CMD_rmfile),
- '', "bar");
-
- rmfiles('inc1');
-}
-
1;
--
2.26.1

View File

@ -1,17 +1,18 @@
# Template file for 'make'
pkgname=make
version=4.3
revision=3
version=4.4.1
revision=1
bootstrap=yes
build_style=gnu-configure
configure_args="$(vopt_with guile)"
hostmakedepends="$(vopt_if guile pkg-config)"
makedepends="$(vopt_if guile 'gc-devel guile-devel')"
checkdepends="perl"
checkdepends="perl tar"
short_desc="GNU Make build tool"
maintainer="Enno Boland <gottox@voidlinux.org>"
license="GPL-3.0-or-later"
homepage="http://www.gnu.org/software/make"
distfiles="${GNU_SITE}/make/${pkgname}-${version}.tar.lz"
checksum=de1a441c4edf952521db30bfca80baae86a0ff1acd0a00402999344f04c45e82
checksum=8814ba072182b605d156d7589c19a43b89fc58ea479b9355146160946f8cf6e9
build_options=guile
make_check=ci-skip #features/temp_stdin Error running /builddir/make-4.4.1/tests/../make (expected 512; got 0)