Add optional section for using lld-link on Windows

This commit is contained in:
Derek Guenther 2018-10-07 22:20:59 -05:00
parent d048aa9c51
commit 496d26d2ee

View file

@ -221,13 +221,29 @@ settings for the installer are fine).
5. Install Visual Studio Community 2017 (https://www.visualstudio.com/vs/community/). You MUST add "Visual C++" to the 5. Install Visual Studio Community 2017 (https://www.visualstudio.com/vs/community/). You MUST add "Visual C++" to the
list of installed components. It is not on by default. Visual Studio 2017 MUST installed to the default location or mach.bat will not find it. list of installed components. It is not on by default. Visual Studio 2017 MUST installed to the default location or mach.bat will not find it.
##### [Optional] Install LLVM for faster link times
You may experience much faster builds on Windows by following these steps. (Related Rust issue: https://github.com/rust-lang/rust/issues/37543)
1. Download the latest version of LLVM (http://releases.llvm.org/).
2. Run the installer and choose to add LLVM to the system PATH.
3. Add the following to your Cargo config (Found at `%USERPROFILE%\.cargo\config`). You may need to change the triple to match your environment.
```
[target.x86_64-pc-windows-msvc]
linker = "lld-link.exe"
```
##### Troubleshooting a Windows environment
> If you encountered errors with the environment above, do the following for a workaround: > If you encountered errors with the environment above, do the following for a workaround:
> 1. Download and install [Build Tools for Visual Studio 2017](https://www.visualstudio.com/thank-you-downloading-visual-studio/?sku=BuildTools&rel=15) > 1. Download and install [Build Tools for Visual Studio 2017](https://www.visualstudio.com/thank-you-downloading-visual-studio/?sku=BuildTools&rel=15)
> 2. Install `python2.7 x86-x64` and `virtualenv` > 2. Install `python2.7 x86-x64` and `virtualenv`
> 3. Run `mach.bat build -d`. > 3. Run `mach.bat build -d`.
>If you have troubles with `x64 type` prompt as `mach.bat` set by default: >If you have troubles with `x64 type` prompt as `mach.bat` set by default:
> 1. you may need to choose and launch the type manually, such as `x86_x64 Cross Tools Command Prompt for VS 2017` in the Windows menu.) > 1. You may need to choose and launch the type manually, such as `x86_x64 Cross Tools Command Prompt for VS 2017` in the Windows menu.)
> 2. `cd to/the/path/servo` > 2. `cd to/the/path/servo`
> 3. `python mach build -d` > 3. `python mach build -d`