1 |
This might increase build and lto times a bit, |
2 |
but may result in faster and better optimized result. |
3 |
It also honors resource limits properly. |
4 |
|
5 |
Signed-off-by: Georgy Yakovlev <gyakovlev@g.o> |
6 |
--- |
7 |
eclass/cargo.eclass | 5 +++++ |
8 |
1 file changed, 5 insertions(+) |
9 |
|
10 |
diff --git a/eclass/cargo.eclass b/eclass/cargo.eclass |
11 |
index a7c7bffd3c0c..00b8078f80ea 100644 |
12 |
--- a/eclass/cargo.eclass |
13 |
+++ b/eclass/cargo.eclass |
14 |
@@ -279,6 +279,11 @@ cargo_gen_config() { |
15 |
$(usex debug 'opt-level = 0' '') |
16 |
$(usex debug 'lto = false' '') |
17 |
|
18 |
+ # https://doc.rust-lang.org/rustc/codegen-options/index.html#codegen-units |
19 |
+ # We use single codegen unit for most optimized code and to honor -j from MAKEOPTS. |
20 |
+ # Users can override via e.g. CARGO_PROFILE_gentoo_CODEGEN_UNITS="16" in make.conf. |
21 |
+ codegen-units = 1 |
22 |
+ |
23 |
[build] |
24 |
jobs = $(makeopts_jobs) |
25 |
incremental = false |
26 |
-- |
27 |
2.39.1 |