Expand description
Compilation of native dependencies like GCC.
Native projects like GCC unfortunately arenβt suited just yet for compilation in build scripts that Cargo has. This is because the compilation takes a very long time but also because we donβt want to compile GCC 3 times as part of a normal bootstrap (we want it cached).
GCC and compiler-rt are essentially just wired up to everything else to ensure that theyβre always in place if needed.
Re-exportsΒ§
use std::fmt::Display;πuse std::fmt::Formatter;πuse std::fs;πuse std::path::Path;πuse std::path::PathBuf;πuse std::sync::OnceLock;πuse build_helper::git::PathFreshness;πuse crate::core::builder::Builder;πuse crate::core::builder::Cargo;πuse crate::core::builder::CommandLineStep;πuse crate::core::builder::Kind;πuse crate::core::builder::RunConfig;πuse crate::core::builder::ShouldRun;πuse crate::core::config::Config;πuse crate::core::config::TargetSelection;πuse crate::utils::build_stamp::BuildStamp;πuse crate::utils::build_stamp::generate_smart_stamp_hash;πuse crate::utils::exec::command;πuse crate::utils::helpers;πuse crate::utils::helpers::t;π
StructsΒ§
- Gcc
- GccOutput
- GccTarget
Pair - GCC cannot cross-compile from a single binary to multiple targets. So we need to have a separate GCC dylib for each (host, target) pair. We represent this explicitly using this struct.
- Meta
EnumsΒ§
FunctionsΒ§
- add_
cg_ gcc_ cargo_ flags - Configures a Cargo invocation so that it can build the GCC codegen backend.
- build_
gcc π - ci_
gcc_ πroot - The absolute path to the downloaded GCC artifacts.
- detect_
gcc_ πfreshness - Detect whether GCC sources have been modified locally or not.
- gcc_out π
- get_
gcc_ build_ status - This returns information about whether GCC should be built or if itβs already built. It transparently handles downloading GCC from CI if needed.
- libgccjit_
built_ πpath - Returns the path to a libgccjit.so file in the install directory of GCC.
- try_
download_ πgcc - Tries to download GCC from CI if it is enabled and GCC artifacts are available for the given target. Returns a path to the libgccjit.so file.