Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 14 Jun 2021 20:51:23 GMT
From:      Tobias Kortkamp <tobik@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: 294f0c5c206d - main - lang/rust-nightly: Try to reduce memory usage/pressure
Message-ID:  <202106142051.15EKpN3T013287@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by tobik:

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

commit 294f0c5c206d70e24b6bbc28766d962dc82f8b61
Author:     Tobias Kortkamp <tobik@FreeBSD.org>
AuthorDate: 2021-06-14 18:50:33 +0000
Commit:     Tobias Kortkamp <tobik@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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202106142051.15EKpN3T013287>