mirror of
https://github.com/mirror/make.git
synced 2025-01-27 12:51:07 +08:00
Add some alloca(0) calls for systems without "normal" alloca support.
Fix a file descriptor leak with make re-exec while using the jobserver. Update some release information.
This commit is contained in:
parent
29e539bad0
commit
24aac7f8f6
1
AUTHORS
1
AUTHORS
@ -6,6 +6,7 @@ GNU make development up to version 3.75 by:
|
|||||||
|
|
||||||
Development starting with GNU make 3.76 by:
|
Development starting with GNU make 3.76 by:
|
||||||
Paul D. Smith <psmith@gnu.org>
|
Paul D. Smith <psmith@gnu.org>
|
||||||
|
|
||||||
Additional development starting with GNU make 3.81 by:
|
Additional development starting with GNU make 3.81 by:
|
||||||
Boris Kolpackov <boris@kolpackov.net>
|
Boris Kolpackov <boris@kolpackov.net>
|
||||||
|
|
||||||
|
15
ChangeLog
15
ChangeLog
@ -1,3 +1,18 @@
|
|||||||
|
2006-03-19 Paul D. Smith <psmith@gnu.org>
|
||||||
|
|
||||||
|
* remake.c (update_file): Add alloca(0) to clean up alloca'd
|
||||||
|
memory on hosts that don't support it directly.
|
||||||
|
|
||||||
|
* README.cvs: Add information on steps for making a release (to
|
||||||
|
make sure I don't forget any).
|
||||||
|
|
||||||
|
* main.c (clean_jobserver): Move jobserver cleanup code into a new
|
||||||
|
function.
|
||||||
|
(die): Cleanup code was removed from here; call the new function.
|
||||||
|
(main): If we are re-execing, clean up the jobserver first so we
|
||||||
|
don't leak file descriptors.
|
||||||
|
Fix bug reported by Craig Fithian <craig.fithian@citigroup.com>.
|
||||||
|
|
||||||
2006-03-17 Paul D. Smith <psmith@gnu.org>
|
2006-03-17 Paul D. Smith <psmith@gnu.org>
|
||||||
|
|
||||||
* maintMakefile (do-po-update): Rewrite this rule to clean up and
|
* maintMakefile (do-po-update): Rewrite this rule to clean up and
|
||||||
|
2
NEWS
2
NEWS
@ -1,6 +1,6 @@
|
|||||||
GNU make NEWS -*-indented-text-*-
|
GNU make NEWS -*-indented-text-*-
|
||||||
History of user-visible changes.
|
History of user-visible changes.
|
||||||
8 March 2006
|
19 March 2006
|
||||||
|
|
||||||
See the end of this file for copyrights and conditions.
|
See the end of this file for copyrights and conditions.
|
||||||
|
|
||||||
|
76
README.cvs
76
README.cvs
@ -82,6 +82,18 @@ That is, you can just run:
|
|||||||
to build and install GNU make.
|
to build and install GNU make.
|
||||||
|
|
||||||
|
|
||||||
|
Windows builds from CVS
|
||||||
|
-----------------------
|
||||||
|
|
||||||
|
If you have a UNIX emulation like CYGWIN you can opt to run the general
|
||||||
|
build procedure above; it will work. Be sure to read
|
||||||
|
README.W32.template for information on options you might want to use
|
||||||
|
when running ./configure.
|
||||||
|
|
||||||
|
If you can't or don't want to do that, then rename the file
|
||||||
|
README.W32.template to README.W32 and follow those instructions.
|
||||||
|
|
||||||
|
|
||||||
Creating a Package
|
Creating a Package
|
||||||
------------------
|
------------------
|
||||||
|
|
||||||
@ -107,19 +119,65 @@ converting to Automake is worth the trouble! A big "huzzah!" to Tom
|
|||||||
T. and the AutoToolers!
|
T. and the AutoToolers!
|
||||||
|
|
||||||
|
|
||||||
That's it, you're done!
|
Steps to Release
|
||||||
|
----------------
|
||||||
|
|
||||||
|
Here are the things that need to be done (in more or less this order)
|
||||||
|
before making an official release:
|
||||||
|
|
||||||
|
* Update the configure.in file with the new release number.
|
||||||
|
* Update the NEWS file with the release number and date.
|
||||||
|
* Update the doc/make.texi file with the release number and date.
|
||||||
|
Check the variables EDITION, VERSION, UPDATED, and UPDATE-MONTH.
|
||||||
|
* Create the new release in the Savannah "Bugs" Administration for
|
||||||
|
both the "Component Version" and "Fixed Release" fields.
|
||||||
|
* Create the new release in the Savannah "Patches" Administration for
|
||||||
|
the "Fixed Release" field.
|
||||||
|
* Update the Savannah bug list URL in the NEWS file to use the correct
|
||||||
|
"Fixed Release" ID number.
|
||||||
|
* Run "make distcheck" to be sure it all works.
|
||||||
|
* Commit everything.
|
||||||
|
* cvs tag -r<RTAG> where RTAG is constructed by replacing each "." in
|
||||||
|
the version with "-" and prefixing it with "make-".
|
||||||
|
|
||||||
|
|
||||||
Windows builds from CVS
|
Publishing a Package
|
||||||
-----------------------
|
--------------------
|
||||||
|
|
||||||
If you have a UNIX emulation like CYGWIN you can opt to run the general
|
In order to publish a package on the FSF FTP site, either the release
|
||||||
build procedure above; it will work. Be sure to read
|
site ftp://ftp.gnu.org, or the prerelease site ftp://alpha.gnu.org, you
|
||||||
README.W32.template for information on options you might want to use
|
first need to have my GPG private key and my passphrase to unlock it.
|
||||||
when running ./configure.
|
And, you can't have them! So there! But, just so I remember here's
|
||||||
|
what you do:
|
||||||
|
|
||||||
If you can't or don't want to do that, then rename the file
|
Make sure the "Steps to Release" are complete and committed and tagged.
|
||||||
README.W32.template to README.W32 and follow those instructions.
|
|
||||||
|
cvs -d :pserver:anonymous@cvs.savannah.gnu.org:/source/make \
|
||||||
|
export -r<RTAG> -d make-release make
|
||||||
|
|
||||||
|
cd make-release
|
||||||
|
|
||||||
|
<run the commands above to build the release>
|
||||||
|
|
||||||
|
make upload-alpha # for alpha.gnu.org (pre-releases)
|
||||||
|
-OR-
|
||||||
|
make upload-ftp # for ftp.gnu.org (official releases)
|
||||||
|
|
||||||
|
It will ask for the GPG passphrase _THREE_ times. Sigh.
|
||||||
|
|
||||||
|
|
||||||
|
Where to Announce
|
||||||
|
-----------------
|
||||||
|
|
||||||
|
Create the announcement in a text file, then sign it with GPG. Upload
|
||||||
|
to gnu.org, then login and send from my account there.
|
||||||
|
|
||||||
|
Email to: make-alpha@gnu.org, bug-make@gnu.org, help-make@gnu.org, make-w32@gnu.org.
|
||||||
|
Email to: info-gnu@gnu.org
|
||||||
|
|
||||||
|
Add a news item to the Savannah project site.
|
||||||
|
|
||||||
|
Add an update to freshmeat.net.
|
||||||
|
|
||||||
|
|
||||||
Appendix A - For The Brave
|
Appendix A - For The Brave
|
||||||
|
2
job.c
2
job.c
@ -716,7 +716,7 @@ reap_children (int block, int err)
|
|||||||
if (c->good_stdin)
|
if (c->good_stdin)
|
||||||
good_stdin_used = 0;
|
good_stdin_used = 0;
|
||||||
|
|
||||||
dontcare = c->dontcare;
|
dontcare = c->file->dontcare;
|
||||||
|
|
||||||
if (child_failed && !c->noerror && !ignore_errors_flag)
|
if (child_failed && !c->noerror && !ignore_errors_flag)
|
||||||
{
|
{
|
||||||
|
98
main.c
98
main.c
@ -81,6 +81,7 @@ extern void exit PARAMS ((int)) __attribute__ ((noreturn));
|
|||||||
extern double atof ();
|
extern double atof ();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static void clean_jobserver PARAMS ((int status));
|
||||||
static void print_data_base PARAMS ((void));
|
static void print_data_base PARAMS ((void));
|
||||||
static void print_version PARAMS ((void));
|
static void print_version PARAMS ((void));
|
||||||
static void decode_switches PARAMS ((int argc, char **argv, int env));
|
static void decode_switches PARAMS ((int argc, char **argv, int env));
|
||||||
@ -1969,6 +1970,8 @@ main (int argc, char **argv, char **envp)
|
|||||||
|
|
||||||
log_working_directory (0);
|
log_working_directory (0);
|
||||||
|
|
||||||
|
clean_jobserver (0);
|
||||||
|
|
||||||
if (makefiles != 0)
|
if (makefiles != 0)
|
||||||
{
|
{
|
||||||
/* These names might have changed. */
|
/* These names might have changed. */
|
||||||
@ -2957,7 +2960,7 @@ print_version (void)
|
|||||||
/* Print a bunch of information about this and that. */
|
/* Print a bunch of information about this and that. */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
print_data_base (void)
|
print_data_base ()
|
||||||
{
|
{
|
||||||
time_t when;
|
time_t when;
|
||||||
|
|
||||||
@ -2974,6 +2977,56 @@ print_data_base (void)
|
|||||||
when = time ((time_t *) 0);
|
when = time ((time_t *) 0);
|
||||||
printf (_("\n# Finished Make data base on %s\n"), ctime (&when));
|
printf (_("\n# Finished Make data base on %s\n"), ctime (&when));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
clean_jobserver (int status)
|
||||||
|
{
|
||||||
|
char token = '+';
|
||||||
|
|
||||||
|
/* Sanity: have we written all our jobserver tokens back? If our
|
||||||
|
exit status is 2 that means some kind of syntax error; we might not
|
||||||
|
have written all our tokens so do that now. If tokens are left
|
||||||
|
after any other error code, that's bad. */
|
||||||
|
|
||||||
|
if (job_fds[0] != -1 && jobserver_tokens)
|
||||||
|
{
|
||||||
|
if (status != 2)
|
||||||
|
error (NILF,
|
||||||
|
"INTERNAL: Exiting with %u jobserver tokens (should be 0)!",
|
||||||
|
jobserver_tokens);
|
||||||
|
else
|
||||||
|
while (jobserver_tokens--)
|
||||||
|
{
|
||||||
|
int r;
|
||||||
|
|
||||||
|
EINTRLOOP (r, write (job_fds[1], &token, 1));
|
||||||
|
if (r != 1)
|
||||||
|
perror_with_name ("write", "");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* Sanity: If we're the master, were all the tokens written back? */
|
||||||
|
|
||||||
|
if (master_job_slots)
|
||||||
|
{
|
||||||
|
/* We didn't write one for ourself, so start at 1. */
|
||||||
|
unsigned int tcnt = 1;
|
||||||
|
|
||||||
|
/* Close the write side, so the read() won't hang. */
|
||||||
|
close (job_fds[1]);
|
||||||
|
|
||||||
|
while (read (job_fds[0], &token, 1) == 1)
|
||||||
|
++tcnt;
|
||||||
|
|
||||||
|
if (tcnt != master_job_slots)
|
||||||
|
error (NILF,
|
||||||
|
"INTERNAL: Exiting with %u jobserver tokens available; should be %u!",
|
||||||
|
tcnt, master_job_slots);
|
||||||
|
|
||||||
|
close (job_fds[0]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Exit with STATUS, cleaning up as necessary. */
|
/* Exit with STATUS, cleaning up as necessary. */
|
||||||
|
|
||||||
@ -2984,7 +3037,6 @@ die (int status)
|
|||||||
|
|
||||||
if (!dying)
|
if (!dying)
|
||||||
{
|
{
|
||||||
char token = '+';
|
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
dying = 1;
|
dying = 1;
|
||||||
@ -3006,47 +3058,7 @@ die (int status)
|
|||||||
if (print_data_base_flag)
|
if (print_data_base_flag)
|
||||||
print_data_base ();
|
print_data_base ();
|
||||||
|
|
||||||
/* Sanity: have we written all our jobserver tokens back? If our
|
clean_jobserver (status);
|
||||||
exit status is 2 that means some kind of syntax error; we might not
|
|
||||||
have written all our tokens so do that now. If tokens are left
|
|
||||||
after any other error code, that's bad. */
|
|
||||||
|
|
||||||
if (job_fds[0] != -1 && jobserver_tokens)
|
|
||||||
{
|
|
||||||
if (status != 2)
|
|
||||||
error (NILF,
|
|
||||||
"INTERNAL: Exiting with %u jobserver tokens (should be 0)!",
|
|
||||||
jobserver_tokens);
|
|
||||||
else
|
|
||||||
while (jobserver_tokens--)
|
|
||||||
{
|
|
||||||
int r;
|
|
||||||
|
|
||||||
EINTRLOOP (r, write (job_fds[1], &token, 1));
|
|
||||||
if (r != 1)
|
|
||||||
perror_with_name ("write", "");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* Sanity: If we're the master, were all the tokens written back? */
|
|
||||||
|
|
||||||
if (master_job_slots)
|
|
||||||
{
|
|
||||||
/* We didn't write one for ourself, so start at 1. */
|
|
||||||
unsigned int tcnt = 1;
|
|
||||||
|
|
||||||
/* Close the write side, so the read() won't hang. */
|
|
||||||
close (job_fds[1]);
|
|
||||||
|
|
||||||
while ((err = read (job_fds[0], &token, 1)) == 1)
|
|
||||||
++tcnt;
|
|
||||||
|
|
||||||
if (tcnt != master_job_slots)
|
|
||||||
error (NILF,
|
|
||||||
"INTERNAL: Exiting with %u jobserver tokens available; should be %u!",
|
|
||||||
tcnt, master_job_slots);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Try to move back to the original directory. This is essential on
|
/* Try to move back to the original directory. This is essential on
|
||||||
MS-DOS (where there is really only one process), and on Unix it
|
MS-DOS (where there is really only one process), and on Unix it
|
||||||
|
4
remake.c
4
remake.c
@ -264,6 +264,7 @@ update_goal_chain (struct dep *goals)
|
|||||||
just_print_flag = n;
|
just_print_flag = n;
|
||||||
job_slots = j;
|
job_slots = j;
|
||||||
}
|
}
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -306,6 +307,9 @@ update_file (struct file *file, unsigned int depth)
|
|||||||
status |= update_file_1 (f, depth);
|
status |= update_file_1 (f, depth);
|
||||||
check_renamed (f);
|
check_renamed (f);
|
||||||
|
|
||||||
|
/* Clean up any alloca() used during the update. */
|
||||||
|
alloca (0);
|
||||||
|
|
||||||
/* If we got an error, don't bother with double_colon etc. */
|
/* If we got an error, don't bother with double_colon etc. */
|
||||||
if (status != 0 && !keep_going_flag)
|
if (status != 0 && !keep_going_flag)
|
||||||
return status;
|
return status;
|
||||||
|
@ -1,3 +1,9 @@
|
|||||||
|
2006-03-19 Paul D. Smith <psmith@gnu.org>
|
||||||
|
|
||||||
|
* scripts/features/parallelism: Test that the jobserver is
|
||||||
|
properly managed when we have to re-exec the master instance of
|
||||||
|
make.
|
||||||
|
|
||||||
2006-03-17 Boris Kolpackov <boris@kolpackov.net>
|
2006-03-17 Boris Kolpackov <boris@kolpackov.net>
|
||||||
|
|
||||||
* scripts/features/statipattrules: Add tests for bug #16053.
|
* scripts/features/statipattrules: Add tests for bug #16053.
|
||||||
|
@ -126,4 +126,33 @@ mod_a.o mod_b.o:
|
|||||||
', '-j2', '');
|
', '-j2', '');
|
||||||
|
|
||||||
|
|
||||||
|
# Make sure that all jobserver FDs are closed if we need to re-exec the
|
||||||
|
# master copy.
|
||||||
|
|
||||||
|
run_make_test('
|
||||||
|
submake: ; @$(MAKE) --no-print-directory -f #MAKEFILE# fdprint 5>output
|
||||||
|
|
||||||
|
dependfile: ; @echo FOO=bar > $@
|
||||||
|
|
||||||
|
INCL := true
|
||||||
|
|
||||||
|
FOO=foo
|
||||||
|
ifeq ($(INCL),true)
|
||||||
|
-include dependfile
|
||||||
|
endif
|
||||||
|
|
||||||
|
fdprint: ; @echo hi >&5 && echo "$(FOO)"
|
||||||
|
|
||||||
|
recurse: ; @$(MAKE) --no-print-directory -f #MAKEFILE# submake INCL=true',
|
||||||
|
'-j2',
|
||||||
|
'bar');
|
||||||
|
|
||||||
|
unlink('dependfile');
|
||||||
|
|
||||||
|
|
||||||
|
# Do it again, this time where the include is done by the non-master make.
|
||||||
|
run_make_test(undef, '-j2 recurse INCL=false', 'bar');
|
||||||
|
|
||||||
|
unlink('dependfile');
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
Loading…
Reference in New Issue
Block a user