Skip to content

Commit a7e049f

Browse files
committed
---
yaml --- r: 151038 b: refs/heads/try2 c: 30fe550 h: refs/heads/master v: v3
1 parent 07f44f2 commit a7e049f

File tree

546 files changed

+9518
-7626
lines changed

Some content is hidden

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

546 files changed

+9518
-7626
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 2d9dfc64792d14ba46b345b7e7f2913c6a9b28ca
8+
refs/heads/try2: 30fe55066a29a14fffd2a5f41e0ab21e7056fb34
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/configure

Lines changed: 28 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,7 @@ opt ccache 0 "invoke gcc/clang via ccache to reuse object files between builds"
388388
opt local-rust 0 "use an installed rustc rather than downloading a snapshot"
389389
opt pax-flags 0 "apply PaX flags to rustc binaries (required for GRSecurity/PaX-patched kernels)"
390390
opt inject-std-version 1 "inject the current compiler version of libstd into programs"
391+
opt llvm-static-stdcpp 0 "statically link to libstdc++ for LLVM"
391392
opt rpath 1 "build rpaths into rustc itself"
392393
opt nightly 0 "build nightly packages"
393394
opt verify-install 1 "verify installed binaries work"
@@ -579,26 +580,32 @@ then
579580
CFG_ENABLE_CLANG=1
580581
putvar CFG_ENABLE_CLANG
581582
else
582-
# on OS X, with xcode 5 and newer, certain developers may have
583-
# cc, gcc and g++ point to a mixture of clang and gcc
584-
# if so, this will create very strange build errors
585-
# this last stanza is to detect some such problems and save the future rust
586-
# contributor some time solving that issue.
587-
# this detection could be generalized to other OSes aside from OS X
588-
# but the issue seems most likely to happen on OS X
589-
590-
chk_cc () {
591-
$1 --version 2> /dev/null | grep -q $2
592-
}
593-
# check that gcc, cc and g++ all point to the same compiler.
594-
# note that for xcode 5, g++ points to clang, not clang++
595-
if !((chk_cc gcc clang && chk_cc g++ clang) ||
596-
(chk_cc gcc gcc &&( chk_cc g++ g++ || chk g++ gcc))) then
597-
err "the gcc and g++ in your path point to different compilers.
598-
Check which versions are in your path with cc --version and g++ --version.
599-
To resolve this problem, either fix your PATH or run configure with --enable-clang"
600-
fi
583+
if [ $("$CFG_GCC" --version 2>&1 | grep -c ' 4\.[0-6]') -ne 0 ]; then
584+
step_msg "older GCC found, using clang instead"
585+
CFG_ENABLE_CLANG=1
586+
putvar CFG_ENABLE_CLANG
587+
else
588+
# on OS X, with xcode 5 and newer, certain developers may have
589+
# cc, gcc and g++ point to a mixture of clang and gcc
590+
# if so, this will create very strange build errors
591+
# this last stanza is to detect some such problems and save the future rust
592+
# contributor some time solving that issue.
593+
# this detection could be generalized to other OSes aside from OS X
594+
# but the issue seems most likely to happen on OS X
595+
596+
chk_cc () {
597+
$1 --version 2> /dev/null | grep -q $2
598+
}
599+
# check that gcc, cc and g++ all point to the same compiler.
600+
# note that for xcode 5, g++ points to clang, not clang++
601+
if !((chk_cc gcc clang && chk_cc g++ clang) ||
602+
(chk_cc gcc gcc &&( chk_cc g++ g++ || chk g++ gcc))) then
603+
err "the gcc and g++ in your path point to different compilers.
604+
Check which versions are in your path with cc --version and g++ --version.
605+
To resolve this problem, either fix your PATH or run configure with --enable-clang"
606+
fi
601607

608+
fi
602609
fi
603610
fi
604611

@@ -921,10 +928,6 @@ do
921928
LLVM_OPTS="$LLVM_OPTS --disable-terminfo"
922929
# Try to have LLVM pull in as few dependencies as possible (#9397)
923930
LLVM_OPTS="$LLVM_OPTS --disable-zlib --disable-libffi"
924-
# LLVM says it needs a "new" clang/gcc, but we seem to get by ok with
925-
# older versions on the bots. Get by for a little longer by asking it to
926-
# not do version detection
927-
LLVM_OPTS="$LLVM_OPTS --disable-compiler-version-checks"
928931

929932
# Use win32 native thread/lock apis instead of pthread wrapper.
930933
# (llvm's configure tries to find pthread first, so we have to disable it explicitly.)
@@ -942,13 +945,15 @@ do
942945

943946
LLVM_CXX_64="ccache clang++ -Qunused-arguments"
944947
LLVM_CC_64="ccache clang -Qunused-arguments"
948+
LLVM_OPTS="$LLVM_OPTS --enable-libcpp"
945949
;;
946950
("clang")
947951
LLVM_CXX_32="clang++ -m32 -Qunused-arguments"
948952
LLVM_CC_32="clang -m32 -Qunused-arguments"
949953

950954
LLVM_CXX_64="clang++ -Qunused-arguments"
951955
LLVM_CC_64="clang -Qunused-arguments"
956+
LLVM_OPTS="$LLVM_OPTS --enable-libcpp"
952957
;;
953958
("ccache gcc")
954959
LLVM_CXX_32="ccache g++ -m32"

branches/try2/mk/llvm.mk

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,25 @@ $$(LLVM_STAMP_$(1)): $(S)src/rustllvm/llvm-auto-clean-trigger
4242
@$$(call E, make: done cleaning llvm)
4343
touch $$@
4444

45+
ifeq ($$(CFG_ENABLE_LLVM_STATIC_STDCPP),1)
46+
LLVM_STDCPP_LOCATION_$(1) = $$(shell $$(CC_$(1)) $$(CFG_GCCISH_CFLAGS_$(1)) \
47+
-print-file-name=libstdc++.a)
48+
else
49+
LLVM_STDCPP_LOCATION_$(1) =
50+
endif
51+
4552
endef
4653

4754
$(foreach host,$(CFG_HOST), \
48-
$(eval LLVM_CONFIGS := $(LLVM_CONFIGS) $(LLVM_CONFIG_$(host))))
55+
$(eval $(call DEF_LLVM_RULES,$(host))))
4956

5057
$(foreach host,$(CFG_HOST), \
51-
$(eval $(call DEF_LLVM_RULES,$(host))))
58+
$(eval LLVM_CONFIGS := $(LLVM_CONFIGS) $(LLVM_CONFIG_$(host))))
5259

5360
$(S)src/librustc/lib/llvmdeps.rs: \
5461
$(LLVM_CONFIGS) \
55-
$(S)src/etc/mklldeps.py
62+
$(S)src/etc/mklldeps.py \
63+
$(MKFILE_DEPS)
5664
$(Q)$(CFG_PYTHON) $(S)src/etc/mklldeps.py \
57-
"$@" "$(LLVM_COMPONENTS)" $(LLVM_CONFIGS)
65+
"$@" "$(LLVM_COMPONENTS)" "$(CFG_ENABLE_LLVM_STATIC_STDCPP)" \
66+
$(LLVM_CONFIGS)

branches/try2/mk/platform.mk

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -542,14 +542,17 @@ ifdef CFG_CCACHE_BASEDIR
542542
export CCACHE_BASEDIR
543543
endif
544544

545+
FIND_COMPILER = $(word 1,$(1:ccache=))
546+
545547
define CFG_MAKE_TOOLCHAIN
546548
# Prepend the tools with their prefix if cross compiling
547549
ifneq ($(CFG_BUILD),$(1))
548550
CC_$(1)=$(CROSS_PREFIX_$(1))$(CC_$(1))
549551
CXX_$(1)=$(CROSS_PREFIX_$(1))$(CXX_$(1))
550552
CPP_$(1)=$(CROSS_PREFIX_$(1))$(CPP_$(1))
551553
AR_$(1)=$(CROSS_PREFIX_$(1))$(AR_$(1))
552-
RUSTC_CROSS_FLAGS_$(1)=-C linker=$$(CXX_$(1)) -C ar=$$(AR_$(1)) $(RUSTC_CROSS_FLAGS_$(1))
554+
RUSTC_CROSS_FLAGS_$(1)=-C linker=$$(call FIND_COMPILER,$$(CXX_$(1))) \
555+
-C ar=$$(call FIND_COMPILER,$$(AR_$(1))) $(RUSTC_CROSS_FLAGS_$(1))
553556

554557
RUSTC_FLAGS_$(1)=$$(RUSTC_CROSS_FLAGS_$(1)) $(RUSTC_FLAGS_$(1))
555558
endif

branches/try2/mk/target.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ $$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$(4): \
8383
$$(WFLAGS_ST$(1)) \
8484
-L "$$(RT_OUTPUT_DIR_$(2))" \
8585
-L "$$(LLVM_LIBDIR_$(2))" \
86+
-L "$$(dir $$(LLVM_STDCPP_LOCATION_$(2)))" \
8687
--out-dir $$(@D) $$<
8788
@touch $$@
8889
$$(call LIST_ALL_OLD_GLOB_MATCHES,\

branches/try2/src/compiletest/compiletest.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ pub fn parse_config(args: Vec<~str> ) -> config {
9393
assert!(!args.is_empty());
9494
let argv0 = (*args.get(0)).clone();
9595
let args_ = args.tail();
96-
if *args.get(1) == ~"-h" || *args.get(1) == ~"--help" {
96+
if *args.get(1) == "-h".to_owned() || *args.get(1) == "--help".to_owned() {
9797
let message = format!("Usage: {} [OPTIONS] [TESTNAME...]", argv0);
9898
println!("{}", getopts::usage(message, groups.as_slice()));
9999
println!("");
@@ -181,7 +181,7 @@ pub fn log_config(config: &config) {
181181
logv(c, format!("adb_test_dir: {}", config.adb_test_dir));
182182
logv(c, format!("adb_device_status: {}", config.adb_device_status));
183183
match config.test_shard {
184-
None => logv(c, ~"test_shard: (all)"),
184+
None => logv(c, "test_shard: (all)".to_owned()),
185185
Some((a,b)) => logv(c, format!("test_shard: {}.{}", a, b))
186186
}
187187
logv(c, format!("verbose: {}", config.verbose));
@@ -199,7 +199,7 @@ pub fn opt_str<'a>(maybestr: &'a Option<~str>) -> &'a str {
199199
}
200200

201201
pub fn opt_str2(maybestr: Option<~str>) -> ~str {
202-
match maybestr { None => ~"(none)", Some(s) => { s } }
202+
match maybestr { None => "(none)".to_owned(), Some(s) => { s } }
203203
}
204204

205205
pub fn str_mode(s: ~str) -> mode {
@@ -216,17 +216,17 @@ pub fn str_mode(s: ~str) -> mode {
216216

217217
pub fn mode_str(mode: mode) -> ~str {
218218
match mode {
219-
mode_compile_fail => ~"compile-fail",
220-
mode_run_fail => ~"run-fail",
221-
mode_run_pass => ~"run-pass",
222-
mode_pretty => ~"pretty",
223-
mode_debug_info => ~"debug-info",
224-
mode_codegen => ~"codegen",
219+
mode_compile_fail => "compile-fail".to_owned(),
220+
mode_run_fail => "run-fail".to_owned(),
221+
mode_run_pass => "run-pass".to_owned(),
222+
mode_pretty => "pretty".to_owned(),
223+
mode_debug_info => "debug-info".to_owned(),
224+
mode_codegen => "codegen".to_owned(),
225225
}
226226
}
227227

228228
pub fn run_tests(config: &config) {
229-
if config.target == ~"arm-linux-androideabi" {
229+
if config.target == "arm-linux-androideabi".to_owned() {
230230
match config.mode{
231231
mode_debug_info => {
232232
println!("arm-linux-androideabi debug-info \
@@ -296,10 +296,10 @@ pub fn is_test(config: &config, testfile: &Path) -> bool {
296296
// Pretty-printer does not work with .rc files yet
297297
let valid_extensions =
298298
match config.mode {
299-
mode_pretty => vec!(~".rs"),
300-
_ => vec!(~".rc", ~".rs")
299+
mode_pretty => vec!(".rs".to_owned()),
300+
_ => vec!(".rc".to_owned(), ".rs".to_owned())
301301
};
302-
let invalid_prefixes = vec!(~".", ~"#", ~"~");
302+
let invalid_prefixes = vec!(".".to_owned(), "#".to_owned(), "~".to_owned());
303303
let name = testfile.filename_str().unwrap();
304304

305305
let mut valid = false;

branches/try2/src/compiletest/errors.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ pub fn load_errors(testfile: &Path) -> Vec<ExpectedError> {
3131

3232
fn parse_expected(line_num: uint, line: ~str) -> Vec<ExpectedError> {
3333
let line = line.trim();
34-
let error_tag = ~"//~";
34+
let error_tag = "//~".to_owned();
3535
let mut idx;
3636
match line.find_str(error_tag) {
3737
None => return Vec::new(),

branches/try2/src/compiletest/header.rs

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ pub struct TestProps {
1717
pub error_patterns: Vec<~str> ,
1818
// Extra flags to pass to the compiler
1919
pub compile_flags: Option<~str>,
20+
// Extra flags to pass when the compiled code is run (such as --bench)
21+
pub run_flags: Option<~str>,
2022
// If present, the name of a file that this test should match when
2123
// pretty-printed
2224
pub pp_exact: Option<Path>,
@@ -42,6 +44,7 @@ pub fn load_props(testfile: &Path) -> TestProps {
4244
let mut aux_builds = Vec::new();
4345
let mut exec_env = Vec::new();
4446
let mut compile_flags = None;
47+
let mut run_flags = None;
4548
let mut pp_exact = None;
4649
let mut debugger_cmds = Vec::new();
4750
let mut check_lines = Vec::new();
@@ -58,6 +61,10 @@ pub fn load_props(testfile: &Path) -> TestProps {
5861
compile_flags = parse_compile_flags(ln);
5962
}
6063

64+
if run_flags.is_none() {
65+
run_flags = parse_run_flags(ln);
66+
}
67+
6168
if pp_exact.is_none() {
6269
pp_exact = parse_pp_exact(ln, testfile);
6370
}
@@ -96,9 +103,11 @@ pub fn load_props(testfile: &Path) -> TestProps {
96103

97104
true
98105
});
99-
return TestProps {
106+
107+
TestProps {
100108
error_patterns: error_patterns,
101109
compile_flags: compile_flags,
110+
run_flags: run_flags,
102111
pp_exact: pp_exact,
103112
aux_builds: aux_builds,
104113
exec_env: exec_env,
@@ -107,15 +116,15 @@ pub fn load_props(testfile: &Path) -> TestProps {
107116
force_host: force_host,
108117
check_stdout: check_stdout,
109118
no_prefer_dynamic: no_prefer_dynamic,
110-
};
119+
}
111120
}
112121

113122
pub fn is_test_ignored(config: &config, testfile: &Path) -> bool {
114123
fn ignore_target(config: &config) -> ~str {
115-
~"ignore-" + util::get_os(config.target)
124+
"ignore-".to_owned() + util::get_os(config.target)
116125
}
117126
fn ignore_stage(config: &config) -> ~str {
118-
~"ignore-" + config.stage_id.split('-').next().unwrap()
127+
"ignore-".to_owned() + config.stage_id.split('-').next().unwrap()
119128
}
120129

121130
let val = iter_header(testfile, |ln| {
@@ -149,23 +158,27 @@ fn iter_header(testfile: &Path, it: |&str| -> bool) -> bool {
149158
}
150159

151160
fn parse_error_pattern(line: &str) -> Option<~str> {
152-
parse_name_value_directive(line, ~"error-pattern")
161+
parse_name_value_directive(line, "error-pattern".to_owned())
153162
}
154163

155164
fn parse_aux_build(line: &str) -> Option<~str> {
156-
parse_name_value_directive(line, ~"aux-build")
165+
parse_name_value_directive(line, "aux-build".to_owned())
157166
}
158167

159168
fn parse_compile_flags(line: &str) -> Option<~str> {
160-
parse_name_value_directive(line, ~"compile-flags")
169+
parse_name_value_directive(line, "compile-flags".to_owned())
170+
}
171+
172+
fn parse_run_flags(line: &str) -> Option<~str> {
173+
parse_name_value_directive(line, ~"run-flags")
161174
}
162175

163176
fn parse_debugger_cmd(line: &str) -> Option<~str> {
164-
parse_name_value_directive(line, ~"debugger")
177+
parse_name_value_directive(line, "debugger".to_owned())
165178
}
166179

167180
fn parse_check_line(line: &str) -> Option<~str> {
168-
parse_name_value_directive(line, ~"check")
181+
parse_name_value_directive(line, "check".to_owned())
169182
}
170183

171184
fn parse_force_host(line: &str) -> bool {
@@ -181,12 +194,12 @@ fn parse_no_prefer_dynamic(line: &str) -> bool {
181194
}
182195

183196
fn parse_exec_env(line: &str) -> Option<(~str, ~str)> {
184-
parse_name_value_directive(line, ~"exec-env").map(|nv| {
197+
parse_name_value_directive(line, "exec-env".to_owned()).map(|nv| {
185198
// nv is either FOO or FOO=BAR
186199
let mut strs: Vec<~str> = nv.splitn('=', 1).map(|s| s.to_owned()).collect();
187200

188201
match strs.len() {
189-
1u => (strs.pop().unwrap(), ~""),
202+
1u => (strs.pop().unwrap(), "".to_owned()),
190203
2u => {
191204
let end = strs.pop().unwrap();
192205
(strs.pop().unwrap(), end)
@@ -197,7 +210,7 @@ fn parse_exec_env(line: &str) -> Option<(~str, ~str)> {
197210
}
198211

199212
fn parse_pp_exact(line: &str, testfile: &Path) -> Option<Path> {
200-
match parse_name_value_directive(line, ~"pp-exact") {
213+
match parse_name_value_directive(line, "pp-exact".to_owned()) {
201214
Some(s) => Some(Path::new(s)),
202215
None => {
203216
if parse_name_directive(line, "pp-exact") {

branches/try2/src/compiletest/procsrv.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ fn target_env(lib_path: &str, prog: &str) -> Vec<(~str, ~str)> {
2929
(k, new_v)
3030
}).collect();
3131
if prog.ends_with("rustc.exe") {
32-
new_env.push((~"RUST_THREADS", ~"1"));
32+
new_env.push(("RUST_THREADS".to_owned(), "1".to_owned()));
3333
}
3434
return new_env;
3535
}
@@ -49,7 +49,7 @@ fn target_env(lib_path: &str, prog: &str) -> Vec<(~str,~str)> {
4949
};
5050
let prev = match env.iter().position(|&(ref k, _)| k.as_slice() == var) {
5151
Some(i) => env.remove(i).unwrap().val1(),
52-
None => ~"",
52+
None => "".to_owned(),
5353
};
5454
env.push((var.to_owned(), if prev.is_empty() {
5555
lib_path + ":" + aux_path

0 commit comments

Comments
 (0)