Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
12 changes: 7 additions & 5 deletions src/bootstrap/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,16 @@ fn build_startup_objects(build: &Build, target: &str, into: &Path) {
return
}
let compiler = Compiler::new(0, &build.config.build);
let compiler = build.compiler_path(&compiler);
let compiler_path = build.compiler_path(&compiler);

for file in t!(fs::read_dir(build.src.join("src/rtstartup"))) {
let file = t!(file);
build.run(Command::new(&compiler)
.arg("--emit=obj")
.arg("--out-dir").arg(into)
.arg(file.path()));
let mut cmd = Command::new(&compiler_path);
build.add_bootstrap_key(&compiler, &mut cmd);
build.run(cmd.arg("--target").arg(target)
.arg("--emit=obj")
.arg("--out-dir").arg(into)
.arg(file.path()));
}

for obj in ["crt2.o", "dllcrt2.o"].iter() {
Expand Down
11 changes: 10 additions & 1 deletion src/rtstartup/rsbegin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,19 @@
// object (usually called `crtX.o), which then invokes initialization callbacks
// of other runtime components (registered via yet another special image section).

#![feature(no_core, lang_items)]
#![crate_type="rlib"]
#![no_std]
#![no_core]
#![allow(non_camel_case_types)]

#[lang = "sized"]
trait Sized {}
#[lang = "sync"]
trait Sync {}
#[lang = "copy"]
trait Copy {}
impl<T> Sync for T {}

#[cfg(all(target_os="windows", target_arch = "x86", target_env="gnu"))]
pub mod eh_frames {
#[no_mangle]
Expand Down
9 changes: 8 additions & 1 deletion src/rtstartup/rsend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,15 @@

// See rsbegin.rs for details.

#![feature(no_core, lang_items)]
#![crate_type="rlib"]
#![no_std]
#![no_core]

#[lang = "sized"]
trait Sized {}
#[lang = "sync"]
trait Sync {}
impl<T> Sync for T {}

#[cfg(all(target_os="windows", target_arch = "x86", target_env="gnu"))]
pub mod eh_frames {
Expand Down
1 change: 1 addition & 0 deletions src/rustc/std_shim/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/rustc/std_shim/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ debug-assertions = false

[dependencies]
std = { path = "../../libstd" }
core = { path = "../../libcore" }

# Reexport features from std
[features]
Expand Down
6 changes: 6 additions & 0 deletions src/rustc/std_shim/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,9 @@
// except according to those terms.

// See comments in Cargo.toml for why this exists

// There's a bug right now where if we pass --extern std=... and we're cross
// compiling then this doesn't work with `#[macro_use] extern crate std;`. Work
// around this by not having `#[macro_use] extern crate std;`
#![no_std]
extern crate std;