Skip to content

Commit 20c1091

Browse files
committed
Merge branch 'master' into 35123-map3
2 parents da3c6b7 + a09cb57 commit 20c1091

File tree

757 files changed

+23645
-20122
lines changed

Some content is hidden

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

757 files changed

+23645
-20122
lines changed

.travis.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ before_install:
1515
script:
1616
- docker run -v `pwd`:/build rust
1717
sh -c "
18-
./configure --llvm-root=/usr/lib/llvm-3.7 &&
18+
./configure --enable-rustbuild --llvm-root=/usr/lib/llvm-3.7 &&
1919
make tidy &&
20-
make check-notidy -j4
20+
make check -j4
2121
"
2222
2323
# Real testing happens on http://buildbot.rust-lang.org/

CONTRIBUTING.md

+13
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,10 @@ Some common make targets are:
151151
command above as we only build the stage1 compiler, not the entire thing).
152152
You can also leave off the `-rpass` to run all stage1 test types.
153153
- `make check-stage1-coretest` - Run stage1 tests in `libcore`.
154+
- `make tidy` - Check that the source code is in compliance with Rust's style
155+
guidelines. There is no official document describing Rust's full guidelines
156+
as of yet, but basic rules like 4 spaces for indentation and no more than 99
157+
characters in a single line should be kept in mind when writing code.
154158

155159
## Pull Requests
156160

@@ -177,6 +181,15 @@ you’re adding something to the standard library, try
177181

178182
This will not rebuild the compiler, but will run the tests.
179183

184+
Please make sure your pull request is in compliance with Rust's style
185+
guidelines by running
186+
187+
$ make tidy
188+
189+
Make this check before every pull request (and every new commit in a pull
190+
request) ; you can add [git hooks](https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks)
191+
before every push to make sure you never forget to make this check.
192+
180193
All pull requests are reviewed by another person. We have a bot,
181194
@rust-highfive, that will automatically assign a random person to review your
182195
request.

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ fetch snapshots, and an OS that can execute the available snapshot binaries.
170170
171171
Snapshot binaries are currently built and tested on several platforms:
172172
173-
| Platform \ Architecture | x86 | x86_64 |
173+
| Platform / Architecture | x86 | x86_64 |
174174
|--------------------------------|-----|--------|
175175
| Windows (7, 8, Server 2008 R2) | ✓ | ✓ |
176176
| Linux (2.6.18 or later) | ✓ | ✓ |

configure

+20-6
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,13 @@ abs_path() {
360360
(unset CDPATH && cd "$_path" > /dev/null && pwd)
361361
}
362362

363+
HELP=0
364+
for arg; do
365+
case "$arg" in
366+
--help) HELP=1;;
367+
esac
368+
done
369+
363370
msg "looking for configure programs"
364371
need_cmd cmp
365372
need_cmd mkdir
@@ -517,6 +524,10 @@ case $CFG_CPUTYPE in
517524
CFG_CPUTYPE=powerpc64le
518525
;;
519526

527+
s390x)
528+
CFG_CPUTYPE=s390x
529+
;;
530+
520531
x86_64 | x86-64 | x64 | amd64)
521532
CFG_CPUTYPE=x86_64
522533
;;
@@ -566,11 +577,8 @@ esac
566577

567578

568579
OPTIONS=""
569-
HELP=0
570-
if [ "$1" = "--help" ]
580+
if [ "$HELP" -eq 1 ]
571581
then
572-
HELP=1
573-
shift
574582
echo
575583
echo "Usage: $CFG_SELF [options]"
576584
echo
@@ -609,7 +617,6 @@ opt dist-host-only 0 "only install bins for the host architecture"
609617
opt inject-std-version 1 "inject the current compiler version of libstd into programs"
610618
opt llvm-version-check 1 "check if the LLVM version is supported, build anyway"
611619
opt rustbuild 0 "use the rust and cargo based build system"
612-
opt orbit 1 "get MIR where it belongs - everywhere; most importantly, in orbit"
613620
opt codegen-tests 1 "run the src/test/codegen tests"
614621
opt option-checking 1 "complain about unrecognized options in this configure script"
615622
opt ninja 0 "build LLVM using the Ninja generator (for MSVC, requires building in the correct environment)"
@@ -630,6 +637,7 @@ valopt datadir "${CFG_PREFIX}/share" "install data"
630637
valopt infodir "${CFG_PREFIX}/share/info" "install additional info"
631638
valopt llvm-root "" "set LLVM root"
632639
valopt python "" "set path to python"
640+
valopt nodejs "" "set path to nodejs"
633641
valopt jemalloc-root "" "set directory where libjemalloc_pic.a is located"
634642
valopt build "${DEFAULT_BUILD}" "GNUs ./configure syntax LLVM build triple"
635643
valopt android-cross-path "" "Android NDK standalone path (deprecated)"
@@ -668,6 +676,7 @@ valopt_nosave local-rust-root "/usr/local" "set prefix for local rust binary"
668676
valopt_nosave host "${CFG_BUILD}" "GNUs ./configure syntax LLVM host triples"
669677
valopt_nosave target "${CFG_HOST}" "GNUs ./configure syntax LLVM target triples"
670678
valopt_nosave mandir "${CFG_PREFIX}/share/man" "install man pages in PATH"
679+
valopt_nosave docdir "${CFG_PREFIX}/share/doc/rust" "install man pages in PATH"
671680

672681
# On Windows this determines root of the subtree for target libraries.
673682
# Host runtime libs always go to 'bin'.
@@ -745,6 +754,9 @@ if [ $(echo $python_version | grep -c '^Python 2\.7') -ne 1 ]; then
745754
err "Found $python_version, but Python 2.7 is required"
746755
fi
747756

757+
# Checking for node, but not required
758+
probe CFG_NODEJS nodejs node
759+
748760
# If we have no git directory then we are probably a tarball distribution
749761
# and shouldn't attempt to load submodules
750762
if [ ! -e ${CFG_SRC_DIR}.git ]
@@ -897,7 +909,7 @@ then
897909
fi
898910

899911
CMD="${CFG_LOCAL_RUST_ROOT}/bin/rustc${BIN_SUF}"
900-
LRV=`$CMD --version`
912+
LRV=`LD_LIBRARY_PATH=${CFG_LOCAL_RUST_ROOT}/lib $CMD --version`
901913
if [ $? -ne 0 ]
902914
then
903915
step_msg "failure while running $CMD --version"
@@ -1113,6 +1125,7 @@ putvar CFG_STDCPP_NAME
11131125
# a little post-processing of various config values
11141126
CFG_PREFIX=${CFG_PREFIX%/}
11151127
CFG_MANDIR=${CFG_MANDIR%/}
1128+
CFG_DOCDIR=${CFG_DOCDIR%/}
11161129
CFG_HOST="$(echo $CFG_HOST | tr ',' ' ')"
11171130
CFG_TARGET="$(echo $CFG_TARGET | tr ',' ' ')"
11181131
CFG_SUPPORTED_TARGET=""
@@ -1794,6 +1807,7 @@ putvar CFG_ARMV7_LINUX_ANDROIDEABI_NDK
17941807
putvar CFG_I686_LINUX_ANDROID_NDK
17951808
putvar CFG_NACL_CROSS_PATH
17961809
putvar CFG_MANDIR
1810+
putvar CFG_DOCDIR
17971811
putvar CFG_USING_LIBCPP
17981812

17991813
# Avoid spurious warnings from clang by feeding it original source on
+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# rustbuild-only target
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# rustbuild-only target

mk/cfg/s390x-unknown-linux-gnu.mk

+24-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,24 @@
1-
# rustbuild-only target
1+
# s390x-unknown-linux-gnu configuration
2+
CROSS_PREFIX_s390x-unknown-linux-gnu=s390x-linux-gnu-
3+
CC_s390x-unknown-linux-gnu=$(CC)
4+
CXX_s390x-unknown-linux-gnu=$(CXX)
5+
CPP_s390x-unknown-linux-gnu=$(CPP)
6+
AR_s390x-unknown-linux-gnu=$(AR)
7+
CFG_LIB_NAME_s390x-unknown-linux-gnu=lib$(1).so
8+
CFG_STATIC_LIB_NAME_s390x-unknown-linux-gnu=lib$(1).a
9+
CFG_LIB_GLOB_s390x-unknown-linux-gnu=lib$(1)-*.so
10+
CFG_LIB_DSYM_GLOB_s390x-unknown-linux-gnu=lib$(1)-*.dylib.dSYM
11+
CFG_CFLAGS_s390x-unknown-linux-gnu := -m64 $(CFLAGS)
12+
CFG_GCCISH_CFLAGS_s390x-unknown-linux-gnu := -g -fPIC -m64 $(CFLAGS)
13+
CFG_GCCISH_CXXFLAGS_s390x-unknown-linux-gnu := -fno-rtti $(CXXFLAGS)
14+
CFG_GCCISH_LINK_FLAGS_s390x-unknown-linux-gnu := -shared -fPIC -ldl -pthread -lrt -g -m64
15+
CFG_GCCISH_DEF_FLAG_s390x-unknown-linux-gnu := -Wl,--export-dynamic,--dynamic-list=
16+
CFG_LLC_FLAGS_s390x-unknown-linux-gnu :=
17+
CFG_INSTALL_NAME_s390x-unknown-linux-gnu =
18+
CFG_EXE_SUFFIX_s390x-unknown-linux-gnu =
19+
CFG_WINDOWSY_s390x-unknown-linux-gnu :=
20+
CFG_UNIXY_s390x-unknown-linux-gnu := 1
21+
CFG_LDPATH_s390x-unknown-linux-gnu :=
22+
CFG_RUN_s390x-unknown-linux-gnu=$(2)
23+
CFG_RUN_TARG_s390x-unknown-linux-gnu=$(call CFG_RUN_s390x-unknown-linux-gnu,,$(2))
24+
CFG_GNU_TRIPLE_s390x-unknown-linux-gnu := s390x-unknown-linux-gnu

mk/clean.mk

-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ define CLEAN_TARGET_STAGE_N
102102
clean$(1)_T_$(2)_H_$(3): \
103103
$$(foreach crate,$$(CRATES),clean$(1)_T_$(2)_H_$(3)-lib-$$(crate)) \
104104
$$(foreach tool,$$(TOOLS) $$(DEBUGGER_BIN_SCRIPTS_ALL),clean$(1)_T_$(2)_H_$(3)-tool-$$(tool))
105-
$$(Q)rm -f $$(TLIB$(1)_T_$(2)_H_$(3))/libcompiler-rt.a
106105
$(Q)rm -f $$(TLIB$(1)_T_$(2)_H_$(3))/librun_pass_stage* # For unix
107106
$(Q)rm -f $$(TLIB$(1)_T_$(2)_H_$(3))/run_pass_stage* # For windows
108107

mk/crates.mk

+15-10
Original file line numberDiff line numberDiff line change
@@ -51,20 +51,21 @@
5151

5252
TARGET_CRATES := libc std term \
5353
getopts collections test rand \
54-
core alloc \
54+
compiler_builtins core alloc \
5555
rustc_unicode rustc_bitflags \
5656
alloc_system alloc_jemalloc \
5757
panic_abort panic_unwind unwind
5858
RUSTC_CRATES := rustc rustc_typeck rustc_mir rustc_borrowck rustc_resolve rustc_driver \
5959
rustc_trans rustc_back rustc_llvm rustc_privacy rustc_lint \
6060
rustc_data_structures rustc_platform_intrinsics rustc_errors \
6161
rustc_plugin rustc_metadata rustc_passes rustc_save_analysis \
62-
rustc_const_eval rustc_const_math rustc_incremental
62+
rustc_const_eval rustc_const_math rustc_incremental rustc_macro
6363
HOST_CRATES := syntax syntax_ext proc_macro syntax_pos $(RUSTC_CRATES) rustdoc fmt_macros \
64-
flate arena graphviz rbml log serialize
64+
flate arena graphviz log serialize
6565
TOOLS := compiletest rustdoc rustc rustbook error_index_generator
6666

6767
DEPS_core :=
68+
DEPS_compiler_builtins := core
6869
DEPS_alloc := core libc alloc_system
6970
DEPS_alloc_system := core libc
7071
DEPS_alloc_jemalloc := core libc native:jemalloc
@@ -77,12 +78,14 @@ DEPS_panic_abort := libc alloc
7778
DEPS_panic_unwind := libc alloc unwind
7879
DEPS_unwind := libc
7980

81+
RUSTFLAGS_compiler_builtins := -lstatic=compiler-rt
82+
8083
# FIXME(stage0): change this to just `RUSTFLAGS_panic_abort := ...`
8184
RUSTFLAGS1_panic_abort := -C panic=abort
8285
RUSTFLAGS2_panic_abort := -C panic=abort
8386
RUSTFLAGS3_panic_abort := -C panic=abort
8487

85-
DEPS_std := core libc rand alloc collections rustc_unicode \
88+
DEPS_std := core libc rand alloc collections compiler_builtins rustc_unicode \
8689
native:backtrace \
8790
alloc_system panic_abort panic_unwind unwind
8891
DEPS_arena := std
@@ -93,21 +96,20 @@ DEPS_getopts := std
9396
DEPS_graphviz := std
9497
DEPS_log := std
9598
DEPS_num := std
96-
DEPS_rbml := std log serialize
9799
DEPS_serialize := std log
98100
DEPS_term := std
99101
DEPS_test := std getopts term native:rust_test_helpers
100102

101103
DEPS_syntax := std term serialize log arena libc rustc_bitflags rustc_unicode rustc_errors syntax_pos
102-
DEPS_syntax_ext := syntax syntax_pos rustc_errors fmt_macros
104+
DEPS_syntax_ext := syntax syntax_pos rustc_errors fmt_macros rustc_macro
103105
DEPS_proc_macro := syntax syntax_pos rustc_plugin log
104106
DEPS_syntax_pos := serialize
105107

106108
DEPS_rustc_const_math := std syntax log serialize
107109
DEPS_rustc_const_eval := rustc_const_math rustc syntax log serialize \
108110
rustc_back graphviz syntax_pos
109111

110-
DEPS_rustc := syntax fmt_macros flate arena serialize getopts rbml \
112+
DEPS_rustc := syntax fmt_macros flate arena serialize getopts \
111113
log graphviz rustc_llvm rustc_back rustc_data_structures\
112114
rustc_const_math syntax_pos rustc_errors
113115
DEPS_rustc_back := std syntax flate log libc
@@ -118,11 +120,13 @@ DEPS_rustc_driver := arena flate getopts graphviz libc rustc rustc_back rustc_bo
118120
rustc_trans rustc_privacy rustc_lint rustc_plugin \
119121
rustc_metadata syntax_ext proc_macro \
120122
rustc_passes rustc_save_analysis rustc_const_eval \
121-
rustc_incremental syntax_pos rustc_errors
123+
rustc_incremental syntax_pos rustc_errors rustc_macro
122124
DEPS_rustc_errors := log libc serialize syntax_pos
123125
DEPS_rustc_lint := rustc log syntax syntax_pos rustc_const_eval
124126
DEPS_rustc_llvm := native:rustllvm libc std rustc_bitflags
125-
DEPS_rustc_metadata := rustc syntax syntax_pos rustc_errors rbml rustc_const_math
127+
DEPS_rustc_macro := std syntax
128+
DEPS_rustc_metadata := rustc syntax syntax_pos rustc_errors rustc_const_math \
129+
rustc_macro syntax_ext
126130
DEPS_rustc_passes := syntax syntax_pos rustc core rustc_const_eval rustc_errors
127131
DEPS_rustc_mir := rustc syntax syntax_pos rustc_const_math rustc_const_eval rustc_bitflags
128132
DEPS_rustc_resolve := arena rustc log syntax syntax_pos rustc_errors
@@ -132,7 +136,7 @@ DEPS_rustc_privacy := rustc log syntax syntax_pos
132136
DEPS_rustc_trans := arena flate getopts graphviz libc rustc rustc_back \
133137
log syntax serialize rustc_llvm rustc_platform_intrinsics \
134138
rustc_const_math rustc_const_eval rustc_incremental rustc_errors syntax_pos
135-
DEPS_rustc_incremental := rbml rustc syntax_pos serialize rustc_data_structures
139+
DEPS_rustc_incremental := rustc syntax_pos serialize rustc_data_structures
136140
DEPS_rustc_save_analysis := rustc log syntax syntax_pos serialize
137141
DEPS_rustc_typeck := rustc syntax syntax_pos rustc_platform_intrinsics rustc_const_math \
138142
rustc_const_eval rustc_errors
@@ -151,6 +155,7 @@ TOOL_SOURCE_rustc := $(S)src/driver/driver.rs
151155
TOOL_SOURCE_rustbook := $(S)src/tools/rustbook/main.rs
152156
TOOL_SOURCE_error_index_generator := $(S)src/tools/error_index_generator/main.rs
153157

158+
ONLY_RLIB_compiler_builtins := 1
154159
ONLY_RLIB_core := 1
155160
ONLY_RLIB_libc := 1
156161
ONLY_RLIB_alloc := 1

mk/dist.mk

+1
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ tmp/dist/$$(SRC_PKG_NAME)-image: $(PKG_FILES)
7676
@$(call E, making src image)
7777
$(Q)rm -Rf tmp/dist/$(SRC_PKG_NAME)-image
7878
$(Q)mkdir -p tmp/dist/$(SRC_PKG_NAME)-image/lib/rustlib/src/rust
79+
$(Q)echo "$(CFG_VERSION)" > tmp/dist/$(SRC_PKG_NAME)-image/lib/rustlib/src/rust/version
7980
$(Q)tar \
8081
-C $(S) \
8182
-f - \

mk/install.mk

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ RUN_INSTALLER = cd tmp/empty_dir && \
1212
sh ../../tmp/dist/$(1)/install.sh \
1313
--prefix="$(DESTDIR)$(CFG_PREFIX)" \
1414
--libdir="$(DESTDIR)$(CFG_LIBDIR)" \
15-
--mandir="$(DESTDIR)$(CFG_MANDIR)"
15+
--mandir="$(DESTDIR)$(CFG_MANDIR)" \
16+
--docdir="$(DESTDIR)$(CFG_DOCDIR)"
1617

1718
install:
1819
ifeq (root user, $(USER) $(patsubst %,user,$(SUDO_USER)))

mk/main.mk

+7-2
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,7 @@ LLVM_AS_$(1)=$$(CFG_LLVM_INST_DIR_$(1))/bin/llvm-as$$(X_$(1))
348348
LLC_$(1)=$$(CFG_LLVM_INST_DIR_$(1))/bin/llc$$(X_$(1))
349349

350350
LLVM_ALL_COMPONENTS_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --components)
351+
LLVM_VERSION_$(1)=$$(shell "$$(LLVM_CONFIG_$(1))" --version)
351352

352353
endef
353354

@@ -454,7 +455,10 @@ endif
454455
TSREQ$(1)_T_$(2)_H_$(3) = \
455456
$$(HSREQ$(1)_H_$(3)) \
456457
$$(foreach obj,$$(REQUIRED_OBJECTS_$(2)),\
457-
$$(TLIB$(1)_T_$(2)_H_$(3))/$$(obj))
458+
$$(TLIB$(1)_T_$(2)_H_$(3))/$$(obj)) \
459+
$$(TLIB0_T_$(2)_H_$(3))/$$(call CFG_STATIC_LIB_NAME_$(2),compiler-rt)
460+
# ^ This copies `libcompiler-rt.a` to the stage0 sysroot
461+
# ^ TODO(stage0) update this to not copy `libcompiler-rt.a` to stage0
458462

459463
# Prerequisites for a working stageN compiler and libraries, for a specific
460464
# target
@@ -629,7 +633,8 @@ ALL_TARGET_RULES = $(foreach target,$(CFG_TARGET), \
629633
$(foreach host,$(CFG_HOST), \
630634
all-target-$(target)-host-$(host)))
631635

632-
all: $(ALL_TARGET_RULES) $(GENERATED) docs
636+
all-no-docs: $(ALL_TARGET_RULES) $(GENERATED)
637+
all: all-no-docs docs
633638

634639
######################################################################
635640
# Build system documentation

mk/platform.mk

-2
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,6 @@ include $(wildcard $(CFG_SRC_DIR)mk/cfg/*.mk)
102102
define ADD_INSTALLED_OBJECTS
103103
INSTALLED_OBJECTS_$(1) += $$(CFG_INSTALLED_OBJECTS_$(1))
104104
REQUIRED_OBJECTS_$(1) += $$(CFG_THIRD_PARTY_OBJECTS_$(1))
105-
INSTALLED_OBJECTS_$(1) += $$(call CFG_STATIC_LIB_NAME_$(1),compiler-rt)
106-
REQUIRED_OBJECTS_$(1) += $$(call CFG_STATIC_LIB_NAME_$(1),compiler-rt)
107105
endef
108106

109107
$(foreach target,$(CFG_TARGET), \

0 commit comments

Comments
 (0)