summaryrefslogtreecommitdiff
path: root/solenv
diff options
context:
space:
mode:
authorChristian Lohmaier <lohmaier+LibreOffice@googlemail.com>2021-10-27 20:19:44 +0200
committerChristian Lohmaier <lohmaier+LibreOffice@googlemail.com>2021-10-28 12:07:06 +0200
commit899434244fb8b632159a82c1f61262a15058708c (patch)
tree1349fea2029ec860c42bad5f2a2ff01a3e767dba /solenv
parent0a340780962ff93b519ff5285ccacc9c52cf17ca (diff)
-flto: only use firstword of PARALLELISM
jenkins agents use PARALLELISM with additional load limit, e.g. PARALLELISM="16 -l 24" causing the linker to complain about not finding -l24 when lto is enabled. So only use the first element/the number of jobs to use and omit the load limit here. Change-Id: Ie3e2bdbde1b89d9371d1d9b9e426f42a91d2eca8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124288 Tested-by: Jenkins Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
Diffstat (limited to 'solenv')
-rw-r--r--solenv/gbuild/platform/com_GCC_defs.mk3
1 files changed, 2 insertions, 1 deletions
diff --git a/solenv/gbuild/platform/com_GCC_defs.mk b/solenv/gbuild/platform/com_GCC_defs.mk
index 2ca057c4f196..de3359f5dbd2 100644
--- a/solenv/gbuild/platform/com_GCC_defs.mk
+++ b/solenv/gbuild/platform/com_GCC_defs.mk
@@ -185,7 +185,8 @@ ifeq (,$(index,iOS MACOSX,$(OS)))
gb_LTOPLUGINFLAGS := --plugin $(if $(LD_PLUGIN),$(LD_PLUGIN),LLVMgold.so)
endif
else
-gb_LTOFLAGS := -flto=$(if $(filter-out 0,$(PARALLELISM)),$(PARALLELISM),auto) -fuse-linker-plugin -O2
+# use first element of the PARALLELISM, to allow values like "12 -l 14" to specify load limits
+gb_LTOFLAGS := -flto=$(if $(filter-out 0,$(PARALLELISM)),$(firstword $(PARALLELISM)),auto) -fuse-linker-plugin -O2
# clang does not support -flto=<number>
gb_CLANG_LTOFLAGS := -flto=thin
endif