Skip to contentSkip to conversation

kbuild: fix make -jN with multiple targets with O=...

DISCUSSION Benjamin LaHaise 2 participants 3 messages Feb 15, 2006 1 message not in the archive Kbuild

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Hello folks,

This patch causes a ~95% increase in build time for the kernel. Before:
4m21s after: 8m1.403s. Can we revert this until another approach is found?

-ben

On Mon, Jan 16, 2006 at 09:10:55PM -0800, Linux Kernel Mailing List wrote:
tree b918bb866edc339d51b2b71176265f6d424600e7
parent 60f33b80443a3e7e79e2a3ddc625ab6246a61d3d
author Sam Ravnborg <[email protected]> Sun, 15 Jan 2006 20:02:31 +0100 committer Sam Ravnborg <[email protected]> Sun, 15 Jan 2006 20:02:31 +0100

kbuild: fix make -jN with multiple targets with O=...

The way multiple targets was handled with make O=... broke because for each high-level target make spawned a parallel make resulting in a broken build. Reported by Keith Owens <[email protected]>

 Makefile |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
Makefile +4 -3
index deedaf7..b3dd9db 100644
@@ -106,12 +106,13 @@ KBUILD_OUTPUT := $(shell cd $(KBUILD_OUT
 $(if $(KBUILD_OUTPUT),, \
      $(error output directory "$(saved-output)" does not exist))
 
-.PHONY: $(MAKECMDGOALS)
+.PHONY: $(MAKECMDGOALS) cdbuilddir
+$(MAKECMDGOALS) _all: cdbuilddir
 
-$(filter-out _all,$(MAKECMDGOALS)) _all:
+cdbuilddir:
 	$(if $(KBUILD_VERBOSE:1=),@)$(MAKE) -C $(KBUILD_OUTPUT) \
 	KBUILD_SRC=$(CURDIR) \
-	KBUILD_EXTMOD="$(KBUILD_EXTMOD)" -f $(CURDIR)/Makefile $@
+	KBUILD_EXTMOD="$(KBUILD_EXTMOD)" -f $(CURDIR)/Makefile $(MAKECMDGOALS)
 
 # Leave processing to above invocation of make
 skip-makefile := 1
#2 lore raw
Quoted 6 lines · Benjamin LaHaise

Hello folks,

This patch causes a ~95% increase in build time for the kernel. Before:
4m21s after: 8m1.403s. Can we revert this until another approach is found?

Yowch. Is that with a regular old build-in-place, or is it specific to out-of-tree builds, or what?

Quoted 41 lines

-ben

On Mon, Jan 16, 2006 at 09:10:55PM -0800, Linux Kernel Mailing List wrote:
tree b918bb866edc339d51b2b71176265f6d424600e7
parent 60f33b80443a3e7e79e2a3ddc625ab6246a61d3d
author Sam Ravnborg <[email protected]> Sun, 15 Jan 2006 20:02:31 +0100 committer Sam Ravnborg <[email protected]> Sun, 15 Jan 2006 20:02:31 +0100

kbuild: fix make -jN with multiple targets with O=...

The way multiple targets was handled with make O=... broke because for each high-level target make spawned a parallel make resulting in a broken build. Reported by Keith Owens <[email protected]>

 Makefile |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
Makefile +4 -3
index deedaf7..b3dd9db 100644
@@ -106,12 +106,13 @@ KBUILD_OUTPUT := $(shell cd $(KBUILD_OUT
 $(if $(KBUILD_OUTPUT),, \
      $(error output directory "$(saved-output)" does not exist))
 
-.PHONY: $(MAKECMDGOALS)
+.PHONY: $(MAKECMDGOALS) cdbuilddir
+$(MAKECMDGOALS) _all: cdbuilddir
 
-$(filter-out _all,$(MAKECMDGOALS)) _all:
+cdbuilddir:
 	$(if $(KBUILD_VERBOSE:1=),@)$(MAKE) -C $(KBUILD_OUTPUT) \
 	KBUILD_SRC=$(CURDIR) \
-	KBUILD_EXTMOD="$(KBUILD_EXTMOD)" -f $(CURDIR)/Makefile $@
+	KBUILD_EXTMOD="$(KBUILD_EXTMOD)" -f $(CURDIR)/Makefile $(MAKECMDGOALS)
 
 # Leave processing to above invocation of make
 skip-makefile := 1
#3 lore raw
Quoted 10 lines · Andrew Morton
Quoted 6 lines · Benjamin LaHaise

Hello folks,

This patch causes a ~95% increase in build time for the kernel. Before:
4m21s after: 8m1.403s. Can we revert this until another approach is found?

Yowch. Is that with a regular old build-in-place, or is it specific to out-of-tree builds, or what?

It's just a plain old x86-64 build in place on Fedora. I'm game for testing any alternatives, but my kbuild-foo is not good enough to discern what the patch is trying to do and why it makes make unhappy.

-ben

Signature · 2 lines
"Ladies and gentlemen, I'm sorry to interrupt, but the police are here 
and they've asked us to stop the party."  Don't Email: <[email protected]>.