pub fn rustc<'a>(build: &'a Build, target: &str, compiler: &Compiler<'a>) {
    println!("Building stage{} compiler artifacts ({} -> {})",
             compiler.stage, compiler.host, target);

    let out_dir = build.cargo_out(compiler, Mode::Librustc, target);
    build.clear_if_dirty(&out_dir, &libtest_shim(build, compiler, target));

    let mut cargo = build.cargo(compiler, Mode::Librustc, target, "build");
    cargo.arg("--features").arg(build.rustc_features())
         .arg("--manifest-path")
         .arg(build.src.join("src/rustc/Cargo.toml"));

    // Set some configuration variables picked up by build scripts and
    // the compiler alike
    cargo.env("CFG_RELEASE", &build.release)
         .env("CFG_RELEASE_CHANNEL", &build.config.channel)
         .env("CFG_VERSION", &build.version)
         .env("CFG_BOOTSTRAP_KEY", &build.bootstrap_key)
         .env("CFG_PREFIX", build.config.prefix.clone().unwrap_or(String::new()))
         .env("CFG_LIBDIR_RELATIVE", "lib");

    if let Some(ref ver_date) = build.ver_date {
        cargo.env("CFG_VER_DATE", ver_date);
    }
    if let Some(ref ver_hash) = build.ver_hash {
        cargo.env("CFG_VER_HASH", ver_hash);
    }
    if !build.unstable_features {
        cargo.env("CFG_DISABLE_UNSTABLE_FEATURES", "1");
    }
    // Flag that rust llvm is in use
    if build.is_rust_llvm(target) {
        cargo.env("LLVM_RUSTLLVM", "1");
    }
    cargo.env("LLVM_CONFIG", build.llvm_config(target));
    let target_config = build.config.target_config.get(target);
    if let Some(s) = target_config.and_then(|c| c.llvm_config.as_ref()) {
        cargo.env("CFG_LLVM_ROOT", s);
    }
    if build.config.llvm_static_stdcpp {
        cargo.env("LLVM_STATIC_STDCPP",
                  compiler_file(build.cxx(target), "libstdc++.a"));
    }
    if let Some(ref s) = build.config.rustc_default_linker {
        cargo.env("CFG_DEFAULT_LINKER", s);
    }
    if let Some(ref s) = build.config.rustc_default_ar {
        cargo.env("CFG_DEFAULT_AR", s);
    }
    build.run(&mut cargo);

    rustc_link(build, target, compiler, compiler.host);
}
/// Build the compiler.
///
/// This will build the compiler for a particular stage of the build using
/// the `compiler` targeting the `target` architecture. The artifacts
/// created will also be linked into the sysroot directory.
Build the compiler.
This will build the compiler for a particular stage of the build using
the `compiler` targeting the `target` architecture. The artifacts
created will also be linked into the sysroot directory.
Build the compiler . This will build the compiler for a particular stage of the build using the ` compiler ` targeting the ` target ` architecture . The artifacts created will also be linked into the sysroot directory .
pub fn rustc<'a>(build: &'a Build, target: &str, compiler: &Compiler<'a>) {
    println!("Building stage{} compiler artifacts ({} -> {})",
             compiler.stage, compiler.host, target);
    let out_dir = build.cargo_out(compiler, Mode::Librustc, target);
    build.clear_if_dirty(&out_dir, &libtest_shim(build, compiler, target));
    let mut cargo = build.cargo(compiler, Mode::Librustc, target, "build");
    cargo.arg("--features").arg(build.rustc_features())
         .arg("--manifest-path")
         .arg(build.src.join("src/rustc/Cargo.toml"));
    // Set some configuration variables picked up by build scripts and
    // the compiler alike
    cargo.env("CFG_RELEASE", &build.release)
         .env("CFG_RELEASE_CHANNEL", &build.config.channel)
         .env("CFG_VERSION", &build.version)
         .env("CFG_BOOTSTRAP_KEY", &build.bootstrap_key)
         .env("CFG_PREFIX", build.config.prefix.clone().unwrap_or(String::new()))
         .env("CFG_LIBDIR_RELATIVE", "lib");
    if let Some(ref ver_date) = build.ver_date {
        cargo.env("CFG_VER_DATE", ver_date);
    }
    if let Some(ref ver_hash) = build.ver_hash {
        cargo.env("CFG_VER_HASH", ver_hash);
    }
    if !build.unstable_features {
        cargo.env("CFG_DISABLE_UNSTABLE_FEATURES", "1");
    }
    // Flag that rust llvm is in use
    if build.is_rust_llvm(target) {
        cargo.env("LLVM_RUSTLLVM", "1");
    }
    cargo.env("LLVM_CONFIG", build.llvm_config(target));
    let target_config = build.config.target_config.get(target);
    if let Some(s) = target_config.and_then(|c| c.llvm_config.as_ref()) {
        cargo.env("CFG_LLVM_ROOT", s);
    }
    if build.config.llvm_static_stdcpp {
        cargo.env("LLVM_STATIC_STDCPP",
                  compiler_file(build.cxx(target), "libstdc++.a"));
    }
    if let Some(ref s) = build.config.rustc_default_linker {
        cargo.env("CFG_DEFAULT_LINKER", s);
    }
    if let Some(ref s) = build.config.rustc_default_ar {
        cargo.env("CFG_DEFAULT_AR", s);
    }
    build.run(&mut cargo);
    rustc_link(build, target, compiler, compiler.host);
}
pub fn rustc < ' a > ( build : & ' a Build , target : & str , compiler : & Compiler < ' a > ) { println ! ( " " compiler stage compiler host target ) ; let out_dir = build . cargo_out ( compiler , Mode :: Librustc , target ) ; build . clear_if_dirty ( & out_dir , & libtest_shim ( build , compiler , target ) ) ; let mut cargo = build . cargo ( compiler , Mode :: Librustc , target , " " ) ; cargo . arg ( " " ) . arg ( build . rustc_features ( ) ) . arg ( " " ) . arg ( build . src . join ( " " ) ) ; // Set some configuration variables picked up by build scripts and // the compiler alike cargo . env ( " " , & build . release ) . env ( " " , & build . config . channel ) . env ( " " , & build . version ) . env ( " " , & build . bootstrap_key ) . env ( " " , build . config . prefix . clone ( ) . unwrap_or ( String :: new ( ) ) ) . env ( " " , " " ) ; if let Some ( ref ver_date ) = build . ver_date { cargo . env ( " " , ver_date ) ; } if let Some ( ref ver_hash ) = build . ver_hash { cargo . env ( " " , ver_hash ) ; } if ! build . unstable_features { cargo . env ( " " , " " ) ; } // Flag that rust llvm is in use if build . is_rust_llvm ( target ) { cargo . env ( " " , " " ) ; } cargo . env ( " " , build . llvm_config ( target ) ) ; let target_config = build . config . target_config . get ( target ) ; if let Some ( s ) = target_config . and_then ( | c | c . llvm_config . as_ref ( ) ) { cargo . env ( " " , s ) ; } if build . config . llvm_static_stdcpp { cargo . env ( " " , compiler_file ( build . cxx ( target ) , " " ) ) ; } if let Some ( ref s ) = build . config . rustc_default_linker { cargo . env ( " " , s ) ; } if let Some ( ref s ) = build . config . rustc_default_ar { cargo . env ( " " , s ) ; } build . run ( & mut cargo ) ; rustc_link ( build , target , compiler , compiler . host ) ; }
Build the compiler.
Build the compiler .
build
&'a Build
target
&str
compiler
&Compiler<'a>
build
&'a Build
target
&str
compiler
&Compiler<'a>