Go to file
Stuart Pernsteiner cf672850df run optimization and codegen on worker threads
Refactor the code in `llvm::back` that invokes LLVM optimization and codegen
passes so that it can be called from worker threads.  (Previously, it used
`&Session` extensively, and `Session` is not `Share`.)  The new code can handle
multiple compilation units, by compiling each unit to `crate.0.o`, `crate.1.o`,
etc., and linking together all the `crate.N.o` files into a single `crate.o`
using `ld -r`.  The later linking steps can then be run unchanged.

The new code preserves the behavior of `--emit`/`-o` when building a single
compilation unit.  With multiple compilation units, the `--emit=asm/ir/bc`
options produce multiple files, so combinations like `--emit=ir -o foo.ll` will
not actually produce `foo.ll` (they instead produce several `foo.N.ll` files).

The new code supports `-Z lto` only when using a single compilation unit.
Compiling with multiple compilation units and `-Z lto` will produce an error.
(I can't think of any good reason to do such a thing.)  Linking with `-Z lto`
against a library that was built as multiple compilation units will also fail,
because the rlib does not contain a `crate.bytecode.deflate` file.  This could
be supported in the future by linking together the `crate.N.bc` files produced
when compiling the library into a single `crate.bc`, or by making the LTO code
support multiple `crate.N.bytecode.deflate` files.
2014-09-05 09:18:55 -07:00
man rustc.1: fix typo 2014-07-16 08:01:59 +02:00
mk auto merge of #16322 : michaelwoerister/rust/gdb-pretty, r=alexcrichton 2014-08-30 04:01:24 +00:00
src run optimization and codegen on worker threads 2014-09-05 09:18:55 -07:00
.gitattributes webfonts: proper fix 2014-07-08 20:29:36 +02:00
.gitignore gitignore: Add the autogenerated/downloaded unicode data files. 2014-08-03 17:32:53 +10:00
.gitmodules add back jemalloc to the tree 2014-05-10 19:58:17 -04:00
.mailmap .mailmap: tolerate different names, emails in shortlog 2013-06-05 23:26:00 +05:30
.travis.yml travis: Move from travis_wait to time-passes 2014-07-01 20:21:16 -07:00
AUTHORS.txt Updated release notes for 0.11.0 2014-06-30 07:25:58 -07:00
CONTRIBUTING.md Make small doc contributions less onerous/intimidating 2014-08-08 19:36:32 -04:00
COPYRIGHT Update some copyright dates 2014-01-08 18:04:43 -08:00
LICENSE-APACHE Update license, add license boilerplate to most files. Remainder will follow. 2012-12-03 17:12:14 -08:00
LICENSE-MIT Change the licence holder to The Rust Project Developers 2014-05-03 23:59:24 +02:00
Makefile.in Shuffle around check-lexer conditions 2014-07-21 18:38:40 -07:00
README.md configure: Recognize i686 build on msys2 2014-08-23 01:47:37 +09:00
RELEASES.txt Update RELEASES.txt 2014-07-05 00:22:59 -04:00
configure debuginfo: Emit different autotest debugger scripts depending on GDB version. 2014-08-27 15:19:14 +02:00

README.md

The Rust Programming Language

This is a compiler for Rust, including standard libraries, tools and documentation.

Quick Start

  1. Download a binary installer for your platform.
  2. Read the tutorial.
  3. Enjoy!

Note: Windows users can read the detailed getting started notes on the wiki.

Building from Source

  1. Make sure you have installed the dependencies:

    • g++ 4.7 or clang++ 3.x
    • python 2.6 or later (but not 3.x)
    • perl 5.0 or later
    • GNU make 3.81 or later
    • curl
    • git
  2. Download and build Rust:

    You can either download a tarball or build directly from the repo.

    To build from the tarball do:

     $ curl -O https://static.rust-lang.org/dist/rust-nightly.tar.gz
     $ tar -xzf rust-nightly.tar.gz
     $ cd rust-nightly
    

    Or to build from the repo do:

     $ git clone https://github.com/rust-lang/rust.git
     $ cd rust
    

    Now that you have Rust's source code, you can configure and build it:

     $ ./configure
     $ make && make install
    

    Note: You may need to use sudo make install if you do not normally have permission to modify the destination directory. The install locations can be adjusted by passing a --prefix argument to configure. Various other options are also supported, pass --help for more information on them.

    When complete, make install will place several programs into /usr/local/bin: rustc, the Rust compiler, and rustdoc, the API-documentation tool.

  3. Read the tutorial.

  4. Enjoy!

Building on Windows

To easily build on windows we can use MSYS2:

  1. Grab the latest MSYS2 installer and go through the installer.

  2. Now from the MSYS2 terminal we want to install the mingw64 toolchain and the other tools we need.

     $ pacman -S mingw-w64-i686-toolchain
     $ pacman -S base-devel
    
  3. With that now start mingw32_shell.bat from where you installed MSYS2 (i.e. C:\msys).

  4. From there just navigate to where you have Rust's source code, configure and build it:

     $ ./configure
     $ make && make install
    

Notes

Since the Rust compiler is written in Rust, it must be built by a precompiled "snapshot" version of itself (made in an earlier state of development). As such, source builds require a connection to the Internet, to fetch snapshots, and an OS that can execute the available snapshot binaries.

Snapshot binaries are currently built and tested on several platforms:

  • Windows (7, 8, Server 2008 R2), x86 only
  • Linux (2.6.18 or later, various distributions), x86 and x86-64
  • OSX 10.7 (Lion) or greater, x86 and x86-64

You may find that other platforms work, but these are our officially supported build environments that are most likely to work.

Rust currently needs about 1.5 GiB of RAM to build without swapping; if it hits swap, it will take a very long time to build.

There is a lot more documentation in the wiki.

License

Rust is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0), with portions covered by various BSD-like licenses.

See LICENSE-APACHE, LICENSE-MIT, and COPYRIGHT for details.