]> Cypherpunks repositories - gostls13.git/commit
lib9, cmd/ld: fixes for cross-linking on a Windows host
authorIan Lance Taylor <iant@golang.org>
Fri, 19 Sep 2014 00:27:26 +0000 (17:27 -0700)
committerIan Lance Taylor <iant@golang.org>
Fri, 19 Sep 2014 00:27:26 +0000 (17:27 -0700)
commit5a40b568d023922e735ddc21f3b4a30d52197b7a
tree84dfd5b623f532629bbbf46a506b207096c6b87b
parent84f9c42bbbfb67c2ef78d4a4e19417329d7f8f5a
lib9, cmd/ld: fixes for cross-linking on a Windows host

This fixes a couple of problems that occur when the linker
removes its temporary directory on Windows.  The linker only
creates and removes a temporary directory when doing external
linking.  Windows does not yet support external linking.
Therefore, these problems are only seen when using a
cross-compiler hosted on Windows.

In lib9, FindFirstFileW returns just the file name, not the
full path name.  Don't assume that we will find a slash.
Changed the code to work either way just in case.

In ld, Windows requires that files be closed before they are
removed, so close the output file before we might try to
remove it.

Fixes #8723.

LGTM=alex.brainman
R=golang-codereviews, alex.brainman
CC=golang-codereviews
https://golang.org/cl/141690043
src/cmd/ld/lib.c
src/lib9/tempdir_windows.c