public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [RFA] Fix automatic dependency tracking
@ 2017-10-08 23:16 Tom Tromey
  2017-10-09 10:33 ` Pedro Alves
  0 siblings, 1 reply; 2+ messages in thread
From: Tom Tromey @ 2017-10-08 23:16 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

This fixes the automatic dependency tracking bug I pointed out
eariler.  It restores the $(basename) wrapper so that the dependency
files are named "file.Po" rather than "file.o.Po".

I also tested the non-gcc3 dependency mode, which pointed out that
this case hadn't been working since the switch to C++.  This is also
fixed in this patch.

Tested by rebuilding.

gdb/ChangeLog
2017-10-08  Tom Tromey  <tom@tromey.com>

	* Makefile.in (COMPILE.post, POSTCOMPILE): Restore $(basename).
	(COMPILE.pre): Use $(CXX).
---
 gdb/ChangeLog   | 5 +++++
 gdb/Makefile.in | 9 +++++----
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index da4095d4a2..18e7750aba 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -2952,12 +2952,13 @@ 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 $(@D)/$(DEPDIR)/$(@F).Tpo
-override POSTCOMPILE = @mv $(@D)/$(DEPDIR)/$(@F).Tpo \
-	$(@D)/$(DEPDIR)/$(@F).Po
+	-MF $(@D)/$(DEPDIR)/$(basename $(@F)).Tpo
+override POSTCOMPILE = @mv $(@D)/$(DEPDIR)/$(basename $(@F)).Tpo \
+	$(@D)/$(DEPDIR)/$(basename $(@F)).Po
 else
 override COMPILE.pre = source='$<' object='$@' libtool=no \
-	DEPDIR=$(DEPDIR) $(DEPMODE) $(depcomp) $(CC)
+	DEPDIR=$(DEPDIR) $(DEPMODE) $(depcomp) \
+	$(CXX) -x c++ $(CXX_DIALECT)
 # depcomp handles atomicity for us, so we don't need a postcompile
 # step.
 override POSTCOMPILE =
-- 
2.13.6

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [RFA] Fix automatic dependency tracking
  2017-10-08 23:16 [RFA] Fix automatic dependency tracking Tom Tromey
@ 2017-10-09 10:33 ` Pedro Alves
  0 siblings, 0 replies; 2+ messages in thread
From: Pedro Alves @ 2017-10-09 10:33 UTC (permalink / raw)
  To: Tom Tromey, gdb-patches

On 10/09/2017 12:16 AM, Tom Tromey wrote:
> This fixes the automatic dependency tracking bug I pointed out
> eariler.  

This sentence won't make as much sense in isolation in the
commit log.  Please include the fuller description you had
in the other email here.  OK with that fix.  Please push.

Thanks!

Pedro Alves

> It restores the $(basename) wrapper so that the dependency
> files are named "file.Po" rather than "file.o.Po".
> 
> I also tested the non-gcc3 dependency mode, which pointed out that
> this case hadn't been working since the switch to C++.  This is also
> fixed in this patch.
> 
> Tested by rebuilding.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-10-09 10:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-08 23:16 [RFA] Fix automatic dependency tracking Tom Tromey
2017-10-09 10:33 ` Pedro Alves

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).