[patch] Avoid linker errors with --help= option. (PR 31353)

Brooks Moses brooks.moses@codesourcery.com
Mon Mar 26 02:34:00 GMT 2007


:ADDPATCH other:

Currently, the handler for --help= in gcc.c creates a dummy file name to 
pass to the various cc1, f951, and other subprocesses.  This seems to 
fulfill its purpose of getting the later parts of gcc.c to call the 
various subprocesses, but it also means that the linker gets called with 
nothing to link.  The result is that the output of "gcc --help=target" 
(for example) ends with a linker error message.

The attached patch turns off the linker in the case where --help= has 
been specified.  In so doing, it gives meaning to the various numbers 
assigned to print_subprocess_help -- it's already assigned 2 in the 
--help= handler, and 1 in the --target-help handler, but those numbers 
are never checked.  I presume that something like this was the intended 
use, however.

-----------------------------------------------------------------
2007-03-25  Brooks Moses  <brooks.moses@codesourcery.com>

	PR other/31353
	* gcc.c (main): Do not run the linker if
	print_subprocess_help indicates that it shouldn't be
	run.

-----------------------------------------------------------------

Tested with a bootstrap (and a few minutes of "make check", to confirm 
that this isn't interfering with compiling code) on i686-pc-linux-gnu. 
Ok for trunk?

- Brooks
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PR31353.diff
Type: text/x-patch
Size: 388 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20070326/6fe96e01/attachment.bin>


More information about the Gcc-patches mailing list