Skip to content

Commit 69b8e41

Browse files
committed
---
yaml --- r: 274424 b: refs/heads/stable c: 14dc9fc h: refs/heads/master
1 parent 6fcab7d commit 69b8e41

File tree

216 files changed

+8246
-90498
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

216 files changed

+8246
-90498
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ refs/heads/tmp: e06d2ad9fcd5027bcaac5b08fc9aa39a49d0ecd3
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: c0221c8897db309a79990367476177b1230bb264
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828
32-
refs/heads/stable: 641267e4c20edda3e7b96c58547542e245af5553
32+
refs/heads/stable: 14dc9fcc672b904245bc41732b5ca9a4f24436da
3333
refs/tags/1.0.0: 55bd4f8ff2b323f317ae89e254ce87162d52a375
3434
refs/tags/1.1.0: bc3c16f09287e5545c1d3f76b7abd54f2eca868b
3535
refs/tags/1.2.0: f557861f822c34f07270347b94b5280de20a597e

branches/stable/CONTRIBUTING.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ links to the major sections:
66

77
* [Feature Requests](#feature-requests)
88
* [Bug Reports](#bug-reports)
9+
* [The Build System](#the-build-system)
910
* [Pull Requests](#pull-requests)
1011
* [Writing Documentation](#writing-documentation)
1112
* [Issue Triage](#issue-triage)
@@ -77,6 +78,66 @@ to do this is to invoke `rustc` like this:
7778
$ RUST_BACKTRACE=1 rustc ...
7879
```
7980

81+
## The Build System
82+
83+
Rust's build system allows you to bootstrap the compiler, run tests &
84+
benchmarks, generate documentation, install a fresh build of Rust, and more.
85+
It's your best friend when working on Rust, allowing you to compile & test
86+
your contributions before submission.
87+
88+
All the configuration for the build system lives in [the `mk` directory][mkdir]
89+
in the project root. It can be hard to follow in places, as it uses some
90+
advanced Make features which make for some challenging reading. If you have
91+
questions on the build system internals, try asking in
92+
[`#rust-internals`][pound-rust-internals].
93+
94+
[mkdir]: https://github.com/rust-lang/rust/tree/master/mk/
95+
96+
### Configuration
97+
98+
Before you can start building the compiler you need to configure the build for
99+
your system. In most cases, that will just mean using the defaults provided
100+
for Rust. Configuring involves invoking the `configure` script in the project
101+
root.
102+
103+
```
104+
./configure
105+
```
106+
107+
There are large number of options accepted by this script to alter the
108+
configuration used later in the build process. Some options to note:
109+
110+
- `--enable-debug` - Build a debug version of the compiler (disables optimizations)
111+
- `--enable-optimize` - Enable optimizations (can be used with `--enable-debug`
112+
to make a debug build with optimizations)
113+
- `--disable-valgrind-rpass` - Don't run tests with valgrind
114+
- `--enable-clang` - Prefer clang to gcc for building dependencies (e.g., LLVM)
115+
- `--enable-ccache` - Invoke clang/gcc with ccache to re-use object files between builds
116+
- `--enable-compiler-docs` - Build compiler documentation
117+
118+
To see a full list of options, run `./configure --help`.
119+
120+
### Useful Targets
121+
122+
Some common make targets are:
123+
124+
- `make rustc-stage1` - build up to (and including) the first stage. For most
125+
cases we don't need to build the stage2 compiler, so we can save time by not
126+
building it. The stage1 compiler is a fully functioning compiler and
127+
(probably) will be enough to determine if your change works as expected.
128+
- `make check` - build the full compiler & run all tests (takes a while). This
129+
is what gets run by the continuous integration system against your pull
130+
request. You should run this before submitting to make sure your tests pass
131+
& everything builds in the correct manner.
132+
- `make check-stage1-std NO_REBUILD=1` - test the standard library without
133+
rebuilding the entire compiler
134+
- `make check TESTNAME=<path-to-test-file>.rs` - Run a single test file
135+
- `make check-stage1-rpass TESTNAME=<path-to-test-file>.rs` - Run a single
136+
rpass test with the stage1 compiler (this will be quicker than running the
137+
command above as we only build the stage1 compiler, not the entire thing).
138+
You can also leave off the `-rpass` to run all stage1 test types.
139+
- `make check-stage1-coretest` - Run stage1 tests in `libcore`.
140+
80141
## Pull Requests
81142

82143
Pull requests are the primary mechanism we use to change Rust. GitHub itself

branches/stable/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ and documentation.
99

1010
Read ["Installing Rust"] from [The Book].
1111

12-
["Installing Rust"]: https://doc.rust-lang.org/book/installing-rust.html
12+
["Installing Rust"]: https://doc.rust-lang.org/book/getting-started.html#installing-rust
1313
[The Book]: https://doc.rust-lang.org/book/index.html
1414

1515
## Building from Source

branches/stable/RELEASES.md

Lines changed: 352 additions & 0 deletions
Large diffs are not rendered by default.

branches/stable/configure

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -334,14 +334,6 @@ enable_if_not_disabled() {
334334
fi
335335
}
336336

337-
to_llvm_triple() {
338-
case $1 in
339-
i686-w64-mingw32) echo i686-pc-windows-gnu ;;
340-
x86_64-w64-mingw32) echo x86_64-pc-windows-gnu ;;
341-
*) echo $1 ;;
342-
esac
343-
}
344-
345337
to_gnu_triple() {
346338
case $1 in
347339
i686-pc-windows-gnu) echo i686-w64-mingw32 ;;
@@ -646,12 +638,6 @@ valopt_nosave host "${CFG_BUILD}" "GNUs ./configure syntax LLVM host triples"
646638
valopt_nosave target "${CFG_HOST}" "GNUs ./configure syntax LLVM target triples"
647639
valopt_nosave mandir "${CFG_PREFIX}/share/man" "install man pages in PATH"
648640

649-
# Temporarily support old triples until buildbots get updated
650-
CFG_BUILD=$(to_llvm_triple $CFG_BUILD)
651-
putvar CFG_BUILD # Yes, this creates a duplicate entry, but the last one wins.
652-
CFG_HOST=$(to_llvm_triple $CFG_HOST)
653-
CFG_TARGET=$(to_llvm_triple $CFG_TARGET)
654-
655641
# On Windows this determines root of the subtree for target libraries.
656642
# Host runtime libs always go to 'bin'.
657643
valopt libdir "${CFG_PREFIX}/lib" "install libraries"
@@ -1178,7 +1164,7 @@ do
11781164
;;
11791165

11801166

1181-
*-musl)
1167+
x86_64-*-musl)
11821168
if [ ! -f $CFG_MUSL_ROOT/lib/libc.a ]
11831169
then
11841170
err "musl libc $CFG_MUSL_ROOT/lib/libc.a not found"
@@ -1409,6 +1395,7 @@ do
14091395
make_dir $h/test/debuginfo-gdb
14101396
make_dir $h/test/debuginfo-lldb
14111397
make_dir $h/test/codegen
1398+
make_dir $h/test/codegen-units
14121399
make_dir $h/test/rustdoc
14131400
done
14141401

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# armv7-unknown-linux-gnueabihf configuration
2+
CROSS_PREFIX_armv7-unknown-linux-gnueabihf=arm-linux-gnueabihf-
3+
CC_armv7-unknown-linux-gnueabihf=gcc
4+
CXX_armv7-unknown-linux-gnueabihf=g++
5+
CPP_armv7-unknown-linux-gnueabihf=gcc -E
6+
AR_armv7-unknown-linux-gnueabihf=ar
7+
CFG_LIB_NAME_armv7-unknown-linux-gnueabihf=lib$(1).so
8+
CFG_STATIC_LIB_NAME_armv7-unknown-linux-gnueabihf=lib$(1).a
9+
CFG_LIB_GLOB_armv7-unknown-linux-gnueabihf=lib$(1)-*.so
10+
CFG_LIB_DSYM_GLOB_armv7-unknown-linux-gnueabihf=lib$(1)-*.dylib.dSYM
11+
CFG_JEMALLOC_CFLAGS_armv7-unknown-linux-gnueabihf := -D__arm__ $(CFLAGS) -march=armv7-a
12+
CFG_GCCISH_CFLAGS_armv7-unknown-linux-gnueabihf := -Wall -g -fPIC -D__arm__ $(CFLAGS) -march=armv7-a
13+
CFG_GCCISH_CXXFLAGS_armv7-unknown-linux-gnueabihf := -fno-rtti $(CXXFLAGS)
14+
CFG_GCCISH_LINK_FLAGS_armv7-unknown-linux-gnueabihf := -shared -fPIC -g
15+
CFG_GCCISH_DEF_FLAG_armv7-unknown-linux-gnueabihf := -Wl,--export-dynamic,--dynamic-list=
16+
CFG_LLC_FLAGS_armv7-unknown-linux-gnueabihf :=
17+
CFG_INSTALL_NAME_ar,-unknown-linux-gnueabihf =
18+
CFG_EXE_SUFFIX_armv7-unknown-linux-gnueabihf :=
19+
CFG_WINDOWSY_armv7-unknown-linux-gnueabihf :=
20+
CFG_UNIXY_armv7-unknown-linux-gnueabihf := 1
21+
CFG_LDPATH_armv7-unknown-linux-gnueabihf :=
22+
CFG_RUN_armv7-unknown-linux-gnueabihf=$(2)
23+
CFG_RUN_TARG_armv7-unknown-linux-gnueabihf=$(call CFG_RUN_armv7-unknown-linux-gnueabihf,,$(2))
24+
RUSTC_FLAGS_armv7-unknown-linux-gnueabihf := -C target-feature=+v7,+vfp2,+neon
25+
RUSTC_CROSS_FLAGS_armv7-unknown-linux-gnueabihf :=
26+
CFG_GNU_TRIPLE_armv7-unknown-linux-gnueabihf := armv7-unknown-linux-gnueabihf

branches/stable/mk/cfg/armv7s-apple-ios.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ CFG_LIB_GLOB_armv7s-apple-ios = lib$(1)-*.a
1414
CFG_INSTALL_ONLY_RLIB_armv7s-apple-ios = 1
1515
CFG_STATIC_LIB_NAME_armv7s-apple-ios=lib$(1).a
1616
CFG_LIB_DSYM_GLOB_armv7s-apple-ios = lib$(1)-*.a.dSYM
17-
CFG_JEMALLOC_CFLAGS_armv7s-apple-ios := -arch armv7s -mfpu=vfp4 $(CFG_IOS_SDK_FLAGS_armv7s-apple-ios)
18-
CFG_GCCISH_CFLAGS_armv7s-apple-ios := -Wall -Werror -g -fPIC $(CFG_IOS_SDK_FLAGS_armv7s-apple-ios) -mfpu=vfp4 -arch armv7s
17+
CFG_JEMALLOC_CFLAGS_armv7s-apple-ios := -arch armv7s $(CFG_IOS_SDK_FLAGS_armv7s-apple-ios)
18+
CFG_GCCISH_CFLAGS_armv7s-apple-ios := -Wall -Werror -g -fPIC $(CFG_IOS_SDK_FLAGS_armv7s-apple-ios) -arch armv7s
1919
CFG_GCCISH_CXXFLAGS_armv7s-apple-ios := -fno-rtti $(CFG_IOS_SDK_FLAGS_armv7s-apple-ios) -I$(CFG_IOS_SDK_armv7s-apple-ios)/usr/include/c++/4.2.1
2020
CFG_GCCISH_LINK_FLAGS_armv7s-apple-ios := -lpthread -syslibroot $(CFG_IOS_SDK_armv7s-apple-ios) -Wl,-no_compact_unwind
2121
CFG_GCCISH_DEF_FLAG_armv7s-apple-ios := -Wl,-exported_symbols_list,
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# mips-unknown-linux-musl configuration
2+
CC_mips-unknown-linux-musl=mips-linux-musl-gcc
3+
CXX_mips-unknown-linux-musl=mips-linux-musl-g++
4+
CPP_mips-unknown-linux-musl=mips-linux-musl-gcc -E
5+
AR_mips-unknown-linux-musl=mips-linux-musl-ar
6+
CFG_LIB_NAME_mips-unknown-linux-musl=lib$(1).so
7+
CFG_STATIC_LIB_NAME_mips-unknown-linux-musl=lib$(1).a
8+
CFG_LIB_GLOB_mips-unknown-linux-musl=lib$(1)-*.so
9+
CFG_LIB_DSYM_GLOB_mips-unknown-linux-musl=lib$(1)-*.dylib.dSYM
10+
CFG_JEMALLOC_CFLAGS_mips-unknown-linux-musl := -mips32r2 -msoft-float -mabi=32 $(CFLAGS)
11+
CFG_GCCISH_CFLAGS_mips-unknown-linux-musl := -Wall -g -fPIC -mips32r2 -msoft-float -mabi=32 $(CFLAGS)
12+
CFG_GCCISH_CXXFLAGS_mips-unknown-linux-musl := -fno-rtti $(CXXFLAGS)
13+
CFG_GCCISH_LINK_FLAGS_mips-unknown-linux-musl := -shared -fPIC -g -mips32r2 -msoft-float -mabi=32
14+
CFG_GCCISH_DEF_FLAG_mips-unknown-linux-musl := -Wl,--export-dynamic,--dynamic-list=
15+
CFG_LLC_FLAGS_mips-unknown-linux-musl :=
16+
CFG_INSTALL_NAME_mips-unknown-linux-musl =
17+
CFG_EXE_SUFFIX_mips-unknown-linux-musl =
18+
CFG_WINDOWSY_mips-unknown-linux-musl :=
19+
CFG_UNIXY_mips-unknown-linux-musl := 1
20+
CFG_LDPATH_mips-unknown-linux-musl :=
21+
CFG_RUN_mips-unknown-linux-musl=
22+
CFG_RUN_TARG_mips-unknown-linux-musl=
23+
RUSTC_FLAGS_mips-unknown-linux-musl :=
24+
CFG_GNU_TRIPLE_mips-unknown-linux-musl := mips-unknown-linux-musl
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# mipsel-unknown-linux-musl configuration
2+
CC_mipsel-unknown-linux-musl=mipsel-linux-musl-gcc
3+
CXX_mipsel-unknown-linux-musl=mipsel-linux-musl-g++
4+
CPP_mipsel-unknown-linux-musl=mipsel-linux-musl-gcc
5+
AR_mipsel-unknown-linux-musl=mipsel-linux-musl-ar
6+
CFG_LIB_NAME_mipsel-unknown-linux-musl=lib$(1).so
7+
CFG_STATIC_LIB_NAME_mipsel-unknown-linux-musl=lib$(1).a
8+
CFG_LIB_GLOB_mipsel-unknown-linux-musl=lib$(1)-*.so
9+
CFG_LIB_DSYM_GLOB_mipsel-unknown-linux-musl=lib$(1)-*.dylib.dSYM
10+
CFG_JEMALLOC_CFLAGS_mipsel-unknown-linux-musl := -mips32 -mabi=32 $(CFLAGS)
11+
CFG_GCCISH_CFLAGS_mipsel-unknown-linux-musl := -Wall -g -fPIC -mips32 -mabi=32 $(CFLAGS)
12+
CFG_GCCISH_CXXFLAGS_mipsel-unknown-linux-musl := -fno-rtti $(CXXFLAGS)
13+
CFG_GCCISH_LINK_FLAGS_mipsel-unknown-linux-musl := -shared -fPIC -g -mips32
14+
CFG_GCCISH_DEF_FLAG_mipsel-unknown-linux-musl := -Wl,--export-dynamic,--dynamic-list=
15+
CFG_LLC_FLAGS_mipsel-unknown-linux-musl :=
16+
CFG_INSTALL_NAME_mipsel-unknown-linux-musl =
17+
CFG_EXE_SUFFIX_mipsel-unknown-linux-musl :=
18+
CFG_WINDOWSY_mipsel-unknown-linux-musl :=
19+
CFG_UNIXY_mipsel-unknown-linux-musl := 1
20+
CFG_LDPATH_mipsel-unknown-linux-musl :=
21+
CFG_RUN_mipsel-unknown-linux-musl=
22+
CFG_RUN_TARG_mipsel-unknown-linux-musl=
23+
RUSTC_FLAGS_mipsel-unknown-linux-musl :=
24+
CFG_GNU_TRIPLE_mipsel-unknown-linux-musl := mipsel-unknown-linux-musl

branches/stable/mk/cfg/powerpc64-unknown-linux-gnu.mk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# powerpc64-unknown-linux-gnu configuration
2-
CROSS_PREFIX_powerpc64-unknown-linux-gnu=powerpc64-linux-gnu-
2+
CROSS_PREFIX_powerpc64-unknown-linux-gnu=powerpc-linux-gnu-
33
CC_powerpc64-unknown-linux-gnu=$(CC)
44
CXX_powerpc64-unknown-linux-gnu=$(CXX)
55
CPP_powerpc64-unknown-linux-gnu=$(CPP)
@@ -8,6 +8,7 @@ CFG_LIB_NAME_powerpc64-unknown-linux-gnu=lib$(1).so
88
CFG_STATIC_LIB_NAME_powerpc64-unknown-linux-gnu=lib$(1).a
99
CFG_LIB_GLOB_powerpc64-unknown-linux-gnu=lib$(1)-*.so
1010
CFG_LIB_DSYM_GLOB_powerpc64-unknown-linux-gnu=lib$(1)-*.dylib.dSYM
11+
CFG_JEMALLOC_CFLAGS_powerpc64-unknown-linux-gnu := -m64
1112
CFG_CFLAGS_powerpc64-unknown-linux-gnu := -m64 $(CFLAGS)
1213
CFG_GCCISH_CFLAGS_powerpc64-unknown-linux-gnu := -Wall -Werror -g -fPIC -m64 $(CFLAGS)
1314
CFG_GCCISH_CXXFLAGS_powerpc64-unknown-linux-gnu := -fno-rtti $(CXXFLAGS)

0 commit comments

Comments
 (0)