openbsd-ports/lang/rust/patches/patch-src_bootstrap_bin_rustc_rs

28 lines
1.1 KiB
Plaintext

$OpenBSD: patch-src_bootstrap_bin_rustc_rs,v 1.17 2021/03/27 10:02:11 semarie Exp $
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
@@ -104,6 +104,19 @@ fn main() {
{
cmd.arg("-C").arg("panic=abort");
}
+
+ 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.