build: fix dependency file generation with ENFORCE_UNIQUE_SYMBOLS=y
diff mbox series

Message ID 73dd65c0-188c-7ba0-46b8-339943642c72@suse.com
State New
Headers show
Series
  • build: fix dependency file generation with ENFORCE_UNIQUE_SYMBOLS=y
Related show

Commit Message

Jan Beulich Jan. 17, 2020, 3:44 p.m. UTC
The recorded file, unless overridden by -MQ (or -MT) is that specified
by -o, which doesn't produce correct dependencies and hence will cause
failure to re-build when included files change.

Fixes: 81ecb38b83b0 ("build: provide option to disambiguate symbol names")
Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>

Comments

Andrew Cooper Jan. 17, 2020, 4:32 p.m. UTC | #1
On 17/01/2020 15:44, Jan Beulich wrote:
> The recorded file, unless overridden by -MQ (or -MT) is that specified
> by -o, which doesn't produce correct dependencies and hence will cause
> failure to re-build when included files change.
>
> Fixes: 81ecb38b83b0 ("build: provide option to disambiguate symbol names")
> Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Thanks - this fixes my issue.

Tested-by: Andrew Cooper <andrew.cooper3@citrix.com>

Patch
diff mbox series

--- a/xen/Rules.mk
+++ b/xen/Rules.mk
@@ -195,7 +195,7 @@  SRCPATH := $(patsubst $(BASEDIR)/%,%,$(C
 
 %.o: %.c Makefile
 ifeq ($(CONFIG_ENFORCE_UNIQUE_SYMBOLS),y)
-	$(CC) $(CFLAGS) -c $< -o $(@D)/.$(@F).tmp
+	$(CC) $(CFLAGS) -c $< -o $(@D)/.$(@F).tmp -MQ $@
 ifeq ($(clang),y)
 	$(OBJCOPY) --redefine-sym $<=$(SRCPATH)/$< $(@D)/.$(@F).tmp $@
 else