Kaydet (Commit) 475cf23e authored tarafından Michael Stahl's avatar Michael Stahl

gbuild: incremental builds with --enable-pch are unsound

The problem is that the precompiled headers' dependency files are not
run through concat-deps, hence they directly refer to headers of
external libraries' headers, which are not targets in the build system;
therefore re-building an external library does not cause the dependent
PCH to re-build and (at least with MSVC) the object files don't depend
on headers included via PCH anyway, so we get the recent link failure
in comphelper with MSVC, which wasn't rebuilt for icu's ABI change.

To fix that just use concat-deps, which re-writes header dependencies to
UnpackedTarball target dependencies.

Change-Id: Ic7555822925aaa1ff09b29bb73801fb83923bfab
üst edc56421
......@@ -34,9 +34,18 @@ $(call gb_PrecompiledHeader_get_dep_target,%) :
mkdir -p $(dir $@) && \
echo "$(call gb_PrecompiledHeader_get_target,$*) : $(gb_Helper_PHONY)" > $@)
# despite this being only one .d file, need to run concat-deps on it to
# re-write external headers from UnpackedTarball
$(call gb_PrecompiledHeader_get_target,%) :
rm -f $@
$(call gb_PrecompiledHeader__command,$@,$*,$<,$(PCH_DEFS),$(PCH_CXXFLAGS) $(gb_PrecompiledHeader_EXCEPTIONFLAGS),$(INCLUDE))
ifeq ($(gb_FULLDEPS),$(true))
$(call gb_Helper_abbreviate_dirs,\
RESPONSEFILE=$(call var2file,$(shell $(gb_MKTEMP)),200,$(call gb_PrecompiledHeader_get_dep_target_tmp,$*)) && \
$(call gb_Executable_get_command,concat-deps) $${RESPONSEFILE} \
> $(call gb_PrecompiledHeader_get_dep_target,$*) && \
rm -f $${RESPONSEFILE} $(call gb_PrecompiledHeader_get_dep_target_tmp,$*))
endif
.PHONY : $(call gb_PrecompiledHeader_get_clean_target,%)
$(call gb_PrecompiledHeader_get_clean_target,%) :
......
......@@ -132,6 +132,7 @@ gb_PackageSet_get_target = $(WORKDIR)/PackageSet/$(1).filelist
gb_PackageInfo_get_target = $(WORKDIR)/PackageInfo
gb_Postprocess_get_target = $(WORKDIR)/Postprocess/$(1)
gb_PrecompiledHeader_get_dep_target = $(WORKDIR)/Dep/PrecompiledHeader/$(gb_PrecompiledHeader_DEBUGDIR)/$(1).hxx.gch.d
gb_PrecompiledHeader_get_dep_target_tmp = $(call gb_PrecompiledHeader_get_dep_target,$(1)).tmp
gb_PrecompiledHeader_get_target = $(WORKDIR)/PrecompiledHeader/$(gb_PrecompiledHeader_DEBUGDIR)/$(1).hxx.gch
gb_PrecompiledHeader_get_timestamp = $(WORKDIR)/PrecompiledHeader/$(gb_PrecompiledHeader_DEBUGDIR)/Timestamps/$(1)
gb_PropertiesTranslateTarget_get_target = $(WORKDIR)/PropertiesTranslateTarget/$(1).properties
......
......@@ -173,10 +173,10 @@ $(call gb_Helper_abbreviate_dirs,\
$(if $(VISIBILITY),,$(gb_VISIBILITY_FLAGS)) \
$(if $(EXTERNAL_CODE),$(gb_CXXFLAGS_Wundef),$(gb_DEFS_INTERNAL)) \
$(6) \
$(call gb_cxx_dep_generation_options,$(1),$(call gb_PrecompiledHeader_get_dep_target,$(2))) \
$(call gb_cxx_dep_generation_options,$(1),$(call gb_PrecompiledHeader_get_dep_target_tmp,$(2))) \
-c $(patsubst %.cxx,%.hxx,$(3)) \
-o$(1) \
$(call gb_cxx_dep_copy,$(call gb_PrecompiledHeader_get_dep_target,$(2))) \
$(call gb_cxx_dep_copy,$(call gb_PrecompiledHeader_get_dep_target_tmp,$(2))) \
)
endef
......
......@@ -85,7 +85,7 @@ $(call gb_Helper_abbreviate_dirs,\
-I$(dir $(3)) \
$(6) \
-c $(3) \
-Yc$(notdir $(patsubst %.cxx,%.hxx,$(3))) -Fp$(1) -Fo$(1).obj) $(call gb_create_deps,$(call gb_PrecompiledHeader_get_dep_target,$(2)),$(1),$(3))
-Yc$(notdir $(patsubst %.cxx,%.hxx,$(3))) -Fp$(1) -Fo$(1).obj) $(call gb_create_deps,$(call gb_PrecompiledHeader_get_dep_target_tmp,$(2)),$(1),$(3))
endef
# AsmObject class
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment