Commit 2b5920edfa for qemu.org
commit 2b5920edfaff693acad867fe4a80149ea71d037b
Author: John Snow <jsnow@redhat.com>
Date: Mon Nov 9 13:36:05 2026 -0500
build: Add "-d keeprsp" to Ninja flags
When auditing compilation, it is helpful to be able to see all of the
object files passed during the linking step, which ninja can obscure
behind temporary .rsp "response files". Normally, these are deleted
immediately afterwards - but for debugging purposes, it is helpful to
leave them behind to understand what went wrong.
Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Link: https://lore.kernel.org/r/20261109183605.3210043-4-jsnow@redhat.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
diff --git a/Makefile b/Makefile
index 54547a37b1..9dda1b3c89 100644
--- a/Makefile
+++ b/Makefile
@@ -151,7 +151,7 @@ NINJAFLAGS = \
$(filter-out -j, \
$(or $(filter -l% -j%, $(MAKEFLAGS)), \
$(if $(filter --jobserver-auth=%, $(MAKEFLAGS)),, -j1))) \
- -d keepdepfile
+ -d keepdepfile $(if $(DEBUG),-d keeprsp)
ninja-cmd-goals += $(or $(MAKECMDGOALS), all)
ninja-cmd-goals += $(foreach g, $(MAKECMDGOALS), $(.ninja-goals.$g))