diff options
author | Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> | 2022-12-20 13:44:26 +0100 |
---|---|---|
committer | Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> | 2022-12-22 20:44:07 +0000 |
commit | 780d55199e54fafc3784691d5cf716c1bb92b0aa (patch) | |
tree | bc65d73e11f116734f2b2cab3dbd48d054b90c8d /solenv/gbuild/platform/unxgcc.mk | |
parent | 24889135773204c6e3002dcb417c75ff1a99ccd0 (diff) |
gb_LTOFLAGS: use -flto=jobserver instead of fixed $(PARALLELISM)
fixed PARALLELISM causes explosion of jobs, especially when machines
wtih many cores/threads. A make wtih PARALLELISM=16 would launch up to
16 linker invocations that by themselves would also do their linking
with a parallelism of 16, causing load of over 100 and very likely
exhausting all memory bringing the system to a crawl or cause OOM kills.
for a command to be able to communicate with make's jobserver, it must
be part of a submake called with $(MAKE) or the command from the rule
needs to be prefixed with the + character.
While our gbuild stuff is a submake call, it only is that submake that
uses the PARALLELISM flags determined by configure, so that is not
sufficient for jobserver usage by the the lto linker.
Change-Id: I46ec4760c1a8623195700b8cb16f7deafeb1111e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144593
Tested-by: Jenkins
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
Diffstat (limited to 'solenv/gbuild/platform/unxgcc.mk')
-rw-r--r-- | solenv/gbuild/platform/unxgcc.mk | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/solenv/gbuild/platform/unxgcc.mk b/solenv/gbuild/platform/unxgcc.mk index 5e971bd8944c..461d1f048390 100644 --- a/solenv/gbuild/platform/unxgcc.mk +++ b/solenv/gbuild/platform/unxgcc.mk @@ -134,7 +134,7 @@ $(if $(call gb_LinkTarget__WantLock,$2), \ $(gb_LinkTarget__cmd_lockfile) -r -1 $(gb_LinkTarget__Lock) ; \ echo "$(call gb_Output_announce_str,$(2): got link lock at $$(date -u),$(true),LNK,5)" ; \ ) - $(if $(filter EMSCRIPTEN,$(OS)),unset PYTHONWARNINGS ;) \ + +$(if $(filter EMSCRIPTEN,$(OS)),unset PYTHONWARNINGS ;) \ $(call gb_Helper_abbreviate_dirs,\ $(if $(call gb_LinkTarget__NeedsCxxLinker),$(or $(T_CXX),$(gb_CXX)) $(gb_CXX_LINKFLAGS),$(or $(T_CC),$(gb_CC))) \ $(if $(filter Library CppunitTest,$(TARGETTYPE)),$(gb_Library_TARGETTYPEFLAGS)) \ |