My brother Abramo discovered that this behaviour is due to
a misfeature of GNU Make, whose main procedure contains:
#ifdef SET_STACK_SIZE
/* Get rid of any avoidable limit on stack size. */
{
struct rlimit rlim;
/* Set the stack limit huge so that alloca does not fail. */
if (getrlimit (RLIMIT_STACK, &rlim) == 0
&& rlim.rlim_cur > 0 && rlim.rlim_cur < rlim.rlim_max)
{
stack_limit = rlim;
rlim.rlim_cur = rlim.rlim_max;
setrlimit (RLIMIT_STACK, &rlim);
}
else
stack_limit.rlim_cur = 0;
}
#endif
This limit is never restored again.
The Fedora package ships GNU Make 3.81 along with a patch that
restores the original rlimit before executing programs via execvp(),
and this explains why the problem was not reproducible there.
This bug of GNU Make (http://savannah.gnu.org/bugs/index.php?22010)
has been fixed in GNU Make 3.82, just released.
Thanks again to everyone,
Roberto
--
Prof. Roberto Bagnara
Applied Formal Methods Laboratory
Department of Mathematics, University of Parma, Italy
http://www.cs.unipr.it/~bagnara/
mailto:[email protected]