pub fn build_startup_objects(build: &Build, for_compiler: &Compiler, target: &str) {
    if !target.contains("pc-windows-gnu") {
        return
    }

    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()));
    }

    for obj in ["crt2.o", "dllcrt2.o"].iter() {
        copy(&compiler_file(build.cc(target), obj), &into.join(obj));
    }
}
/// Build and prepare startup objects like rsbegin.o and rsend.o
///
/// These are primarily used on Windows right now for linking executables/dlls.
/// They don't require any library support as they're just plain old object
/// files, so we just use the nightly snapshot compiler to always build them (as
/// no other compilers are guaranteed to be available).
Build and prepare startup objects like rsbegin.o and rsend.o
These are primarily used on Windows right now for linking executables/dlls.
They don't require any library support as they're just plain old object
files, so we just use the nightly snapshot compiler to always build them (as
no other compilers are guaranteed to be available).
Build and prepare startup objects like rsbegin . o and rsend . o These are primarily used on Windows right now for linking executables / dlls . They don ' t require any library support as they ' re just plain old object files so we just use the nightly snapshot compiler to always build them ( as no other compilers are guaranteed to be available ) .
pub fn build_startup_objects(build: &Build, for_compiler: &Compiler, target: &str) {
    if !target.contains("pc-windows-gnu") {
        return
    }
    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()));
    }
    for obj in ["crt2.o", "dllcrt2.o"].iter() {
        copy(&compiler_file(build.cc(target), obj), &into.join(obj));
    }
}
pub fn build_startup_objects ( build : & Build , for_compiler : & Compiler , target : & str ) { if ! target . contains ( " " ) { return } 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 ( " " ) ) ) { let file = t ! ( file ) ; let mut cmd = Command :: new ( & compiler_path ) ; build . run ( cmd . env ( " " , " " ) . arg ( " " ) . arg ( target ) . arg ( " " ) . arg ( " " ) . arg ( & into ) . arg ( file . path ( ) ) ) ; } for obj in [ " " , " " ] . iter ( ) { copy ( & compiler_file ( build . cc ( target ) , obj ) , & into . join ( obj ) ) ; } }
Build and prepare startup objects like rsbegin.o and rsend.o
These are primarily used on Windows right now for linking executables/dlls.
Build and prepare startup objects like rsbegin . o and rsend . o These are primarily used on Windows right now for linking executables / dlls .
build
&Build
for_compiler
&Compiler
target
&str
build
&Build
for_compiler
&Compiler
target
&str