ports/lang/rust/patches/patch-src_bootstrap_bin_rustc_rs

28 lines
1,003 B
Text
Raw Normal View History

2023-08-16 22:26:55 +00:00
try to reduce memory usage on aarch64 and i386:
- reduce memory use by retaining fewer names within compilation artifacts
- divise (with codegen-units) the unit in smaller parts to manipulate it
Index: src/bootstrap/bin/rustc.rs
--- src/bootstrap/bin/rustc.rs.orig
+++ src/bootstrap/bin/rustc.rs
@@ -114,6 +114,19 @@ fn main() {
{
cmd.arg("-Ztls-model=initial-exec");
}
+
+ if target.unwrap().contains("aarch64-unknown-openbsd")
+ && crate_name == Some("rustc")
+ {
+ cmd.arg("-Z").arg("fewer-names");
+ }
+ if target.unwrap().contains("i686-unknown-openbsd")
+ && crate_name == Some("rustc_middle")
+ {
+ cmd.arg("-Z").arg("fewer-names");
+ cmd.arg("-C").arg("codegen-units=64");
+ }
+
} else {
// FIXME(rust-lang/cargo#5754) we shouldn't be using special env vars
// here, but rather Cargo should know what flags to pass rustc itself.