[Libreoffice-commits] core.git: solenv/gbuild

Luboš Luňák (via logerrit) logerrit at kemper.freedesktop.org
Thu May 9 09:02:22 UTC 2019


 solenv/gbuild/platform/com_GCC_class.mk |    1 +
 solenv/gbuild/platform/com_GCC_defs.mk  |   11 ++++++++++-
 2 files changed, 11 insertions(+), 1 deletion(-)

New commits:
commit b87b0171efb683ff03e99060c0d30474bc3c61e1
Author:     Luboš Luňák <l.lunak at collabora.com>
AuthorDate: Mon Mar 11 19:30:01 2019 +0100
Commit:     Luboš Luňák <l.lunak at collabora.com>
CommitDate: Thu May 9 11:00:51 2019 +0200

    use -fno-pch-timestamp when generating Clang PCH files
    
    Change-Id: I52ef8e81cb3899cc8d2b8729bd55ee98a0a1c77b
    Reviewed-on: https://gerrit.libreoffice.org/71565
    Tested-by: Jenkins
    Reviewed-by: Luboš Luňák <l.lunak at collabora.com>

diff --git a/solenv/gbuild/platform/com_GCC_class.mk b/solenv/gbuild/platform/com_GCC_class.mk
index 282aacbfd9ec..cad6db124f17 100644
--- a/solenv/gbuild/platform/com_GCC_class.mk
+++ b/solenv/gbuild/platform/com_GCC_class.mk
@@ -98,6 +98,7 @@ $(call gb_Helper_abbreviate_dirs,\
 		$(gb_COMPILERDEPFLAGS) \
 		$(if $(VISIBILITY),,$(gb_VISIBILITY_FLAGS)) \
 		$(if $(EXTERNAL_CODE),$(gb_CXXFLAGS_Wundef),$(gb_DEFS_INTERNAL)) \
+		$(gb_NO_PCH_TIMESTAMP) \
 		$(6) \
 		$(call gb_cxx_dep_generation_options,$(1),$(call gb_PrecompiledHeader_get_dep_target_tmp,$(2),$(7))) \
 		-c $(patsubst %.cxx,%.hxx,$(3)) \
diff --git a/solenv/gbuild/platform/com_GCC_defs.mk b/solenv/gbuild/platform/com_GCC_defs.mk
index 3946662d8f67..3f3273753364 100644
--- a/solenv/gbuild/platform/com_GCC_defs.mk
+++ b/solenv/gbuild/platform/com_GCC_defs.mk
@@ -137,9 +137,18 @@ gb_LinkTarget_LDFLAGS += -fstack-protector-strong
 endif
 
 ifeq ($(ENABLE_PCH),TRUE)
-ifneq ($(COM_IS_CLANG),TRUE)
+ifeq ($(COM_IS_CLANG),TRUE)
+# Clang by default includes in the PCH timestamps of the files it was
+# generated from, which would make the PCH be a "new" file for ccache
+# even if the file has not actually changed. Disabling the timestamp
+# prevents this at the cost of risking using an outdated PCH (which
+# should be unlikely, given that gbuild has dependencies set up
+# for our includes and system includes are unlikely to change).
+gb_NO_PCH_TIMESTAMP := -Xclang -fno-pch-timestamp
+else
 gb_CFLAGS_COMMON += -fpch-preprocess -Winvalid-pch
 gb_CXXFLAGS_COMMON += -fpch-preprocess -Winvalid-pch
+gb_NO_PCH_TIMESTAMP :=
 endif
 endif
 


More information about the Libreoffice-commits mailing list