Skip to contentSkip to conversation

Put dependency files in proper subdir

PATCH Applied Jan Kiszka 4 participants 5 messages May 15, 2010 – May 22, 2010

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

PATCH 1/1 Put dependency files in proper subdir

From: Jan Kiszka <[email protected]>

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'.

---
 rules.mak |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
rules.mak +1 -1
index 7e10432..c843a13 100644
@@ -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)$@")

Signature · 1 line
1.6.0.2
author
#1 lore raw
Quoted 9 lines · Jan Kiszka

From: Jan Kiszka <[email protected]>

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

Quoted 22 lines

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

---
 rules.mak |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
rules.mak +1 -2
index 7e10432..c843a13 100644
@@ -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)$@")
Acked-by on v1 1/1
#2 lore raw
In reply to Jan Kiszka
Quoted 11 lines · Jan Kiszka

From: Jan Kiszka<[email protected]>

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'.

Paolo

Acked-by on v1 1/1
#3 lore raw
In reply to Jan Kiszka
Quoted 10 lines · Jan Kiszka

From: Jan Kiszka <[email protected]>

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".

Quoted 3 lines

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

Applied
#4 lore raw
In reply to Jan Kiszka

Thanks, applied.

Quoted 35 lines · Jan Kiszka

From: Jan Kiszka <[email protected]>

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'.

---
 rules.mak |    2 +-

 1 files changed, 1 insertions(+), 1 deletions(-)
rules.mak +0 -0
index 7e10432..c843a13 100644
@@ -12,7 +12,7 @@ MAKEFLAGS += -rR

 %.mak:

 # Flags for dependency generation

rules.mak +1 -1
-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