@@ -53,6 +53,16 @@ Read ["Installing Rust"] from [The Book].
53
53
54
54
### Building on Windows
55
55
56
+ There are two prominent ABIs in use on Windows: the native (MSVC) ABI used by
57
+ Visual Studio, and the GNU ABI used by the GCC toolchain. Which version of Rust
58
+ you need depends largely on what C/C++ libraries you want to interoperate with:
59
+ for interop with software produced by Visual Studio use the MSVC build of Rust;
60
+ for interop with GNU software built using the MinGW/MSYS2 toolchain use the GNU
61
+ build.
62
+
63
+
64
+ #### MinGW
65
+
56
66
[MSYS2](http://msys2.github.io/) can be used to easily build Rust on Windows:
57
67
58
68
1. Grab the latest MSYS2 installer and go through the installer.
@@ -63,12 +73,15 @@ Read ["Installing Rust"] from [The Book].
63
73
```sh
64
74
# Update package mirrors (may be needed if you have a fresh install of MSYS2)
65
75
$ pacman -Sy pacman-mirrors
76
+ ```
66
77
67
- # Choose one based on platform:
68
- # *** see the note below ***
69
- $ pacman -S mingw-w64-i686-toolchain
70
- $ pacman -S mingw-w64-x86_64-toolchain
78
+ Download [MinGW from
79
+ here](http://mingw-w64.org/doku.php/download/mingw-builds), and choose the
80
+ `threads=win32,exceptions=dwarf/seh` flavor when installing. After installing,
81
+ add its `bin` directory to your `PATH`. This is due to #28260, in the future,
82
+ installing from pacman should be just fine.
71
83
84
+ ```
72
85
# Make git available in MSYS2 (if not already available on path)
73
86
$ pacman -S git
74
87
@@ -84,16 +97,19 @@ Read ["Installing Rust"] from [The Book].
84
97
$ ./configure
85
98
$ make && make install
86
99
` ` `
87
- > *** Note:*** gcc versions > = 5 currently have issues building LLVM on Windows
88
- > resulting in a segmentation fault when building Rust. In order to avoid this
89
- > it may be necessary to obtain an earlier version of gcc such as 4.9.x.
90
- > Msys' s `pacman` will install the latest version, so for the time being it is
91
- > recommended to skip gcc toolchain installation step above and use [Mingw-Builds]
92
- > project' s installer instead. Be sure to add gcc ` bin` directory to the path
93
- > before running ` configure` .
94
- > For more information on this see issue # 28260.
95
-
96
- [Mingw-Builds]: http://sourceforge.net/projects/mingw-w64/
100
+
101
+ # ### MSVC
102
+
103
+ MSVC builds of Rust additionally require an installation of Visual Studio 2013
104
+ (or later) so ` rustc` can use its linker. Make sure to check the “C++ tools”
105
+ option. In addition, ` cmake` needs to be installed to build LLVM.
106
+
107
+ With these dependencies installed, the build takes two steps:
108
+
109
+ ` ` ` sh
110
+ $ ./configure
111
+ $ make && make install
112
+ ` ` `
97
113
98
114
# # Building Documentation
99
115
0 commit comments