[3/7] gdbserver: fix missing dependency tracking for gdbreplay.o

Message ID 20260831185300.572297-4-simon.marchi@efficios.com
State New
Headers
Series Some Makefile cleanups |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gdb_build--master-arm fail Patch failed to apply
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 fail Patch failed to apply

Commit Message

Simon Marchi Aug. 31, 2026, 6:51 p.m. UTC
  The rule for gdbreplay.o uses $(COMPILE.post), which makes the
compiler write the dependencies to $(DEPDIR)/gdbreplay.Tpo, but it does
not run $(POSTCOMPILE), which is what renames the .Tpo file to .Po.

After building gdbreplay, we are left with:

    $ make gdbreplay
      CXX    gdbreplay.o
      CXX    utils.o
      GEN    version-generated.cc
      CXX    version.o
      CXXLD  gdbreplay                                                                                  /0.1s
    $ ls -1 .deps
    gdbreplay.Tpo
    utils.Po
    version.Po

This means that a change in a header file included by gdbreplay.cc will
not cause a rebuild.

Add the missing $(POSTCOMPILE) invocation.

Change-Id: Iea5ca939cf30a0fe892ed3d2c224d22f227f0272
---
 gdbserver/Makefile.in | 1 +
 1 file changed, 1 insertion(+)
  

Comments

Tom Tromey Sept. 1, 2026, 4:33 p.m. UTC | #1
>>>>> "Simon" == Simon Marchi <simon.marchi@efficios.com> writes:

Simon> The rule for gdbreplay.o uses $(COMPILE.post), which makes the
Simon> compiler write the dependencies to $(DEPDIR)/gdbreplay.Tpo, but it does
Simon> not run $(POSTCOMPILE), which is what renames the .Tpo file to .Po.

Ok.
Approved-By: Tom Tromey <tom@tromey.com>

Tom
  

Patch

diff --git a/gdbserver/Makefile.in b/gdbserver/Makefile.in
index b06e0b86e45b..3a3c8e62d14f 100644
--- a/gdbserver/Makefile.in
+++ b/gdbserver/Makefile.in
@@ -592,6 +592,7 @@  target/%.o: ../gdb/target/%.c
 gdbreplay.o: gdbreplay.cc
 	$(ECHO_CXX) $(COMPILE.pre) $(INTERNAL_CFLAGS) $(CXXFLAGS) \
 		-include gdbsupport/common-defs.h $(COMPILE.post) $<
+	$(POSTCOMPILE)
 
 #
 # Dependency tracking.