git: 294f0c5c206d - main - lang/rust-nightly: Try to reduce memory usage/pressure

Tobias Kortkamp tobik at FreeBSD.org
Mon Jun 14 20:51:24 UTC 2021


The branch main has been updated by tobik:

URL: https://cgit.FreeBSD.org/ports/commit/?id=294f0c5c206d70e24b6bbc28766d962dc82f8b61

commit 294f0c5c206d70e24b6bbc28766d962dc82f8b61
Author:     Tobias Kortkamp <tobik at FreeBSD.org>
AuthorDate: 2021-06-14 18:50:33 +0000
Commit:     Tobias Kortkamp <tobik at FreeBSD.org>
CommitDate: 2021-06-14 20:51:11 +0000

    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
---
 lang/rust/Makefile | 3 +++
 1 file changed, 3 insertions(+)

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


More information about the dev-commits-ports-main mailing list