Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@ericsson.com>
To: <gdb-patches@sourceware.org>
Cc: Simon Marchi <simon.marchi@ericsson.com>
Subject: [PATCH] Fix dependency tracking in gdbserver subdirectories
Date: Thu, 19 Apr 2018 02:40:00 -0000	[thread overview]
Message-ID: <1524105605-24322-1-git-send-email-simon.marchi@ericsson.com> (raw)

The dependency tracking (the thing that knows which source file included
which other source file during last build to know what to rebuild when
an included file changes) is broken for gdbserver subdirectories (arch
and common).

The dependency tracking files are created in the form

  arch/.deps/i386.Po

but we try to include

  .deps/arch/i386.Po

An easy smoke test is too "touch" the gdb/features/i386/32bit-core.c
file in the source directory and try to rebuild gdbserver.  This file is
included by gdb/arch/i386.c, so it should cause
gdb/gdbserver/arch/i386.o in the build directory to be rebuilt.  It
currently isn't rebuilt, but is with this patch applied.

This patch copies the technique used in GDB to transform the dep file
paths to the proper form.

Also, while testing using the depcomp method of dependency tracking (by
just hacking the condition), I noticed that depcomp was not found.  The
path to depcomp seems to be missing a "..".

gdb/gdbserver/ChangeLog:

	* Makefile.in (depcomp): Add "..".
	(all_deps_files): New and use it.
---
 gdb/gdbserver/Makefile.in | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in
index 4a54235..c377378 100644
--- a/gdb/gdbserver/Makefile.in
+++ b/gdb/gdbserver/Makefile.in
@@ -62,7 +62,7 @@ AR_FLAGS = rc
 # Dependency tracking information.
 DEPMODE = @CCDEPMODE@
 DEPDIR = @DEPDIR@
-depcomp = $(SHELL) $(srcdir)/../depcomp
+depcomp = $(SHELL) $(srcdir)/../../depcomp
 
 # Directory containing source files.  Don't clean up the spacing,
 # this exact string is matched for by the "configure" script.
@@ -652,8 +652,12 @@ else
 $(all_object_files) : $(generated_files)
 endif
 
+# All the .deps files to include.
+all_deps_files = $(foreach dep,$(patsubst %.o,%.Po,$(all_object_files)),\
+		   $(dir $(dep))/$(DEPDIR)/$(notdir $(dep)))
+
 # Dependencies.
--include $(patsubst %.o, $(DEPDIR)/%.Po, $(all_object_files))
+-include $(all_deps_files)
 
 # Disable implicit make rules.
 include $(srcdir)/../disable-implicit-rules.mk
-- 
2.7.4


             reply	other threads:[~2018-04-19  2:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-19  2:40 Simon Marchi [this message]
2018-04-19 17:11 ` Pedro Alves
2018-04-19 17:20   ` Simon Marchi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1524105605-24322-1-git-send-email-simon.marchi@ericsson.com \
    --to=simon.marchi@ericsson.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox