Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 10 pull requests #40059

Closed
wants to merge 21 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
0e45a5e
[rustbuild] add a way to run command after failure
nagisa Feb 16, 2017
b2ac1c9
Additional docs for Vec, String, and slice trait impls
mbrubeck Feb 16, 2017
2e756e2
add solaris sparcv9 support
binarycrusader Feb 17, 2017
6091330
Follow rename of mx_handle_wait Magenta syscalls
raphlinus Feb 17, 2017
0c4c6fd
Rebuild mingw startup objects only when necessary
petrochenkov Feb 18, 2017
ec648a1
Fix indentation of error message
sgrif Feb 18, 2017
58a9dd3
Add missing urls and examples into Barrier structs
GuillaumeGomez Feb 21, 2017
689dc26
Clarify thread::Builder::stack_size
matklad Feb 22, 2017
84ca464
Update exception-safety.md
DaseinPhaos Feb 23, 2017
729948f
Update exception-safety.md
DaseinPhaos Feb 23, 2017
088b727
Add missing urls in MutexGuard docs
GuillaumeGomez Feb 23, 2017
b8ccf59
Rollup merge of #39886 - mbrubeck:doc-edit, r=steveklabnik
frewsxcv Feb 23, 2017
6f16bc3
Rollup merge of #39888 - nagisa:on-fail-bootstrap, r=alexcrichton
frewsxcv Feb 23, 2017
d611b42
Rollup merge of #39892 - petrochenkov:rt, r=alexcrichton
frewsxcv Feb 23, 2017
15330bf
Rollup merge of #39903 - binarycrusader:issue-39901, r=alexcrichton
frewsxcv Feb 23, 2017
a83511e
Rollup merge of #39914 - raphlinus:mx_handle_wait, r=alexcrichton
frewsxcv Feb 23, 2017
b4cae7a
Rollup merge of #39940 - sgrif:sg-indentation, r=alexcrichton
frewsxcv Feb 23, 2017
b1b5bcd
Rollup merge of #40010 - GuillaumeGomez:barrier-docs, r=frewsxcv
frewsxcv Feb 23, 2017
ff96ca1
Rollup merge of #40030 - matklad:stack-docs, r=alexcrichton
frewsxcv Feb 23, 2017
efa4d80
Rollup merge of #40050 - DaseinPhaos:patch-3, r=steveklabnik
frewsxcv Feb 23, 2017
a5e2cce
Rollup merge of #40052 - GuillaumeGomez:sunc_docs, r=frewsxcv
frewsxcv Feb 23, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 21 additions & 13 deletions src/bootstrap/compile.rs
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@ use std::fs::{self, File};
use std::path::{Path, PathBuf};
use std::process::Command;

use build_helper::{output, mtime};
use build_helper::{output, mtime, up_to_date};
use filetime::FileTime;

use util::{exe, libdir, is_dylib, copy};
@@ -132,21 +132,29 @@ pub fn build_startup_objects(build: &Build, for_compiler: &Compiler, target: &st

let compiler = Compiler::new(0, &build.config.build);
let compiler_path = build.compiler_path(&compiler);
let into = build.sysroot_libdir(for_compiler, target);
t!(fs::create_dir_all(&into));

for file in t!(fs::read_dir(build.src.join("src/rtstartup"))) {
let file = t!(file);
let mut cmd = Command::new(&compiler_path);
build.run(cmd.env("RUSTC_BOOTSTRAP", "1")
.arg("--target").arg(target)
.arg("--emit=obj")
.arg("--out-dir").arg(&into)
.arg(file.path()));
let src_dir = &build.src.join("src/rtstartup");
let dst_dir = &build.native_dir(target).join("rtstartup");
let sysroot_dir = &build.sysroot_libdir(for_compiler, target);
t!(fs::create_dir_all(dst_dir));
t!(fs::create_dir_all(sysroot_dir));

for file in &["rsbegin", "rsend"] {
let src_file = &src_dir.join(file.to_string() + ".rs");
let dst_file = &dst_dir.join(file.to_string() + ".o");
if !up_to_date(src_file, dst_file) {
let mut cmd = Command::new(&compiler_path);
build.run(cmd.env("RUSTC_BOOTSTRAP", "1")
.arg("--target").arg(target)
.arg("--emit=obj")
.arg("--out-dir").arg(dst_dir)
.arg(src_file));
}

copy(dst_file, &sysroot_dir.join(file.to_string() + ".o"));
}

for obj in ["crt2.o", "dllcrt2.o"].iter() {
copy(&compiler_file(build.cc(target), obj), &into.join(obj));
copy(&compiler_file(build.cc(target), obj), &sysroot_dir.join(obj));
}
}