aboutsummaryrefslogtreecommitdiff
path: root/lang
diff options
context:
space:
mode:
authorTobias Kortkamp <tobik@FreeBSD.org>2021-06-14 18:50:33 +0000
committerTobias Kortkamp <tobik@FreeBSD.org>2021-06-14 20:51:11 +0000
commit294f0c5c206d70e24b6bbc28766d962dc82f8b61 (patch)
tree8b1213aad9bfbcdc481f22b8b126e62d0a4323b2 /lang
parentf2ae3eb417acbd687114ebe58bf4ca312f633899 (diff)
downloadports-294f0c5c206d70e24b6bbc28766d962dc82f8b61.tar.gz
ports-294f0c5c206d70e24b6bbc28766d962dc82f8b61.zip
lang/rust-nightly: Try to reduce memory usage/pressure
Try to reduce memory usage/pressure by only using one code generation unit. "This flag [codegen-units] controls how many code generation units the crate is split into. It takes an integer greater than 0. When a crate is split into multiple codegen units, LLVM is able to process them in parallel. Increasing parallelism may speed up compile times, but may also produce slower code. Setting this to 1 may improve the performance of generated code, but may be slower to compile." https://doc.rust-lang.org/rustc/codegen-options/index.html#codegen-units PR: 256099 Suggested by: Daniel Engberg
Diffstat (limited to 'lang')
-rw-r--r--lang/rust/Makefile3
1 files changed, 3 insertions, 0 deletions
diff --git a/lang/rust/Makefile b/lang/rust/Makefile
index f0fd5f9b820d..23f19351a4b5 100644
--- a/lang/rust/Makefile
+++ b/lang/rust/Makefile
@@ -167,6 +167,9 @@ do-configure:
@${ECHO_CMD} 'sysconfdir="${PREFIX}/etc"' >> ${WRKSRC}/config.toml
@${ECHO_CMD} '[rust]' >> ${WRKSRC}/config.toml
@${ECHO_CMD} 'channel="${PKGNAMESUFFIX:Ustable:S/^-//}"' >> ${WRKSRC}/config.toml
+.if defined(NIGHTLY_DATE)
+ @${ECHO_CMD} 'codegen-units=1' >> ${WRKSRC}/config.toml
+.endif
@${ECHO_CMD} 'default-linker="${CC}"' >> ${WRKSRC}/config.toml
@${ECHO_CMD} 'deny-warnings=false' >> ${WRKSRC}/config.toml
@${ECHO_CMD} 'verbose-tests=true' >> ${WRKSRC}/config.toml