This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC] Replicate src dir in build dir


On 2017-09-20 10:02, Yao Qi wrote:
@@ -2941,9 +2949,9 @@ ifeq ($(DEPMODE),depmode=gcc3)
 # into place if the compile succeeds.  We need this because gcc does
 # not atomically write the dependency output file.
 override COMPILE.post = -c -o $@ -MT $@ -MMD -MP \
-	-MF $(DEPDIR)/$(basename $(@F)).Tpo
-override POSTCOMPILE = @mv $(DEPDIR)/$(basename $(@F)).Tpo \
-	$(DEPDIR)/$(basename $(@F)).Po
+	-MF $(@D)/$(DEPDIR)/$(@F).Tpo
+override POSTCOMPILE = @mv $(@D)/$(DEPDIR)/$(@F).Tpo \
+	$(@D)/$(DEPDIR)/$(@F).Po
 else
 override COMPILE.pre = source='$<' object='$@' libtool=no \
 	DEPDIR=$(DEPDIR) $(DEPMODE) $(depcomp) $(CC)

I have never tested it, but I assume the "depcomp" mode of dependency
management will have to be updated too.

I don't understand this comment.  The only change in on dependency
tracking is that .Po file is moved to a new place (.deps/amd64.Po ->
./arch/.deps/amd64.o.Po).  The file contents don't change.

$ diff -u .deps/amd64.Po ./arch/.deps/amd64.o.Po
--- .deps/amd64.Po	2017-09-20 07:57:04.903381133 +0000
+++ ./arch/.deps/amd64.o.Po	2017-09-20 07:40:35.995718460 +0000
@@ -1,4 +1,4 @@
-amd64.o: ../../binutils-gdb/gdb/arch/amd64.c \
+arch/amd64.o: ../../binutils-gdb/gdb/arch/amd64.c \
../../binutils-gdb/gdb/arch/amd64.h ../../binutils-gdb/gdb/arch/tdesc.h \ build-gnulib/import/stdint.h ../../binutils-gdb/gdb/common/x86-xstate.h \
  build-gnulib/import/stdlib.h \

I was wondering if this line needed changing

override COMPILE.pre = source='$<' object='$@' libtool=no \
	DEPDIR=$(DEPDIR) $(DEPMODE) $(depcomp) $(CC)

In particular, is DEPDIR treated as relative to the created object file or relative to the current working directory by depcomp. I honestly don't even know when this actually used.

Simon


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]