From 780d55199e54fafc3784691d5cf716c1bb92b0aa Mon Sep 17 00:00:00 2001 From: Christian Lohmaier Date: Tue, 20 Dec 2022 13:44:26 +0100 Subject: 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 --- solenv/gbuild/platform/unxgcc.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'solenv/gbuild/platform/unxgcc.mk') 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)) \ -- cgit