Skip to content

Commit 011a23e

Browse files
committedJan 5, 2016
Update MinGW details in the README
Fixes #29649
1 parent 191ff2d commit 011a23e

File tree

1 file changed

+30
-14
lines changed

1 file changed

+30
-14
lines changed
 

‎README.md

+30-14
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,16 @@ Read ["Installing Rust"] from [The Book].
5353
5454
### Building on Windows
5555
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+
5666
[MSYS2](http://msys2.github.io/) can be used to easily build Rust on Windows:
5767
5868
1. Grab the latest MSYS2 installer and go through the installer.
@@ -63,12 +73,15 @@ Read ["Installing Rust"] from [The Book].
6373
```sh
6474
# Update package mirrors (may be needed if you have a fresh install of MSYS2)
6575
$ pacman -Sy pacman-mirrors
76+
```
6677
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.
7183
84+
```
7285
# Make git available in MSYS2 (if not already available on path)
7386
$ pacman -S git
7487
@@ -84,16 +97,19 @@ Read ["Installing Rust"] from [The Book].
8497
$ ./configure
8598
$ make && make install
8699
```
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+
```
97113

98114
## Building Documentation
99115

0 commit comments

Comments
 (0)