From: Arsen Arsenović Date: Wed, 29 Jan 2025 20:14:33 +0000 (+0100) Subject: d: give dependency files better filenames [PR118477] X-Git-Tag: releases/gcc-12.5.0~97 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=056de2a74ba57ce4afb38f2e8865b76f19d82d14;p=thirdparty%2Fgcc.git d: give dependency files better filenames [PR118477] Currently, the dependency files for root-file.o and common-file.o were both d/.deps/file.Po, which would cause parallel builds to fail sometimes with: make[3]: Leaving directory '/var/tmp/portage/sys-devel/gcc-14.1.1_p20240511/work/build/gcc' make[3]: Entering directory '/var/tmp/portage/sys-devel/gcc-14.1.1_p20240511/work/build/gcc' mv: cannot stat 'd/.deps/file.TPo': No such file or directory make[3]: *** [/var/tmp/portage/sys-devel/gcc-14.1.1_p20240511/work/gcc-14-20240511/gcc/d/Make-lang.in:421: d/root-file.o] Error 1 shuffle=131581365 Also, this means that dependencies of one of root-file or common-file are missing when developing. After this patch, those two files get assigned dependency files d/.deps/root-file.Po and d/.deps/common-file.Po respectively, so match the actual object files in the d/ subdirectory. There are other files with similar conflicts (mangle-package.o, visitor-package.o for instance). 2025-01-29 Arsen Arsenović Jakub Jelinek PR d/118477 * Make-lang.in (DCOMPILE, DPOSTCOMPILE): Use $(basename $(@F)) instead of $(*F). Co-Authored-By: Jakub Jelinek (cherry picked from commit d9ac0ad1e9a4ceec2d354ac0368da7462bea5675) --- diff --git a/gcc/d/Make-lang.in b/gcc/d/Make-lang.in index f3e34c54015..d3db0a46a56 100644 --- a/gcc/d/Make-lang.in +++ b/gcc/d/Make-lang.in @@ -61,8 +61,8 @@ ALL_DFLAGS = $(DFLAGS-$@) $(GDCFLAGS) -fversion=IN_GCC $(CHECKING_DFLAGS) \ $(PICFLAG) $(ALIASING_FLAGS) $(COVERAGE_FLAGS) $(WARN_DFLAGS) DCOMPILE.base = $(GDC) $(NO_PIE_CFLAGS) -c $(ALL_DFLAGS) -o $@ -DCOMPILE = $(DCOMPILE.base) -MT $@ -MMD -MP -MF $(@D)/$(DEPDIR)/$(*F).TPo -DPOSTCOMPILE = @mv $(@D)/$(DEPDIR)/$(*F).TPo $(@D)/$(DEPDIR)/$(*F).Po +DCOMPILE = $(DCOMPILE.base) -MT $@ -MMD -MP -MF $(@D)/$(DEPDIR)/$(basename $(@F)).TPo +DPOSTCOMPILE = @mv $(@D)/$(DEPDIR)/$(basename $(@F)).TPo $(@D)/$(DEPDIR)/$(basename $(@F)).Po DLINKER = $(GDC) $(NO_PIE_FLAG) -lstdc++ # Like LINKER, but use a mutex for serializing front end links.