Patchwork Put dependency files in proper subdir

login
register
mail settings
Submitter Jan Kiszka
Date May 15, 2010, 11:03 a.m.
Message ID <4BEE7F80.2090203@web.de>
Download mbox | patch
Permalink /patch/52704/
State New
Headers show

Comments

Jan Kiszka - May 15, 2010, 11:03 a.m.
From: Jan Kiszka <jan.kiszka@siemens.com>

This seems to resolve subtle breakages of our build system:

Dependency files generated for targets like 'dir/foo.o' were saved as
'foo.d'. Now, if there was also a target 'foo.o', one of the dependency
file was overwritten. Concrete example: libhw*/macio.o vs.
libhw*/ide/macio.o. And this often left a segfaulting build result
behind when changing the "wrong" data structures".

Fix it by generating proper 'dir/foo.d'.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 rules.mak |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

-o $@ $<,"  CC    $(TARGET_DIR)$@")
Jan Kiszka - May 15, 2010, 11:13 a.m.
Jan Kiszka wrote:
> From: Jan Kiszka <jan.kiszka@siemens.com>
> 
> This seems to resolve subtle breakages of our build system:
> 
> Dependency files generated for targets like 'dir/foo.o' were saved as
> 'foo.d'. Now, if there was also a target 'foo.o', one of the dependency
> file was overwritten. Concrete example: libhw*/macio.o vs.
> libhw*/ide/macio.o. And this often left a segfaulting build result
> behind when changing the "wrong" data structures".

Actually, most lethal was qdev.o vs. ide/qdev.o.

Jan

> 
> Fix it by generating proper 'dir/foo.d'.
> 
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
>  rules.mak |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/rules.mak b/rules.mak
> index 7e10432..c843a13 100644
> --- a/rules.mak
> +++ b/rules.mak
> @@ -12,7 +12,7 @@ MAKEFLAGS += -rR
>  %.mak:
> 
>  # Flags for dependency generation
> -QEMU_DGFLAGS += -MMD -MP -MT $@
> +QEMU_DGFLAGS += -MMD -MP -MT $@ -MF $(*D)/$(*F).d
> 
>  %.o: %.c
>  	$(call quiet-command,$(CC) $(QEMU_CFLAGS) $(QEMU_DGFLAGS) $(CFLAGS) -c
> -o $@ $<,"  CC    $(TARGET_DIR)$@")
Paolo Bonzini - May 16, 2010, 9:41 a.m.
On 05/15/2010 01:03 PM, Jan Kiszka wrote:
> From: Jan Kiszka<jan.kiszka@siemens.com>
>
> This seems to resolve subtle breakages of our build system:
>
> Dependency files generated for targets like 'dir/foo.o' were saved as
> 'foo.d'. Now, if there was also a target 'foo.o', one of the dependency
> file was overwritten. Concrete example: libhw*/macio.o vs.
> libhw*/ide/macio.o. And this often left a segfaulting build result
> behind when changing the "wrong" data structures".
>
> Fix it by generating proper 'dir/foo.d'.

Acked-by: Paolo Bonzini <pbonzini@redhat.com>

Paolo
Juan Quintela - May 16, 2010, 9:49 a.m.
Jan Kiszka <jan.kiszka@web.de> wrote:
> From: Jan Kiszka <jan.kiszka@siemens.com>
>
> This seems to resolve subtle breakages of our build system:
>
> Dependency files generated for targets like 'dir/foo.o' were saved as
> 'foo.d'. Now, if there was also a target 'foo.o', one of the dependency
> file was overwritten. Concrete example: libhw*/macio.o vs.
> libhw*/ide/macio.o. And this often left a segfaulting build result
> behind when changing the "wrong" data structures".
>
> Fix it by generating proper 'dir/foo.d'.
>
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>

Acked-by: Juan Quintela <quintela@redhat.com>
Blue Swirl - May 22, 2010, 9:27 a.m.
Thanks, applied.

On Sat, May 15, 2010 at 11:03 AM, Jan Kiszka <jan.kiszka@web.de> wrote:
> From: Jan Kiszka <jan.kiszka@siemens.com>
>
> This seems to resolve subtle breakages of our build system:
>
> Dependency files generated for targets like 'dir/foo.o' were saved as
> 'foo.d'. Now, if there was also a target 'foo.o', one of the dependency
> file was overwritten. Concrete example: libhw*/macio.o vs.
> libhw*/ide/macio.o. And this often left a segfaulting build result
> behind when changing the "wrong" data structures".
>
> Fix it by generating proper 'dir/foo.d'.
>
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
>  rules.mak |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/rules.mak b/rules.mak
> index 7e10432..c843a13 100644
> --- a/rules.mak
> +++ b/rules.mak
> @@ -12,7 +12,7 @@ MAKEFLAGS += -rR
>  %.mak:
>
>  # Flags for dependency generation
> -QEMU_DGFLAGS += -MMD -MP -MT $@
> +QEMU_DGFLAGS += -MMD -MP -MT $@ -MF $(*D)/$(*F).d
>
>  %.o: %.c
>        $(call quiet-command,$(CC) $(QEMU_CFLAGS) $(QEMU_DGFLAGS) $(CFLAGS) -c
> -o $@ $<,"  CC    $(TARGET_DIR)$@")
> --
> 1.6.0.2
>
>

Patch

diff --git a/rules.mak b/rules.mak
index 7e10432..c843a13 100644
--- a/rules.mak
+++ b/rules.mak
@@ -12,7 +12,7 @@  MAKEFLAGS += -rR
 %.mak:

 # Flags for dependency generation
-QEMU_DGFLAGS += -MMD -MP -MT $@
+QEMU_DGFLAGS += -MMD -MP -MT $@ -MF $(*D)/$(*F).d

 %.o: %.c
 	$(call quiet-command,$(CC) $(QEMU_CFLAGS) $(QEMU_DGFLAGS) $(CFLAGS) -c