[Concept,14/20] buildman: Pass NPROC to make for LTO parallelism

Message ID 20260316154733.1587261-15-sjg@u-boot.org
State New
Headers
Series buildman: Add distributed builds |

Commit Message

Simon Glass March 16, 2026, 3:47 p.m. UTC
  From: Simon Glass <sjg@chromium.org>

LTO link steps use nproc unconditionally, flooding the machine with
jobs during the link phase and reducing build efficiency.

Pass NPROC=<num_jobs> alongside -j so that LTO respects the dynamic
parallelism setting.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 tools/buildman/builderthread.py | 1 +
 1 file changed, 1 insertion(+)
  

Patch

diff --git a/tools/buildman/builderthread.py b/tools/buildman/builderthread.py
index 16534196d4d..6f4f257dedb 100644
--- a/tools/buildman/builderthread.py
+++ b/tools/buildman/builderthread.py
@@ -344,6 +344,7 @@  class BuilderThread(threading.Thread):
                 num_jobs = max(1, nthreads // active)
         if num_jobs is not None:
             args.extend(['-j', str(num_jobs)])
+            args.append(f'NPROC={num_jobs}')
         if self.builder.warnings_as_errors:
             args.append('KCFLAGS=-Werror')
             args.append('HOSTCFLAGS=-Werror')