summaryrefslogtreecommitdiff
path: root/Module_tail_build.mk
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2012-05-15 19:34:46 +0200
committerMichael Stahl <mstahl@redhat.com>2012-05-15 19:37:19 +0200
commit6d1cef5d97aa6695db0874b4da30b952fb1c53ae (patch)
treec026e35b0fd619d841ceacc5ae0cde126d3c4da5 /Module_tail_build.mk
parentb936d537e4cf4d146afaa5d5aec665a2b5be3735 (diff)
try to serialize linking in tail_build a little
To hopefully reduce likelyhood of OOM related problems, especially with debug/symbols enabled, prevent linking 10 biggest libraries in parallel.
Diffstat (limited to 'Module_tail_build.mk')
-rw-r--r--Module_tail_build.mk18
1 files changed, 18 insertions, 0 deletions
diff --git a/Module_tail_build.mk b/Module_tail_build.mk
index cb000ca11ff8..cda607c62814 100644
--- a/Module_tail_build.mk
+++ b/Module_tail_build.mk
@@ -106,4 +106,22 @@ $(eval $(call gb_Module_add_targets,tail_end,\
))
endif
+# Especially when building everything with symbols, the linking of the largest
+# libraries takes enormous amounts of RAM. To prevent annoying OOM situations
+# etc., try to prevent linking these in parallel by adding artificial build
+# order dependencies here.
+define tailbuild_serialize1
+$(call gb_LinkTarget_get_target,$(call gb_Library_get_linktargetname,$(1))) \
+ :| $(foreach lib,$(2),$(call gb_Library_get_target,$(lib)))
+endef
+
+define tailbuild_serialize
+$(if $(filter-out 0 1,$(words $(1))),\
+$(call tailbuild_serialize1,$(firstword $(1)),$(wordlist 2,$(words $(1)),$(1))))
+$(if $(strip $(1)),\
+$(call tailbuild_serialize,$(wordlist 2,$(words $(1)),$(1))))
+endef
+
+$(eval $(call tailbuild_serialize,scfilt sc sw sd dbu ooxml oox svxcore vcl xo))
+
# vim: set noet sw=4 ts=4: