Module compile

Source
Expand description

Implementation of compiling various phases of the compiler and standard library.

This module contains some of the real meat in the bootstrap build system which is where Cargo is used to compile the standard library, libtest, and the compiler. This module is also responsible for assembling the sysroot as it goes along from the output of the previous stage.

StructsΒ§

Assemble
Prepare a compiler sysroot.
BuiltRustc
Represents information about a built rustc.
CargoTarget
CraneliftCodegenBackend
GccCodegenBackend
GccCodegenBackendOutput
Output of the compile::GccCodegenBackend step. It includes the path to the libgccjit library on which this backend depends.
Rustc
Build rustc using the passed build_compiler.
RustcLink πŸ”’
RustcLink copies compiler rlibs from a rustc build into a compiler sysroot. It works with (potentially up to) three compilers:
StartupObjects
Std
Build a standard library for the given target using the given build_compiler.
StdLink
Link all libstd rlibs/dylibs into a sysroot of target_compiler.
Sysroot

EnumsΒ§

CargoMessage

FunctionsΒ§

add_to_sysroot
Link some files into a rustc sysroot.
apple_darwin_sign_file πŸ”’
apple_darwin_update_library_name πŸ”’
compiler_file
compiler_rt_for_profiler πŸ”’
Tries to find LLVM’s compiler-rt source directory, for building library/profiler_builtins.
copy_and_stamp πŸ”’
copy_codegen_backends_to_sysroot πŸ”’
Creates the codegen-backends folder for a compiler that’s about to be assembled as a complete compiler.
copy_llvm_libunwind πŸ”’
copy_sanitizers πŸ”’
Copies sanitizer runtime libraries into target libdir.
copy_self_contained_objects πŸ”’
Copies third party objects needed by various targets for self-contained linkage.
copy_third_party_objects πŸ”’
Copies third party objects needed by various targets.
cp_rustc_component_to_ci_sysroot πŸ”’
get_codegen_backend_file
Gets the path to a dynamic codegen backend library from its build stamp.
is_lto_stage
We only use LTO for stage 2+, to speed up build time of intermediate stages.
normalize_codegen_backend_name
Normalize the name of a dynamic codegen backend library.
run_cargo
rustc_cargo
rustc_cargo_env
rustc_llvm_env πŸ”’
Pass down configuration from the LLVM build into the build of rustc_llvm and rustc_codegen_llvm.
std_cargo
Configure cargo to compile the standard library, adding appropriate env vars and such.
std_crates_for_run_make
Resolves standard library crates for Std::run_make for any build kind (like check, doc, build, clippy, etc.).
stream_cargo
strip_debug
write_codegen_backend_stamp πŸ”’
Write filtered files into the passed build stamp and returns it.