]> git.lizzy.rs Git - rust.git/commit
msvc: Lookup linker in windows registry
authorAlex Crichton <alex@alexcrichton.com>
Tue, 30 Jun 2015 06:16:24 +0000 (23:16 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Wed, 1 Jul 2015 16:35:55 +0000 (09:35 -0700)
commit91c22b63020e15908859b11bfe777d65bc55aa98
treec0f78856ec3dadc53136610a966a3e210624df1a
parentf9de964ccf767498ed7b1b4a879aaca1777a9d3d
msvc: Lookup linker in windows registry

This commit alters the compiler to no longer "just run link.exe" but instead
probe the system's registry to find where the linker is located. The default
library search path (normally found through LIB) is also found through the
registry. This also brings us in line with the default behavior of Clang, and
much of the logic of where to look for information is copied over from Clang as
well. Finally, this commit removes the makefile logic for updating the
environment variables for the compiler, except for stage0 where it's still
necessary.

The motivation for this change is rooted in two positions:

* Not having to set up these environment variables is much less hassle both for
  the bootstrap and for running the compiler itself. This means that the
  compiler can be run outside of VS shells and be run inside of cmd.exe or a
  MSYS shell.

* When dealing with cross compilation, there's not actually a set of environment
  variables that can be set for the compiler. This means, for example, if a
  Cargo compilation is targeting 32-bit from 64-bit you can't actually set up
  one set of environment variables. Having the compiler deal with the logic
  instead is generally much more convenient!
mk/target.mk
src/librustc_trans/back/link.rs
src/librustc_trans/back/msvc/mod.rs [new file with mode: 0644]
src/librustc_trans/back/msvc/registry.rs [new file with mode: 0644]
src/librustc_trans/back/write.rs
src/librustc_trans/lib.rs