Skip to contentSkip to conversation

arm: fix parallel build (make -j)

kvm-unit-tests In review Peter Feiner 3 participants 7 messages Mar 3, 2016 – Mar 4, 2016 KVM

lore
Share & tools
lore
#0 lore raw

Dependency on asm-offsets.h wasn't made explicit in the Makefiles. Worked without -j because non-parallel make builds dependencies in declared order.

---
 arm/Makefile.common | 2 ++
 1 file changed, 2 insertions(+)
arm/Makefile.common +2 -0
index dd3a0ca..6de82cf 100644
@@ -71,3 +71,5 @@ test_cases: $(generated_files) $(tests-common) $(tests)
 
 $(TEST_DIR)/selftest.elf: $(cstart.o) $(TEST_DIR)/selftest.o
 $(TEST_DIR)/spinlock-test.elf: $(cstart.o) $(TEST_DIR)/spinlock-test.o
+
+$(TEST_DIR)/selftest.o $(TEST_DIR)/spinlock-test.o $(cstart.o): $(asm-offsets)
Signature · 1 line
2.7.0.rc3.207.g0ac5344
#1 lore raw
Quoted 14 lines · Peter Feiner

Dependency on asm-offsets.h wasn't made explicit in the Makefiles. Worked without -j because non-parallel make builds dependencies in declared order.

---
 arm/Makefile.common | 2 ++
 1 file changed, 2 insertions(+)
arm/Makefile.common +0 -0
index dd3a0ca..6de82cf 100644

arm/Makefile.common test_cases: $(generated_files) $(tests-common) $(tests) · line 75

Quoted 5 lines
arm/Makefile.common +2 -0
@@ -71,3 +71,5 @@ test_cases: $(generated_files) $(tests-common) $(tests)
 
 $(TEST_DIR)/selftest.elf: $(cstart.o) $(TEST_DIR)/selftest.o
 $(TEST_DIR)/spinlock-test.elf: $(cstart.o) $(TEST_DIR)/spinlock-test.o
+
+$(TEST_DIR)/selftest.o $(TEST_DIR)/spinlock-test.o $(cstart.o): $(asm-offsets)

You know a project is really growing when you need 'make -j' :-)

How about this patch instead though

-test_cases: $(generated_files) $(tests-common) $(tests) +test_cases: $(tests-common) $(tests)
+$(patsubst %.flat,%.o,$(tests-common) $(tests)) $(cstart.o): $(generated_files)

Or, hmm, actually any $(TEST_DIR)/ lib/$(TEST_DIR)/ or lib/$(ARCH)/ source file could depend on asm-offsets. So the above probably isn't sufficient for the long term either.

Thanks,
drew

Quoted 7 lines
Signature · 6 lines
2.7.0.rc3.207.g0ac5344

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
maintainer
#2 lore raw
Quoted 10 lines · Andrew Jones
Quoted 2 lines
Quoted 2 lines

+
+$(TEST_DIR)/selftest.o $(TEST_DIR)/spinlock-test.o $(cstart.o): $(asm-offsets)

You know a project is really growing when you need 'make -j' :-)

How about this patch instead though

(quoted diff) +2 -1
-test_cases: $(generated_files) $(tests-common) $(tests)
+test_cases: $(tests-common) $(tests)
+$(patsubst %.flat,%.o,$(tests-common) $(tests)) $(cstart.o): $(generated_files)
Quoted 3 lines

Or, hmm, actually any $(TEST_DIR)/ lib/$(TEST_DIR)/ or lib/$(ARCH)/ source file could depend on asm-offsets. So the above probably isn't sufficient for the long term either.

I expect a relatively small part of the .o files to need asm-offsets, so I'm going with Peter's patch.

Paolo

#3 lore raw
Quoted 13 lines · Paolo Bonzini
Quoted 10 lines · Andrew Jones
Quoted 2 lines
Quoted 2 lines

+
+$(TEST_DIR)/selftest.o $(TEST_DIR)/spinlock-test.o $(cstart.o): $(asm-offsets)

You know a project is really growing when you need 'make -j' :-)

How about this patch instead though

(quoted diff) +2 -1
-test_cases: $(generated_files) $(tests-common) $(tests)
+test_cases: $(tests-common) $(tests)
+$(patsubst %.flat,%.o,$(tests-common) $(tests)) $(cstart.o): $(generated_files)
Quoted 6 lines
Quoted 3 lines

Or, hmm, actually any $(TEST_DIR)/ lib/$(TEST_DIR)/ or lib/$(ARCH)/ source file could depend on asm-offsets. So the above probably isn't sufficient for the long term either.

I expect a relatively small part of the .o files to need asm-offsets, so I'm going with Peter's patch.

Well, his patch adds the dependency for $(TEST_DIR)/spinlock-test.o, which actually doesn't need it. We should either just put the ones that need it, or all of them.

Thanks,
drew

#4 lore raw
Quoted 21 lines · Andrew Jones
Quoted 13 lines · Paolo Bonzini
Quoted 10 lines · Andrew Jones
Quoted 2 lines
Quoted 2 lines

+
+$(TEST_DIR)/selftest.o $(TEST_DIR)/spinlock-test.o $(cstart.o): $(asm-offsets)

You know a project is really growing when you need 'make -j' :-)

How about this patch instead though

(quoted diff) +2 -1
-test_cases: $(generated_files) $(tests-common) $(tests)
+test_cases: $(tests-common) $(tests)
+$(patsubst %.flat,%.o,$(tests-common) $(tests)) $(cstart.o): $(generated_files)
Quoted 6 lines
Quoted 3 lines

Or, hmm, actually any $(TEST_DIR)/ lib/$(TEST_DIR)/ or lib/$(ARCH)/ source file could depend on asm-offsets. So the above probably isn't sufficient for the long term either.

I expect a relatively small part of the .o files to need asm-offsets, so I'm going with Peter's patch.

Quoted 3 lines

Well, his patch adds the dependency for $(TEST_DIR)/spinlock-test.o, which actually doesn't need it. We should either just put the ones that need it, or all of them.

My mistake! Evidently I can't read the output of grep properly. I'll send v2 with the minimal list of dependencies.

#5 lore raw

PATCH v2 1/1 arm: fix parallel build (make -j)

In reply to Peter Feiner

Dependency on asm-offsets.h wasn't made explicit in the Makefiles. Worked without -j because non-parallel make builds dependencies in declared order.

---

v2:
* Removed unnecessary dependency from spinlock-test.o

 arm/Makefile.common | 2 ++
 1 file changed, 2 insertions(+)
arm/Makefile.common +2 -0
index dd3a0ca..9a2d61f 100644
@@ -71,3 +71,5 @@ test_cases: $(generated_files) $(tests-common) $(tests)
 
 $(TEST_DIR)/selftest.elf: $(cstart.o) $(TEST_DIR)/selftest.o
 $(TEST_DIR)/spinlock-test.elf: $(cstart.o) $(TEST_DIR)/spinlock-test.o
+
+$(TEST_DIR)/selftest.o $(cstart.o): $(asm-offsets)
Signature · 1 line
2.7.0.rc3.207.g0ac5344
Reviewed-by on v2 1/1
#6 lore raw
Quoted 5 lines · Peter Feiner

Dependency on asm-offsets.h wasn't made explicit in the Makefiles. Worked without -j because non-parallel make builds dependencies in declared order.

Quoted 26 lines

---

v2:
* Removed unnecessary dependency from spinlock-test.o

 arm/Makefile.common | 2 ++
 1 file changed, 2 insertions(+)
arm/Makefile.common +2 -0
index dd3a0ca..9a2d61f 100644
@@ -71,3 +71,5 @@ test_cases: $(generated_files) $(tests-common) $(tests)
 
 $(TEST_DIR)/selftest.elf: $(cstart.o) $(TEST_DIR)/selftest.o
 $(TEST_DIR)/spinlock-test.elf: $(cstart.o) $(TEST_DIR)/spinlock-test.o
+
+$(TEST_DIR)/selftest.o $(cstart.o): $(asm-offsets)
Signature · 6 lines
2.7.0.rc3.207.g0ac5344

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html