• [gentoo-dev] [PATCH 6/7] cargo.eclass: set codegen-units = 1

    From Georgy Yakovlev@21:1/5 to All on Thu Feb 9 22:00:01 2023
    This might increase build and lto times a bit,
    but may result in faster and better optimized result.
    It also honors resource limits properly.

    Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>
    ---
    eclass/cargo.eclass | 5 +++++
    1 file changed, 5 insertions(+)

    diff --git a/eclass/cargo.eclass b/eclass/cargo.eclass
    index a7c7bffd3c0c..00b8078f80ea 100644
    --- a/eclass/cargo.eclass
    +++ b/eclass/cargo.eclass
    @@ -279,6 +279,11 @@ cargo_gen_config() {
    $(usex debug 'opt-level = 0' '')
    $(usex debug 'lto = false' '')

    + # https://doc.rust-lang.org/rustc/codegen-options/index.html#codegen-units
    + # We use single codegen unit for most optimized code and to honor -j from MAKEOPTS.
    + # Users can override via e.g. CARGO_PROFILE_gentoo_CODEGEN_UNITS="16" in make.conf.
    + codegen-units = 1
    +
    [build]
    jobs = $(makeopts_jobs)
    incremental = false
    --
    2.39.1

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)