Skip to content

Commit ef3cfc3

Browse files
committed
---
yaml --- r: 278125 b: refs/heads/auto c: 1ec2217 h: refs/heads/master i: 278123: 264600e
1 parent 439cbe1 commit ef3cfc3

File tree

39 files changed

+873
-308
lines changed

39 files changed

+873
-308
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
88
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
99
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1010
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
11-
refs/heads/auto: 3b0e27cc74d61e229aeaf0a710d3a018f7104ffc
11+
refs/heads/auto: 1ec22171e6053c640293067418ea1901cb1c7df1
1212
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1313
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336
1414
refs/tags/0.2: 1754d02027f2924bed83b0160ee340c7f41d5ea1

branches/auto/mk/ctags.mk

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,21 @@
1515

1616
.PHONY: TAGS.emacs TAGS.vi
1717

18-
CTAGS_LOCATIONS=$(wildcard ${CFG_SRC_DIR}src/lib*)
18+
CTAGS_RUSTC_LOCATIONS=$(patsubst ${CFG_SRC_DIR}src/lib%test,, \
19+
$(wildcard ${CFG_SRC_DIR}src/lib*)) ${CFG_SRC_DIR}src/libtest
1920
CTAGS_LOCATIONS=$(patsubst ${CFG_SRC_DIR}src/librust%,, \
2021
$(patsubst ${CFG_SRC_DIR}src/lib%test,, \
2122
$(wildcard ${CFG_SRC_DIR}src/lib*))) ${CFG_SRC_DIR}src/libtest
22-
CTAGS_OPTS=--options="${CFG_SRC_DIR}src/etc/ctags.rust" --languages=Rust --recurse ${CTAGS_LOCATIONS}
23+
CTAGS_OPTS=--options="${CFG_SRC_DIR}src/etc/ctags.rust" --languages=Rust --recurse
24+
25+
TAGS.rustc.emacs:
26+
ctags -e -f $@ ${CTAGS_OPTS} ${CTAGS_RUSTC_LOCATIONS}
2327

2428
TAGS.emacs:
25-
ctags -e -f $@ ${CTAGS_OPTS}
29+
ctags -e -f $@ ${CTAGS_OPTS} ${CTAGS_LOCATIONS}
30+
31+
TAGS.rustc.vi:
32+
ctags -f $@ ${CTAGS_OPTS} ${CTAGS_RUSTC_LOCATIONS}
2633

2734
TAGS.vi:
28-
ctags -f $@ ${CTAGS_OPTS}
35+
ctags -f $@ ${CTAGS_OPTS} ${CTAGS_LOCATIONS}

branches/auto/mk/platform.mk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ ifdef CFG_CCACHE_BASEDIR
169169
export CCACHE_BASEDIR
170170
endif
171171

172-
FIND_COMPILER = $(word 1,$(1:ccache=))
172+
FIND_COMPILER = $(strip $(1:ccache=))
173173

174174
define CFG_MAKE_TOOLCHAIN
175175
# Prepend the tools with their prefix if cross compiling
@@ -187,7 +187,7 @@ define CFG_MAKE_TOOLCHAIN
187187
endif
188188
endif
189189

190-
CFG_COMPILE_C_$(1) = '$$(CC_$(1))' \
190+
CFG_COMPILE_C_$(1) = '$$(call FIND_COMPILER,$$(CC_$(1)))' \
191191
$$(CFLAGS) \
192192
$$(CFG_GCCISH_CFLAGS) \
193193
$$(CFG_GCCISH_CFLAGS_$(1)) \
@@ -198,7 +198,7 @@ define CFG_MAKE_TOOLCHAIN
198198
$$(CFG_GCCISH_LINK_FLAGS_$(1)) \
199199
$$(CFG_GCCISH_DEF_FLAG_$(1))$$(3) $$(2) \
200200
$$(call CFG_INSTALL_NAME_$(1),$$(4))
201-
CFG_COMPILE_CXX_$(1) = '$$(CXX_$(1))' \
201+
CFG_COMPILE_CXX_$(1) = '$$(call FIND_COMPILER,$$(CXX_$(1)))' \
202202
$$(CXXFLAGS) \
203203
$$(CFG_GCCISH_CFLAGS) \
204204
$$(CFG_GCCISH_CXXFLAGS) \

branches/auto/mk/tests.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -635,8 +635,8 @@ CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3) = \
635635
--host-rustcflags "$(RUSTC_FLAGS_$(3)) $$(CTEST_RUSTC_FLAGS) -L $$(RT_OUTPUT_DIR_$(3))" \
636636
--lldb-python-dir=$(CFG_LLDB_PYTHON_DIR) \
637637
--target-rustcflags "$(RUSTC_FLAGS_$(2)) $$(CTEST_RUSTC_FLAGS) -L $$(RT_OUTPUT_DIR_$(2))" \
638-
--cc '$$(CC_$(2))' \
639-
--cxx '$$(CXX_$(2))' \
638+
--cc '$$(call FIND_COMPILER,$$(CC_$(2)))' \
639+
--cxx '$$(call FIND_COMPILER,$$(CXX_$(2)))' \
640640
--cflags "$$(CFG_GCCISH_CFLAGS_$(2))" \
641641
--llvm-components "$$(LLVM_ALL_COMPONENTS_$(2))" \
642642
--llvm-cxxflags "$$(LLVM_CXXFLAGS_$(2))" \

branches/auto/src/bootstrap/build/job.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ pub unsafe fn setup() {
5454

5555
// Indicate that when all handles to the job object are gone that all
5656
// process in the object should be killed. Note that this includes our
57-
// entire process tree by default because we've added ourselves and and our
57+
// entire process tree by default because we've added ourselves and our
5858
// children will reside in the job by default.
5959
let mut info = mem::zeroed::<JOBOBJECT_EXTENDED_LIMIT_INFORMATION>();
6060
info.BasicLimitInformation.LimitFlags = JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE;

branches/auto/src/doc/reference.md

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2063,33 +2063,41 @@ arbitrarily complex configurations through nesting.
20632063

20642064
The following configurations must be defined by the implementation:
20652065

2066-
* `debug_assertions` - Enabled by default when compiling without optimizations.
2067-
This can be used to enable extra debugging code in development but not in
2068-
production. For example, it controls the behavior of the standard library's
2069-
`debug_assert!` macro.
2070-
* `target_arch = "..."` - Target CPU architecture, such as `"x86"`, `"x86_64"`
2071-
`"mips"`, `"powerpc"`, `"powerpc64"`, `"arm"`, or `"aarch64"`.
2072-
* `target_endian = "..."` - Endianness of the target CPU, either `"little"` or
2073-
`"big"`.
2074-
* `target_env = ".."` - An option provided by the compiler by default
2075-
describing the runtime environment of the target platform. Some examples of
2076-
this are `musl` for builds targeting the MUSL libc implementation, `msvc` for
2077-
Windows builds targeting MSVC, and `gnu` frequently the rest of the time. This
2078-
option may also be blank on some platforms.
2066+
* `target_arch = "..."` - Target CPU architecture, such as `"x86"`,
2067+
`"x86_64"` `"mips"`, `"powerpc"`, `"powerpc64"`, `"arm"`, or
2068+
`"aarch64"`. This value is closely related to the first element of
2069+
the platform target triple, though it is not identical.
2070+
* `target_os = "..."` - Operating system of the target, examples
2071+
include `"windows"`, `"macos"`, `"ios"`, `"linux"`, `"android"`,
2072+
`"freebsd"`, `"dragonfly"`, `"bitrig"` , `"openbsd"` or
2073+
`"netbsd"`. This value is closely related to the second and third
2074+
element of the platform target triple, though it is not identical.
20792075
* `target_family = "..."` - Operating system family of the target, e. g.
20802076
`"unix"` or `"windows"`. The value of this configuration option is defined
20812077
as a configuration itself, like `unix` or `windows`.
2082-
* `target_os = "..."` - Operating system of the target, examples include
2083-
`"windows"`, `"macos"`, `"ios"`, `"linux"`, `"android"`, `"freebsd"`, `"dragonfly"`,
2084-
`"bitrig"` , `"openbsd"` or `"netbsd"`.
2078+
* `unix` - See `target_family`.
2079+
* `windows` - See `target_family`.
2080+
* `target_env = ".."` - Further disambiguates the target platform with
2081+
information about the ABI/libc. Presently this value is either
2082+
`"gnu"`, `"msvc"`, `"musl"`, or the empty string. For historical
2083+
reasons this value has only been defined as non-empty when needed
2084+
for disambiguation. Thus on many GNU platforms this value will be
2085+
empty. This value is closely related to the fourth element of the
2086+
platform target triple, though it is not identical. For example,
2087+
embedded ABIs such as `gnueabihf` will simply define `target_env` as
2088+
`"gnu"`.
2089+
* `target_endian = "..."` - Endianness of the target CPU, either `"little"` or
2090+
`"big"`.
20852091
* `target_pointer_width = "..."` - Target pointer width in bits. This is set
20862092
to `"32"` for targets with 32-bit pointers, and likewise set to `"64"` for
20872093
64-bit pointers.
20882094
* `target_vendor = "..."` - Vendor of the target, for example `apple`, `pc`, or
20892095
simply `"unknown"`.
20902096
* `test` - Enabled when compiling the test harness (using the `--test` flag).
2091-
* `unix` - See `target_family`.
2092-
* `windows` - See `target_family`.
2097+
* `debug_assertions` - Enabled by default when compiling without optimizations.
2098+
This can be used to enable extra debugging code in development but not in
2099+
production. For example, it controls the behavior of the standard library's
2100+
`debug_assert!` macro.
20932101

20942102
You can also set another attribute based on a `cfg` variable with `cfg_attr`:
20952103

branches/auto/src/libcollections/slice.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -419,8 +419,8 @@ impl<T> [T] {
419419
///
420420
/// ```rust
421421
/// let v = &[1, 2, 3, 4, 5];
422-
/// for win in v.chunks(2) {
423-
/// println!("{:?}", win);
422+
/// for chunk in v.chunks(2) {
423+
/// println!("{:?}", chunk);
424424
/// }
425425
/// ```
426426
#[stable(feature = "rust1", since = "1.0.0")]

branches/auto/src/libcore/iter/iterator.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ pub trait Iterator {
214214
/// Like most indexing operations, the count starts from zero, so `nth(0)`
215215
/// returns the first value, `nth(1)` the second, and so on.
216216
///
217-
/// `nth()` will return `None` if `n` is larger than the length of the
217+
/// `nth()` will return `None` if `n` is greater than or equal to the length of the
218218
/// iterator.
219219
///
220220
/// # Examples
@@ -237,7 +237,7 @@ pub trait Iterator {
237237
/// assert_eq!(iter.nth(1), None);
238238
/// ```
239239
///
240-
/// Returning `None` if there are less than `n` elements:
240+
/// Returning `None` if there are less than `n + 1` elements:
241241
///
242242
/// ```
243243
/// let a = [1, 2, 3];

branches/auto/src/libcore/num/mod.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,17 @@ use slice::SliceExt;
3737
/// `wrapping_add`, or through the `Wrapping<T>` type, which says that
3838
/// all standard arithmetic operations on the underlying value are
3939
/// intended to have wrapping semantics.
40+
///
41+
/// # Examples
42+
///
43+
/// ```
44+
/// use std::num::Wrapping;
45+
///
46+
/// let zero = Wrapping(0u32);
47+
/// let one = Wrapping(1u32);
48+
///
49+
/// assert_eq!(std::u32::MAX, (zero - one).0);
50+
/// ```
4051
#[stable(feature = "rust1", since = "1.0.0")]
4152
#[derive(PartialEq, Eq, PartialOrd, Ord, Clone, Copy, Default, Hash)]
4253
pub struct Wrapping<T>(#[stable(feature = "rust1", since = "1.0.0")] pub T);

branches/auto/src/librustc/dep_graph/thread.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,9 @@ pub fn main(swap_in: Receiver<Vec<DepMessage>>,
176176
DepMessage::Query => query_out.send(edges.query()).unwrap(),
177177
}
178178
}
179-
swap_out.send(messages).unwrap();
179+
if let Err(_) = swap_out.send(messages) {
180+
// the receiver must have been dropped already
181+
break;
182+
}
180183
}
181184
}

branches/auto/src/librustc/session/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1355,7 +1355,7 @@ pub mod nightly_options {
13551355
early_error(ErrorOutputType::default(), &msg);
13561356
}
13571357
OptionStability::UnstableButNotReally => {
1358-
let msg = format!("the option `{}` is is unstable and should \
1358+
let msg = format!("the option `{}` is unstable and should \
13591359
only be used on the nightly compiler, but \
13601360
it is currently accepted for backwards \
13611361
compatibility; this will soon change, \

branches/auto/src/librustc/traits/project.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ use std::rc::Rc;
4040
pub enum ProjectionMode {
4141
/// FIXME (#32205)
4242
/// At coherence-checking time, we're still constructing the
43-
/// specialization graph, and thus we only project project
43+
/// specialization graph, and thus we only project
4444
/// non-`default` associated types that are defined directly in
4545
/// the applicable impl. (This behavior should be improved over
4646
/// time, to allow for successful projections modulo cycles

branches/auto/src/librustc/ty/trait_def.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ impl<'tcx> TraitDef<'tcx> {
176176
/// Records a trait-to-implementation mapping for a non-local impl.
177177
///
178178
/// The `parent_impl` is the immediately-less-specialized impl, or the
179-
/// trait's def ID if the impl is is not a specialization -- information that
179+
/// trait's def ID if the impl is not a specialization -- information that
180180
/// should be pulled from the metadata.
181181
pub fn record_remote_impl(&self,
182182
tcx: &TyCtxt<'tcx>,

branches/auto/src/librustc/ty/wf.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ impl<'a,'tcx> WfPredicates<'a,'tcx> {
272272
/// into `self.out`.
273273
fn compute_projection(&mut self, data: ty::ProjectionTy<'tcx>) {
274274
// A projection is well-formed if (a) the trait ref itself is
275-
// WF WF and (b) the trait-ref holds. (It may also be
275+
// WF and (b) the trait-ref holds. (It may also be
276276
// normalizable and be WF that way.)
277277

278278
self.compute_trait_ref(&data.trait_ref);

branches/auto/src/librustc_back/target/i686_unknown_linux_musl.rs

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,31 +8,14 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// See x86_64_unknown_linux_musl for explanation of arguments
12-
1311
use target::Target;
1412

1513
pub fn target() -> Target {
16-
let mut base = super::linux_base::opts();
14+
let mut base = super::linux_musl_base::opts();
1715
base.cpu = "pentium4".to_string();
1816
base.pre_link_args.push("-m32".to_string());
1917
base.pre_link_args.push("-Wl,-melf_i386".to_string());
2018

21-
base.pre_link_args.push("-nostdlib".to_string());
22-
base.pre_link_args.push("-static".to_string());
23-
base.pre_link_args.push("-Wl,--eh-frame-hdr".to_string());
24-
25-
base.pre_link_args.push("-Wl,-(".to_string());
26-
base.post_link_args.push("-Wl,-)".to_string());
27-
28-
base.pre_link_objects_exe.push("crt1.o".to_string());
29-
base.pre_link_objects_exe.push("crti.o".to_string());
30-
base.post_link_objects.push("crtn.o".to_string());
31-
32-
base.dynamic_linking = false;
33-
base.has_rpath = false;
34-
base.position_independent_executables = false;
35-
3619
Target {
3720
llvm_target: "i686-unknown-linux-musl".to_string(),
3821
target_endian: "little".to_string(),
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
use target::TargetOptions;
12+
13+
pub fn opts() -> TargetOptions {
14+
let mut base = super::linux_base::opts();
15+
16+
// Make sure that the linker/gcc really don't pull in anything, including
17+
// default objects, libs, etc.
18+
base.pre_link_args.push("-nostdlib".to_string());
19+
base.pre_link_args.push("-static".to_string());
20+
21+
// At least when this was tested, the linker would not add the
22+
// `GNU_EH_FRAME` program header to executables generated, which is required
23+
// when unwinding to locate the unwinding information. I'm not sure why this
24+
// argument is *not* necessary for normal builds, but it can't hurt!
25+
base.pre_link_args.push("-Wl,--eh-frame-hdr".to_string());
26+
27+
// There's a whole bunch of circular dependencies when dealing with MUSL
28+
// unfortunately. To put this in perspective libc is statically linked to
29+
// liblibc and libunwind is statically linked to libstd:
30+
//
31+
// * libcore depends on `fmod` which is in libc (transitively in liblibc).
32+
// liblibc, however, depends on libcore.
33+
// * compiler-rt has personality symbols that depend on libunwind, but
34+
// libunwind is in libstd which depends on compiler-rt.
35+
//
36+
// Recall that linkers discard libraries and object files as much as
37+
// possible, and with all the static linking and archives flying around with
38+
// MUSL the linker is super aggressively stripping out objects. For example
39+
// the first case has fmod stripped from liblibc (it's in its own object
40+
// file) so it's not there when libcore needs it. In the second example all
41+
// the unused symbols from libunwind are stripped (each is in its own object
42+
// file in libstd) before we end up linking compiler-rt which depends on
43+
// those symbols.
44+
//
45+
// To deal with these circular dependencies we just force the compiler to
46+
// link everything as a group, not stripping anything out until everything
47+
// is processed. The linker will still perform a pass to strip out object
48+
// files but it won't do so until all objects/archives have been processed.
49+
base.pre_link_args.push("-Wl,-(".to_string());
50+
base.post_link_args.push("-Wl,-)".to_string());
51+
52+
// When generating a statically linked executable there's generally some
53+
// small setup needed which is listed in these files. These are provided by
54+
// a musl toolchain and are linked by default by the `musl-gcc` script. Note
55+
// that `gcc` also does this by default, it just uses some different files.
56+
//
57+
// Each target directory for musl has these object files included in it so
58+
// they'll be included from there.
59+
base.pre_link_objects_exe.push("crt1.o".to_string());
60+
base.pre_link_objects_exe.push("crti.o".to_string());
61+
base.post_link_objects.push("crtn.o".to_string());
62+
63+
// MUSL support doesn't currently include dynamic linking, so there's no
64+
// need for dylibs or rpath business. Additionally `-pie` is incompatible
65+
// with `-static`, so we can't pass `-pie`.
66+
base.dynamic_linking = false;
67+
base.has_rpath = false;
68+
base.position_independent_executables = false;
69+
70+
base
71+
}

branches/auto/src/librustc_back/target/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ mod bitrig_base;
5656
mod dragonfly_base;
5757
mod freebsd_base;
5858
mod linux_base;
59+
mod linux_musl_base;
5960
mod openbsd_base;
6061
mod netbsd_base;
6162
mod solaris_base;
@@ -201,7 +202,7 @@ pub struct TargetOptions {
201202
pub post_link_args: Vec<String>,
202203

203204
/// Default CPU to pass to LLVM. Corresponds to `llc -mcpu=$cpu`. Defaults
204-
/// to "default".
205+
/// to "generic".
205206
pub cpu: String,
206207
/// Default target features to pass to LLVM. These features will *always* be
207208
/// passed, and cannot be disabled even via `-C`. Corresponds to `llc

0 commit comments

Comments
 (0)