Skip to content

Commit b52dd43

Browse files
committed
---
yaml --- r: 274346 b: refs/heads/stable c: 33b73e9 h: refs/heads/master
1 parent 92da98c commit b52dd43

File tree

599 files changed

+18268
-11774
lines changed

Some content is hidden

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

599 files changed

+18268
-11774
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: 88d5bfd65d63364d688897e322fd6dc75fec0bb6
32+
refs/heads/stable: 33b73e9643fdf7b5d3be47d92e996ab04d6212e9
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/COPYRIGHT

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ terms.
77
Longer version:
88

99
The Rust Project is copyright 2016, The Rust Project
10-
Developers (given in the file AUTHORS.txt).
10+
Developers.
1111

1212
Licensed under the Apache License, Version 2.0
1313
<LICENSE-APACHE or

branches/stable/Makefile.in

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -220,19 +220,12 @@ endif
220220
# The test suite
221221
ifneq ($(strip $(findstring check,$(MAKECMDGOALS)) \
222222
$(findstring test,$(MAKECMDGOALS)) \
223-
$(findstring perf,$(MAKECMDGOALS)) \
224223
$(findstring tidy,$(MAKECMDGOALS))),)
225224
CFG_INFO := $(info cfg: including test rules)
226225
include $(CFG_SRC_DIR)mk/tests.mk
227226
include $(CFG_SRC_DIR)mk/grammar.mk
228227
endif
229228

230-
# Performance and benchmarking
231-
ifneq ($(findstring perf,$(MAKECMDGOALS)),)
232-
CFG_INFO := $(info cfg: including perf rules)
233-
include $(CFG_SRC_DIR)mk/perf.mk
234-
endif
235-
236229
# Copy all the distributables to another directory for binary install
237230
ifneq ($(strip $(findstring prepare,$(MAKECMDGOALS)) \
238231
$(findstring dist,$(MAKECMDGOALS)) \

branches/stable/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ build.
7878
Download [MinGW from
7979
here](http://mingw-w64.org/doku.php/download/mingw-builds), and choose the
8080
`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,
81+
add its `bin` directory to your `PATH`. This is due to [#28260](https://github.com/rust-lang/rust/issues/28260), in the future,
8282
installing from pacman should be just fine.
8383
8484
```

branches/stable/configure

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -499,13 +499,18 @@ case $CFG_CPUTYPE in
499499
CFG_CPUTYPE=aarch64
500500
;;
501501

502-
# At some point, when ppc64[le] support happens, this will need to do
503-
# something clever. For now it's safe to assume that we're only ever
504-
# interested in building 32 bit.
505-
powerpc | ppc | ppc64)
502+
powerpc | ppc)
506503
CFG_CPUTYPE=powerpc
507504
;;
508505

506+
powerpc64 | ppc64)
507+
CFG_CPUTYPE=powerpc64
508+
;;
509+
510+
powerpc64le | ppc64le)
511+
CFG_CPUTYPE=powerpc64le
512+
;;
513+
509514
x86_64 | x86-64 | x64 | amd64)
510515
CFG_CPUTYPE=x86_64
511516
;;
@@ -545,7 +550,7 @@ CFG_SELF="$0"
545550
CFG_CONFIGURE_ARGS="$@"
546551

547552

548-
case "${CFG_SRC_DIR}" in
553+
case "${CFG_SRC_DIR}" in
549554
*\ * )
550555
err "The path to the rust source directory contains spaces, which is not supported"
551556
;;
@@ -887,6 +892,13 @@ then
887892
CFG_DISABLE_JEMALLOC=1
888893
fi
889894

895+
if [ $CFG_OSTYPE = pc-windows-gnu ]
896+
then
897+
# FIXME(#31030) - there's not a great reason to disable jemalloc here
898+
step_msg "on Windows, disabling jemalloc"
899+
CFG_DISABLE_JEMALLOC=1
900+
fi
901+
890902
# OS X 10.9, gcc is actually clang. This can cause some confusion in the build
891903
# system, so if we find that gcc is clang, we should just use clang directly.
892904
if [ $CFG_OSTYPE = apple-darwin -a -z "$CFG_ENABLE_CLANG" ]
@@ -1030,7 +1042,7 @@ then
10301042
if [ -n "$CFG_OSX_CLANG_VERSION" ]
10311043
then
10321044
case $CFG_OSX_CLANG_VERSION in
1033-
(7.0*)
1045+
(7.0* | 7.1* | 7.2*)
10341046
step_msg "found ok version of APPLE CLANG: $CFG_OSX_CLANG_VERSION"
10351047
;;
10361048
(*)
@@ -1039,7 +1051,7 @@ then
10391051
esac
10401052
else
10411053
case $CFG_CLANG_VERSION in
1042-
(3.2* | 3.3* | 3.4* | 3.5* | 3.6* | 3.7* | 3.8*)
1054+
(3.2* | 3.3* | 3.4* | 3.5* | 3.6* | 3.7* | 3.8* | 3.9*)
10431055
step_msg "found ok version of CLANG: $CFG_CLANG_VERSION"
10441056
;;
10451057
(*)
@@ -1349,16 +1361,22 @@ for h in $CFG_HOST
13491361
do
13501362
for t in $CFG_TARGET
13511363
do
1364+
# host bin dir stage0
1365+
make_dir $h/stage0/bin
1366+
13521367
# host lib dir stage0
13531368
make_dir $h/stage0/lib
13541369

1370+
# host test dir stage0
1371+
make_dir $h/stage0/test
1372+
13551373
# target bin dir stage0
13561374
make_dir $h/stage0/lib/rustlib/$t/bin
13571375

13581376
# target lib dir stage0
13591377
make_dir $h/stage0/lib/rustlib/$t/lib
13601378

1361-
for i in 0 1 2 3
1379+
for i in 1 2 3
13621380
do
13631381
# host bin dir
13641382
make_dir $h/stage$i/bin
@@ -1391,6 +1409,7 @@ do
13911409
make_dir $h/test/debuginfo-gdb
13921410
make_dir $h/test/debuginfo-lldb
13931411
make_dir $h/test/codegen
1412+
make_dir $h/test/codegen-units
13941413
make_dir $h/test/rustdoc
13951414
done
13961415

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=armv7-unknown-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)
12+
CFG_GCCISH_CFLAGS_armv7-unknown-linux-gnueabihf := -Wall -g -fPIC -D__arm__ $(CFLAGS)
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
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# powerpc64-unknown-linux-gnu configuration
2+
CROSS_PREFIX_powerpc64-unknown-linux-gnu=powerpc64-linux-gnu-
3+
CC_powerpc64-unknown-linux-gnu=$(CC)
4+
CXX_powerpc64-unknown-linux-gnu=$(CXX)
5+
CPP_powerpc64-unknown-linux-gnu=$(CPP)
6+
AR_powerpc64-unknown-linux-gnu=$(AR)
7+
CFG_LIB_NAME_powerpc64-unknown-linux-gnu=lib$(1).so
8+
CFG_STATIC_LIB_NAME_powerpc64-unknown-linux-gnu=lib$(1).a
9+
CFG_LIB_GLOB_powerpc64-unknown-linux-gnu=lib$(1)-*.so
10+
CFG_LIB_DSYM_GLOB_powerpc64-unknown-linux-gnu=lib$(1)-*.dylib.dSYM
11+
CFG_CFLAGS_powerpc64-unknown-linux-gnu := -m64 $(CFLAGS)
12+
CFG_GCCISH_CFLAGS_powerpc64-unknown-linux-gnu := -Wall -Werror -g -fPIC -m64 $(CFLAGS)
13+
CFG_GCCISH_CXXFLAGS_powerpc64-unknown-linux-gnu := -fno-rtti $(CXXFLAGS)
14+
CFG_GCCISH_LINK_FLAGS_powerpc64-unknown-linux-gnu := -shared -fPIC -ldl -pthread -lrt -g -m64
15+
CFG_GCCISH_DEF_FLAG_powerpc64-unknown-linux-gnu := -Wl,--export-dynamic,--dynamic-list=
16+
CFG_LLC_FLAGS_powerpc64-unknown-linux-gnu :=
17+
CFG_INSTALL_NAME_powerpc64-unknown-linux-gnu =
18+
CFG_EXE_SUFFIX_powerpc64-unknown-linux-gnu =
19+
CFG_WINDOWSY_powerpc64-unknown-linux-gnu :=
20+
CFG_UNIXY_powerpc64-unknown-linux-gnu := 1
21+
CFG_LDPATH_powerpc64-unknown-linux-gnu :=
22+
CFG_RUN_powerpc64-unknown-linux-gnu=$(2)
23+
CFG_RUN_TARG_powerpc64-unknown-linux-gnu=$(call CFG_RUN_powerpc64-unknown-linux-gnu,,$(2))
24+
CFG_GNU_TRIPLE_powerpc64-unknown-linux-gnu := powerpc64-unknown-linux-gnu
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# powerpc64le-unknown-linux-gnu configuration
2+
CROSS_PREFIX_powerpc64le-unknown-linux-gnu=powerpc64le-linux-gnu-
3+
CC_powerpc64le-unknown-linux-gnu=$(CC)
4+
CXX_powerpc64le-unknown-linux-gnu=$(CXX)
5+
CPP_powerpc64le-unknown-linux-gnu=$(CPP)
6+
AR_powerpc64le-unknown-linux-gnu=$(AR)
7+
CFG_LIB_NAME_powerpc64le-unknown-linux-gnu=lib$(1).so
8+
CFG_STATIC_LIB_NAME_powerpc64le-unknown-linux-gnu=lib$(1).a
9+
CFG_LIB_GLOB_powerpc64le-unknown-linux-gnu=lib$(1)-*.so
10+
CFG_LIB_DSYM_GLOB_powerpc64le-unknown-linux-gnu=lib$(1)-*.dylib.dSYM
11+
CFG_CFLAGS_powerpc64le-unknown-linux-gnu := -m64 $(CFLAGS)
12+
CFG_GCCISH_CFLAGS_powerpc64le-unknown-linux-gnu := -Wall -Werror -g -fPIC -m64 $(CFLAGS)
13+
CFG_GCCISH_CXXFLAGS_powerpc64le-unknown-linux-gnu := -fno-rtti $(CXXFLAGS)
14+
CFG_GCCISH_LINK_FLAGS_powerpc64le-unknown-linux-gnu := -shared -fPIC -ldl -pthread -lrt -g -m64
15+
CFG_GCCISH_DEF_FLAG_powerpc64le-unknown-linux-gnu := -Wl,--export-dynamic,--dynamic-list=
16+
CFG_LLC_FLAGS_powerpc64le-unknown-linux-gnu :=
17+
CFG_INSTALL_NAME_powerpc64le-unknown-linux-gnu =
18+
CFG_EXE_SUFFIX_powerpc64le-unknown-linux-gnu =
19+
CFG_WINDOWSY_powerpc64le-unknown-linux-gnu :=
20+
CFG_UNIXY_powerpc64le-unknown-linux-gnu := 1
21+
CFG_LDPATH_powerpc64le-unknown-linux-gnu :=
22+
CFG_RUN_powerpc64le-unknown-linux-gnu=$(2)
23+
CFG_RUN_TARG_powerpc64le-unknown-linux-gnu=$(call CFG_RUN_powerpc64le-unknown-linux-gnu,,$(2))
24+
CFG_GNU_TRIPLE_powerpc64le-unknown-linux-gnu := powerpc64le-unknown-linux-gnu

branches/stable/mk/crates.mk

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ TARGET_CRATES := libc std flate arena term \
5757
RUSTC_CRATES := rustc rustc_typeck rustc_mir rustc_borrowck rustc_resolve rustc_driver \
5858
rustc_trans rustc_back rustc_llvm rustc_privacy rustc_lint \
5959
rustc_data_structures rustc_front rustc_platform_intrinsics \
60-
rustc_plugin rustc_metadata
60+
rustc_plugin rustc_metadata rustc_passes
6161
HOST_CRATES := syntax syntax_ext $(RUSTC_CRATES) rustdoc fmt_macros
6262
TOOLS := compiletest rustdoc rustc rustbook error-index-generator
6363

@@ -97,11 +97,12 @@ DEPS_rustc_data_structures := std log serialize
9797
DEPS_rustc_driver := arena flate getopts graphviz libc rustc rustc_back rustc_borrowck \
9898
rustc_typeck rustc_mir rustc_resolve log syntax serialize rustc_llvm \
9999
rustc_trans rustc_privacy rustc_lint rustc_front rustc_plugin \
100-
rustc_metadata syntax_ext
100+
rustc_metadata syntax_ext rustc_passes
101101
DEPS_rustc_front := std syntax log serialize
102102
DEPS_rustc_lint := rustc log syntax
103103
DEPS_rustc_llvm := native:rustllvm libc std rustc_bitflags
104104
DEPS_rustc_metadata := rustc rustc_front syntax rbml
105+
DEPS_rustc_passes := syntax rustc core rustc_front
105106
DEPS_rustc_mir := rustc rustc_front syntax
106107
DEPS_rustc_resolve := arena rustc rustc_front log syntax
107108
DEPS_rustc_platform_intrinsics := rustc rustc_llvm

branches/stable/mk/main.mk

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
######################################################################
1414

1515
# The version number
16-
CFG_RELEASE_NUM=1.7.0
16+
CFG_RELEASE_NUM=1.8.0
1717

1818
# An optional number to put after the label, e.g. '.2' -> '-beta.2'
1919
# NB Make sure it starts with a dot to conform to semver pre-release
@@ -522,14 +522,6 @@ STAGE$(1)_T_$(2)_H_$(3) := \
522522
$$(CFG_RUSTC_FLAGS) $$(EXTRAFLAGS_STAGE$(1)) --target=$(2)) \
523523
$$(RUSTC_FLAGS_$(2))
524524

525-
PERF_STAGE$(1)_T_$(2)_H_$(3) := \
526-
$$(Q)$$(call CFG_RUN_TARG_$(3),$(1), \
527-
$$(CFG_PERF_TOOL) \
528-
$$(HBIN$(1)_H_$(3))/rustc$$(X_$(3)) \
529-
--cfg $$(CFGFLAG$(1)_T_$(2)_H_$(3)) \
530-
$$(CFG_RUSTC_FLAGS) $$(EXTRAFLAGS_STAGE$(1)) --target=$(2)) \
531-
$$(RUSTC_FLAGS_$(2))
532-
533525
endef
534526

535527
$(foreach build,$(CFG_HOST), \

branches/stable/mk/perf.mk

Lines changed: 0 additions & 25 deletions
This file was deleted.

branches/stable/mk/platform.mk

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -77,23 +77,6 @@ define DEF_GOOD_VALGRIND
7777
endef
7878
$(foreach t,$(CFG_TARGET),$(eval $(call DEF_GOOD_VALGRIND,$(t))))
7979

80-
ifneq ($(findstring linux,$(CFG_OSTYPE)),)
81-
ifdef CFG_PERF
82-
ifneq ($(CFG_PERF_WITH_LOGFD),)
83-
CFG_PERF_TOOL := $(CFG_PERF) stat -r 3 --log-fd 2
84-
else
85-
CFG_PERF_TOOL := $(CFG_PERF) stat -r 3
86-
endif
87-
else
88-
ifdef CFG_VALGRIND
89-
CFG_PERF_TOOL := \
90-
$(CFG_VALGRIND) --tool=cachegrind --cache-sim=yes --branch-sim=yes
91-
else
92-
CFG_PERF_TOOL := /usr/bin/time --verbose
93-
endif
94-
endif
95-
endif
96-
9780
AR := ar
9881

9982
define SET_FROM_CFG

0 commit comments

Comments
 (0)