mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-18 08:52:45 +00:00
Update main.rs
This commit is contained in:
parent
506990c7be
commit
bba4c38f6b
1 changed files with 4 additions and 0 deletions
|
|
@ -876,12 +876,15 @@ fn build_hw_image(
|
||||||
pkg_path.push(pkg);
|
pkg_path.push(pkg);
|
||||||
init.push(pkg_path);
|
init.push(pkg_path);
|
||||||
}
|
}
|
||||||
|
// stash any LTO settings applied to the kernel; proper layout of the loader
|
||||||
|
// block depends on the loader being compact and highly optimized.
|
||||||
let existing_lto = std::env::var("CARGO_PROFILE_RELEASE_LTO")
|
let existing_lto = std::env::var("CARGO_PROFILE_RELEASE_LTO")
|
||||||
.map(|v| Some(v))
|
.map(|v| Some(v))
|
||||||
.unwrap_or(None);
|
.unwrap_or(None);
|
||||||
let existing_codegen_units = std::env::var("CARGO_PROFILE_RELEASE_CODEGEN_UNITS")
|
let existing_codegen_units = std::env::var("CARGO_PROFILE_RELEASE_CODEGEN_UNITS")
|
||||||
.map(|v| Some(v))
|
.map(|v| Some(v))
|
||||||
.unwrap_or(None);
|
.unwrap_or(None);
|
||||||
|
// these settings will generate the most compact code (but also the hardest to debug)
|
||||||
std::env::set_var("CARGO_PROFILE_RELEASE_LTO", "true");
|
std::env::set_var("CARGO_PROFILE_RELEASE_LTO", "true");
|
||||||
std::env::set_var("CARGO_PROFILE_RELEASE_CODEGEN_UNITS", "1");
|
std::env::set_var("CARGO_PROFILE_RELEASE_CODEGEN_UNITS", "1");
|
||||||
let mut loader = build(
|
let mut loader = build(
|
||||||
|
|
@ -892,6 +895,7 @@ fn build_hw_image(
|
||||||
None,
|
None,
|
||||||
loader_features,
|
loader_features,
|
||||||
)?;
|
)?;
|
||||||
|
// restore the LTO settings
|
||||||
if let Some(existing) = existing_lto {
|
if let Some(existing) = existing_lto {
|
||||||
std::env::set_var("CARGO_PROFILE_RELEASE_LTO", existing);
|
std::env::set_var("CARGO_PROFILE_RELEASE_LTO", existing);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue