This removes the hardcoded "ad-hoc" stack information for compiler_builtins, and instead obtains the actual stack usage by building compiler_builtins from source via -Zbuild-std.
Because setting RUSTFLAGS for passing arguments to rustc for use by -Zbuild-std would interfere with flags set in .cargo/config, we now use cargo-call-stack as a rustc wrapper and inject -Zemit-stack-usage there. Additionally, we use the wrapper to determine the location of the compiler_builtins.rlib in use (Cargo does not include sysroot crates in cargo metadata, even when passing -Zbuild-std, so we don't have other reliable ways of finding that path). This is reported to the parent cargo call-stack invocation by printing it to stderr and prefixing it with a marker string.
This removes the hardcoded "ad-hoc" stack information for compiler_builtins, and instead obtains the actual stack usage by building compiler_builtins from source via
-Zbuild-std
.Because setting
RUSTFLAGS
for passing arguments to rustc for use by-Zbuild-std
would interfere with flags set in.cargo/config
, we now usecargo-call-stack
as a rustc wrapper and inject-Zemit-stack-usage
there. Additionally, we use the wrapper to determine the location of thecompiler_builtins.rlib
in use (Cargo does not include sysroot crates incargo metadata
, even when passing-Zbuild-std
, so we don't have other reliable ways of finding that path). This is reported to the parentcargo call-stack
invocation by printing it to stderr and prefixing it with a marker string.