make: update to 4.3 again and revert commits that regress packages

The openjdk9 commit is probably actually right on make's side, but
it does break openjdk9 so keep this reverted while we investigate
a fix.

The secondary expansion is I'm 99% sure an actual regression.
Revert to previous behavior, as nothing much seems to rely on the
new behavior (Make 4.2 worked for us for ages). These will be
reported upstream.

Also, make sure the check target can be run (testsuite passed).

Fixes https://github.com/void-linux/void-packages/issues/21089
This commit is contained in:
q66 2020-04-18 19:28:46 +02:00
parent 2654dfa04e
commit 85761cc580
6 changed files with 352 additions and 126 deletions

View file

@ -17,7 +17,6 @@ license="BSD-3-Clause, MIT"
homepage="http://www.aegisub.org"
distfiles="https://github.com/Aegisub/Aegisub/archive/v${version}.tar.gz"
checksum=62757dd491455268a240f983b59734a801cc2e899039a7493deeaf5e24a61dcd
broken="https://build.voidlinux.org/builders/x86_64_builder/builds/22591/steps/shell_3/logs/stdio"
build_options="fftw openal portaudio"
build_options_default="fftw"

View file

@ -1,86 +0,0 @@
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
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
--- a/configure.orig 2020-04-06 12:39:20.210525122 +0200
+++ b/configure 2020-04-06 12:39:36.739696694 +0200
@@ -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

View file

@ -1,31 +0,0 @@
musl 1.1.19 introduced the _DIRENT_HAVE_D_* macros in commit
1bc10ffeaa7c7ce44b3e214e02e302642511c7c7, triggering a bug in GNU make
that's present up to the current version:
http://git.savannah.gnu.org/cgit/make.git/tree/glob/glob.c?id=5d653b535a0e0e607c8be2016bcaadd6f326a698#n1333
The glob replacement they ship includes and uses internally a
GLOB_ONLYDIR flag, which is opportunistic and implemented via d_type
if _DIRENT_HAVE_D_TYPE is defined, and it fails to consider that
DT_LNK could be a symlink to a directory. This is an ancient version
of glob.c; the modern GNU glob in glibc rightly considers DT_LNK. Thus
the bug is not seen on glibc systems (where the glob replacement is
not used), but will be seen on any system where _DIRENT_HAVE_D_TYPE is
defined and where configure decides to replace the libc glob with
their GNU one.
http://www.openwall.com/lists/musl/2018/03/13/1
diff --git a/glob/glob.c b/glob/glob.c
index f3911bc..d6bb8ba 100644
--- a/glob/glob.c
+++ b/glob/glob.c
@@ -1330,7 +1330,7 @@ glob_in_dir (pattern, directory, flags, errfunc, pglob)
/* If we shall match only directories use the information
provided by the dirent call if possible. */
if ((flags & GLOB_ONLYDIR)
- && d->d_type != DT_UNKNOWN && d->d_type != DT_DIR)
+ && d->d_type != DT_UNKNOWN && d->d_type != DT_DIR && d->d_type != DT_LNK)
continue;
#endif

View file

@ -0,0 +1,207 @@
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

@ -0,0 +1,139 @@
From 1d62df2df0b1b0fcb559247c5c7042f5e673a38b Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sat, 18 Apr 2020 19:02:35 +0200
Subject: [PATCH] Revert "[SV 54161] Fix second expansion of $* for paths"
This reverts commit 86f2f8bcb5b4a03da8eb37e9a99c22d8fec4bfb2.
This commit breaks secondary expansion in builds of aegisub at very least,
revert to previous behavior for the time being while this is investigated.
---
src/implicit.c | 56 +++++++++---------------------
tests/scripts/features/se_implicit | 8 -----
2 files changed, 17 insertions(+), 47 deletions(-)
diff --git a/src/implicit.c b/src/implicit.c
index b281a17..4d0a01f 100644
--- a/src/implicit.c
+++ b/src/implicit.c
@@ -221,9 +221,8 @@ pattern_search (struct file *file, int archive,
struct patdeps *deplist = xmalloc (max_deps * sizeof (struct patdeps));
struct patdeps *pat = deplist;
- /* Names of possible dependencies are constructed in this buffer.
- We may replace % by $(*F) for second expansion, increasing the length. */
- char *depname = alloca (namelen + max_pattern_dep_length + 4);
+ /* Names of possible dependencies are constructed in this buffer. */
+ char *depname = alloca (namelen + max_pattern_dep_length);
/* The start and length of the stem of FILENAME for the current rule. */
const char *stem = 0;
@@ -479,10 +478,9 @@ pattern_search (struct file *file, int archive,
}
}
- if (stemlen + (check_lastslash ? pathlen : 0) > GET_PATH_MAX)
+ if (stemlen > GET_PATH_MAX)
{
- DBS (DB_IMPLICIT, (_("Stem too long: '%s%.*s'.\n"),
- check_lastslash ? pathdir : "",
+ DBS (DB_IMPLICIT, (_("Stem too long: '%.*s'.\n"),
(int) stemlen, stem));
continue;
}
@@ -490,19 +488,8 @@ pattern_search (struct file *file, int archive,
DBS (DB_IMPLICIT, (_("Trying pattern rule with stem '%.*s'.\n"),
(int) stemlen, stem));
- if (!check_lastslash)
- {
- memcpy (stem_str, stem, stemlen);
- stem_str[stemlen] = '\0';
- }
- else
- {
- /* We want to prepend the directory from
- the original FILENAME onto the stem. */
- memcpy (stem_str, filename, pathlen);
- memcpy (stem_str + pathlen, stem, stemlen);
- stem_str[pathlen + stemlen] = '\0';
- }
+ strncpy (stem_str, stem, stemlen);
+ stem_str[stemlen] = '\0';
/* If there are no prerequisites, then this rule matches. */
if (rule->deps == 0)
@@ -553,7 +540,7 @@ pattern_search (struct file *file, int archive,
}
memcpy (o, nptr, p - nptr);
o += p - nptr;
- memcpy (o, stem, stemlen);
+ memcpy (o, stem_str, stemlen);
o += stemlen;
strcpy (o, p + 1);
}
@@ -605,10 +592,10 @@ pattern_search (struct file *file, int archive,
again. This is not good if you have certain characters
in your stem (like $).
- Instead, we will replace % with $* or $(*F) and allow the
- second expansion to take care of it for us. This way
- (since $* and $(*F) are simple variables) there won't be
- additional re-expansion of the stem. */
+ Instead, we will replace % with $* and allow the second
+ expansion to take care of it for us. This way (since $*
+ is a simple variable) there won't be additional
+ re-expansion of the stem. */
p = lindex (nptr, nptr + len, '%');
if (p == 0)
@@ -619,22 +606,13 @@ pattern_search (struct file *file, int archive,
else
{
size_t i = p - nptr;
- char *o = depname;
- memcpy (o, nptr, i);
- o += i;
+ memcpy (depname, nptr, i);
+ memcpy (depname + i, "$*", 2);
+ memcpy (depname + i + 2, p + 1, len - i - 1);
+ depname[len + 2 - 1] = '\0';
+
if (check_lastslash)
- {
- add_dir = 1;
- memcpy (o, "$(*F)", 5);
- o += 5;
- }
- else
- {
- memcpy (o, "$*", 2);
- o += 2;
- }
- memcpy (o, p + 1, len - i - 1);
- o[len - i - 1] = '\0';
+ add_dir = 1;
}
/* Set up for the next word. */
diff --git a/tests/scripts/features/se_implicit b/tests/scripts/features/se_implicit
index 866d1fb..a01b385 100644
--- a/tests/scripts/features/se_implicit
+++ b/tests/scripts/features/se_implicit
@@ -254,13 +254,5 @@ foo: $$(info $$<)
!,
'', "bar\n#MAKE#: Nothing to be done for 'foo'.\n");
-# SV 54161: Expand $$* properly when it contains a path
-
-run_make_test(q!
-.SECONDEXPANSION:
-%x: $$(info $$*); @echo '$*'
-!,
- 'q/ux', "q/u\nq/u\n");
-
# This tells the test driver that the perl test script executed properly.
1;
--
2.26.1

View file

@ -1,20 +1,18 @@
# Template file for 'make'
# NOTE: Please don not upgrade to >= 4.3 unless you can still build
# 'Aegisub' and 'openjdk9-bootstrap' with the updated version.
pkgname=make
reverts="4.3_1"
version=4.2.1
revision=7
version=4.3
revision=2
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')"
short_desc="The GNU make system"
checkdepends="perl"
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.bz2"
checksum=d6e262bf3601b42d2b1e4ef8310029e1dcf20083c5446b4b7aa67081fdffc589
distfiles="${GNU_SITE}/make/${pkgname}-${version}.tar.lz"
checksum=de1a441c4edf952521db30bfca80baae86a0ff1acd0a00402999344f04c45e82
build_options=guile
patch_args="-Np1"