Skip to content

Commit f9cf9eb

Browse files
committed
---
yaml --- r: 219886 b: refs/heads/snap-stage3 c: 555b021 h: refs/heads/master v: v3
1 parent f371ae9 commit f9cf9eb

File tree

23 files changed

+419
-881
lines changed

23 files changed

+419
-881
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
refs/heads/master: c044791d80ea0dc5c4b57b6030a67b69f8510239
3-
refs/heads/snap-stage3: 9d9e2678f504b4e9389d6a62d27ba4f5ee17a2f6
3+
refs/heads/snap-stage3: 555b021c6e531fc375c62160a176dcc4fe77b798
44
refs/heads/try: b53c0f93eedcdedd4fd89bccc5a3a09d1c5cd23e
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
66
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/snap-stage3/mk/target.mk

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -249,9 +249,11 @@ endef
249249

250250
$(foreach host,$(CFG_HOST), \
251251
$(foreach target,$(CFG_TARGET), \
252-
$(foreach crate,$(CRATES), \
253-
$(eval $(call SETUP_LIB_MSVC_ENV_VARS,0,$(target),$(host),$(crate))))))
252+
$(foreach stage,$(STAGES), \
253+
$(foreach crate,$(CRATES), \
254+
$(eval $(call SETUP_LIB_MSVC_ENV_VARS,$(stage),$(target),$(host),$(crate)))))))
254255
$(foreach host,$(CFG_HOST), \
255256
$(foreach target,$(CFG_TARGET), \
256-
$(foreach tool,$(TOOLS), \
257-
$(eval $(call SETUP_TOOL_MSVC_ENV_VARS,0,$(target),$(host),$(tool))))))
257+
$(foreach stage,$(STAGES), \
258+
$(foreach tool,$(TOOLS), \
259+
$(eval $(call SETUP_TOOL_MSVC_ENV_VARS,$(stage),$(target),$(host),$(tool)))))))

branches/snap-stage3/src/librustc_driver/lib.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,21 @@ pub fn commit_date_str() -> Option<&'static str> {
481481
option_env!("CFG_VER_DATE")
482482
}
483483

484+
/// Returns a stage string, such as "stage0".
485+
pub fn stage_str() -> Option<&'static str> {
486+
if cfg!(stage0) {
487+
Some("stage0")
488+
} else if cfg!(stage1) {
489+
Some("stage1")
490+
} else if cfg!(stage2) {
491+
Some("stage2")
492+
} else if cfg!(stage3) {
493+
Some("stage3")
494+
} else {
495+
None
496+
}
497+
}
498+
484499
/// Prints version information
485500
pub fn version(binary: &str, matches: &getopts::Matches) {
486501
let verbose = matches.opt_present("verbose");
@@ -493,6 +508,7 @@ pub fn version(binary: &str, matches: &getopts::Matches) {
493508
println!("commit-date: {}", unw(commit_date_str()));
494509
println!("host: {}", config::host_triple());
495510
println!("release: {}", unw(release_str()));
511+
println!("stage: {}", unw(stage_str()));
496512
}
497513
}
498514

branches/snap-stage3/src/librustc_trans/back/link.rs

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ use super::archive::{Archive, ArchiveBuilder, ArchiveConfig, METADATA_FILENAME};
1212
use super::linker::{Linker, GnuLinker, MsvcLinker};
1313
use super::rpath::RPathConfig;
1414
use super::rpath;
15-
use super::msvc;
1615
use super::svh::Svh;
1716
use session::config;
1817
use session::config::NoDebugInfo;
@@ -359,14 +358,10 @@ pub fn mangle_internal_name_by_path_and_seq(path: PathElems, flav: &str) -> Stri
359358
mangle(path.chain(Some(gensym_name(flav))), None)
360359
}
361360

362-
pub fn get_linker(sess: &Session) -> (String, Command) {
363-
if let Some(ref linker) = sess.opts.cg.linker {
364-
(linker.clone(), Command::new(linker))
365-
} else if sess.target.target.options.is_like_msvc {
366-
("link.exe".to_string(), msvc::link_exe_cmd(sess))
367-
} else {
368-
(sess.target.target.options.linker.clone(),
369-
Command::new(&sess.target.target.options.linker))
361+
pub fn get_cc_prog(sess: &Session) -> String {
362+
match sess.opts.cg.linker {
363+
Some(ref linker) => return linker.to_string(),
364+
None => sess.target.target.options.linker.clone(),
370365
}
371366
}
372367

@@ -812,7 +807,8 @@ fn link_natively(sess: &Session, trans: &CrateTranslation, dylib: bool,
812807
let tmpdir = TempDir::new("rustc").ok().expect("needs a temp dir");
813808

814809
// The invocations of cc share some flags across platforms
815-
let (pname, mut cmd) = get_linker(sess);
810+
let pname = get_cc_prog(sess);
811+
let mut cmd = Command::new(&pname);
816812
cmd.env("PATH", command_path(sess));
817813

818814
let root = sess.target_filesearch(PathKind::Native).get_lib_path();

branches/snap-stage3/src/librustc_trans/back/msvc/mod.rs

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

0 commit comments

Comments
 (0)