gmake-4.2.90 patch

2019-09-01 Thread Dmitry Goncharov via Bug reports and discussion for GNU make
This patch fixes a compilation error when time.h does not get
indirectly included.

regards, Dmitry

diff --git a/src/file.c b/src/file.c
index c20fcf8..f58e855 100644
--- a/src/file.c
+++ b/src/file.c
@@ -17,6 +17,7 @@ this program.  If not, see .  */
 #include "makeint.h"

 #include 
+#include 

 #include "filedef.h"
 #include "dep.h"

___
Bug-make mailing list
Bug-make@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-make


gmake-4.2.90 still crashes on $(wildcard hello*/)

2019-09-01 Thread Dmitry Goncharov via Bug reports and discussion for GNU make
$ echo 'all: ; @echo $(wildcard hello*/)' > /tmp/1.mk
$ ./make -f /tmp/1.mk
Segmentation Fault

A patch was provided here
https://lists.gnu.org/archive/html/bug-make/2017-12/msg6.html

Any chance to have this applied for 4.3?

regards, Dmitry

___
Bug-make mailing list
Bug-make@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-make


gmake-4.2.90 regression (error message missing)

2019-09-01 Thread Dmitry Goncharov via Bug reports and discussion for GNU make
Good morning.

Certian implementations of posix_spawn return 0 on failure and then
exit the child process with 127. I observed this with older glibc
(2.12) and on aix.

This results in gmake not printing related error message "no such
file" or "permission denied" when the command is missing or not
executable. This also causes multiple tests to fail.

$ echo 'all: ; @./foo' > /tmp/1.mk
$ ./make-4.2.90  -f /tmp/1.mk
make-4.2.90: *** [/tmp/1.mk;1: all] Error 127
$ ./make.patched  -f /tmp/1.mk
make.patched: ./foo: No such file or directory
make.patched: *** [/tmp/1.mk;1: all] Error 127

This patch executes posix_spawnp at configuration time and then
disables posix_spawn if posix_spawn returns 0 on an attempt to exec a
missing file.
This solution won't work for cross compilation.

regards, Dmitry

index f6919a7..9da113c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -142,7 +142,7 @@ AC_CHECK_FUNCS([strdup strndup umask mkstemp mktemp fdopen \
 dup dup2 getcwd realpath sigsetmask sigaction \
 getgroups seteuid setegid setlinebuf setreuid setregid \
 getrlimit setrlimit setvbuf pipe strsignal \
-lstat readlink atexit isatty ttyname pselect posix_spawn \
+lstat readlink atexit isatty ttyname pselect
posix_spawn posix_spawnp \
 posix_spawnattr_setsigmask])

 # We need to check declarations, not just existence, because on Tru64 this
@@ -368,7 +368,18 @@ AC_ARG_ENABLE([posix-spawn],
 AS_CASE([/$ac_cv_header_spawn/$ac_cv_func_posix_spawn/],
   [*/no/*], [make_cv_posix_spawn=no])

-AS_CASE([/$make_cv_posix_spawn/$user_posix_spawn/],
+AC_RUN_IFELSE(
+   [AC_LANG_PROGRAM([
+#include 
+#include ], [
+char* av[[]] = {"./macarie", '\0'};
+char* envp[[]] = {'\0'};
+return posix_spawnp(0, av[[0]], 0, 0, av, envp) != ENOENT; ])],
+  [posix_spawn_is_good="yes"],
+  [posix_spawn_is_good="no"]
+)
+
+AS_CASE([/$make_cv_posix_spawn/$user_posix_spawn/$posix_spawn_is_good/],
   [*/no/*], [make_cv_posix_spawn=no],
   [AC_DEFINE(USE_POSIX_SPAWN, 1, [Define to 1 to use posix_spawn().])
   ])

___
Bug-make mailing list
Bug-make@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-make