summaryrefslogtreecommitdiff
path: root/solenv/gbuild
diff options
context:
space:
mode:
authorChristian Lohmaier <lohmaier+LibreOffice@googlemail.com>2017-09-21 13:09:43 +0200
committerMichael Stahl <mstahl@redhat.com>2018-02-01 14:58:14 +0100
commit23961ff6c0c2d6f2d58ede3b4082554fc025ce6f (patch)
treefdbb22faa0a8ef44ef59b51eb949941f9aa16017 /solenv/gbuild
parentb52275dd26105524210dfba2f9a7d8bf7961cf8f (diff)
deps w/ hardlinks: don't create it as foo_ only to move it to foo
this breaks with CCACHE_HARDLINK=1 on close-enough rebuilds, as there will be "foo" from previous run (hardlinked to ccache-dir), and foo_ will be hardlink to the same file, resulting in mv to barf out since foo_ and foo are the same file (and -f/force doesn't help in this case) Change-Id: Iaefcec05b34dad88f49477693e2157c1ca0623ac Reviewed-on: https://gerrit.libreoffice.org/42586 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'solenv/gbuild')
-rw-r--r--solenv/gbuild/platform/com_GCC_class.mk10
1 files changed, 10 insertions, 0 deletions
diff --git a/solenv/gbuild/platform/com_GCC_class.mk b/solenv/gbuild/platform/com_GCC_class.mk
index efdefca98913..abcc7c953e1b 100644
--- a/solenv/gbuild/platform/com_GCC_class.mk
+++ b/solenv/gbuild/platform/com_GCC_class.mk
@@ -8,12 +8,22 @@
#
ifeq ($(gb_FULLDEPS),$(true))
+ifneq (,$(CCACHE_HARDLINK))
+# cannot move hardlink over itself, so create dep file directly, even if that
+# might leave a broken file beind in case the build is interrupted forcefully
+define gb_cxx_dep_generation_options
+-MMD -MT $(1) -MP -MF $(2)
+endef
+define gb_cxx_dep_copy
+endef
+else
define gb_cxx_dep_generation_options
-MMD -MT $(1) -MP -MF $(2)_
endef
define gb_cxx_dep_copy
&& mv $(1)_ $(1)
endef
+endif
else
define gb_cxx_dep_generation_options
endef