Go patch committed: Add -o option when linking

Ian Lance Taylor iant@google.com
Fri Feb 17 22:36:00 GMT 2012


The Go compiler needs to see all input files at once, rather than be
invoked separately on each one.  The gcc driver will only do that if the
static combine_inputs variable is set.  And combine_inputs is only set
if the -o option is used (or LTO-specific -fwpa option is used).  The
gccgo driver currently automatically adds a -o option when compiling
when no -o option is seen.  That is sufficient for the normal case, but
does not handle the case of linking without a -o option.  Linking
without a -o option is unusual but of course it ought to work correctly.
I don't want to mess with the general driver code in stage 4, so I have
modified the gccgo driver to add a -o option even when linking.
Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu.
Committed to mainline.

Ian


2012-02-17  Ian Lance Taylor  <iant@google.com>

	* gospec.c (lang_specific_driver): If linking, and no -o option
	was used, add one.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: foo.patch
Type: text/x-diff
Size: 2704 bytes
Desc: patch
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20120217/11b28269/attachment.bin>


More information about the Gcc-patches mailing list