1
0
mirror of https://github.com/golang/go synced 2024-10-05 21:21:21 -06:00
go/src/cmd/link
Ian Lance Taylor ad84f84cb4 cmd/link: don't generate .exe extension for external Windows link
On Windows, gcc -o foo will generate foo.exe.  Prevent that from
happening by adding a final '.' if necessary so that GCC thinks that
the file already has an extension.

Also remove the initial output file when doing an external link, and
use mayberemoveoutfile, not os.Remove, when building an archive
(otherwise we will do the wrong thing for -buildmode=c-archive -o
/dev/null).

I didn't add a test, as it requires using cgo and -o on Windows.

Fixes #11725.

Change-Id: I6ea12437bb6b4b9b8ee5c3b52d83509fa2437b2d
Reviewed-on: https://go-review.googlesource.com/12243
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Reviewed-by: Russ Cox <rsc@golang.org>
2015-07-23 17:49:44 +00:00
..
internal cmd/link: don't generate .exe extension for external Windows link 2015-07-23 17:49:44 +00:00
doc.go cmd/compile, cmd/link: add docs 2015-06-05 04:42:35 +00:00
main.go cmd/compile, cmd/link: create from 5g, 5l, etc 2015-05-21 17:31:51 +00:00