consolidate i386 & x86-64 user dir make rules
PATCH 1/2 consolidate i386 & x86-64 user dir make rules
This patch removes arch specific make rules for x86 & x86-64 out of the main Makefile. These rules are now moved into config-$(ARCH) and a new file config-x86-common has been created to consolidate common rules amongst x86 & x86-64.
v1 changes:
*fix x86-64 building by removing redundant rules from
config-x86-64.mak
user/Makefile +1 -17
@@ -15,8 +15,7 @@ cc-option = $(shell if $(CC) $(1) -S -o cc-option = $(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null \ > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;) -CFLAGS += -I $(KERNELDIR)/include $(autodepend-flags) -g -fomit-frame-pointer \ - -Wall +CFLAGS += $(autodepend-flags) -g -fomit-frame-pointer -Wall CFLAGS += $(call cc-option, -fno-stack-protector, "") CFLAGS += $(call cc-option, -fno-stack-protector-all, "")
@@ -25,21 +24,6 @@ CXXFLAGS = $(autodepend-flags) CXXFLAGS = $(autodepend-flags) autodepend-flags = -MMD -MF $(dir $*).$(notdir $*).d - -all: kvmctl libkvm.a flatfiles - -kvmctl: LDFLAGS += -pthread -lrt - -kvmctl: kvmctl.o main.o - -balloon_ctl: balloon_ctl.o - -libkvm.a: kvmctl.o - $(AR) rcs $@ $^ - -flatfiles-common = test/bootstrap test/vmexit.flat test/smp.flat - -flatfiles: $(flatfiles-common) $(flatfiles) install: install -D kvmctl.h $(DESTDIR)/$(PREFIX)/include/kvmctl.h
user/config-i386.mak +4 -0
@@ -3,5 +3,9 @@ bits = 32 bits = 32 ldarch = elf32-i386 CFLAGS += -m32 +CFLAGS += -D__i386__ +CFLAGS += -I $(KERNELDIR)/include flatfiles= + +include config-x86-common.mak
user/config-x86-common.mak new file +16 -0
@@ -0,0 +1,16 @@ +#This is a make file with common rules for both x86 & x86-64 + +all: kvmctl libkvm.a flatfiles + +kvmctl: LDFLAGS += -pthread -lrt + +kvmctl: kvmctl.o main.o + +libkvm.a: kvmctl.o + $(AR) rcs $@ $^ + +balloon_ctl: balloon_ctl.o + +flatfiles-common = test/bootstrap test/vmexit.flat test/smp.flat + +flatfiles: $(flatfiles-common) $(flatfiles)
user/config-x86_64.mak +4 -0
@@ -3,5 +3,9 @@ bits = 64 bits = 64 ldarch = elf64-x86-64 CFLAGS += -m64 +CFLAGS += -D__x86_64__ +CFLAGS += -I $(KERNELDIR)/include flatfiles = test/access.flat test/irq.flat test/sieve.flat test/simple.flat test/stringio.flat test/memtest1.flat + +include config-x86-common.mak
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/
Quoted 15 lines · Jerone Young
This patch removes arch specific make rules for x86 & x86-64 out of the main
Makefile. These rules are now moved into config-$(ARCH) and a new file config-x86-common has been created to consolidate common rules amongst x86 & x86-64.v1 changes:
*fix x86-64 building by removing redundant rules from
config-x86-64.makSigned-off-by Jerone Young <jyoung5-r/[email protected]>
user/Makefile cc-option = $(shell if $(CC) $(1) -S -o · line 20
Quoted 8 lines
user/Makefile +1
-2@@ -15,8 +15,7 @@ cc-option = $(shell if $(CC) $(1) -S -o cc-option = $(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null \ > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;) -CFLAGS += -I $(KERNELDIR)/include $(autodepend-flags) -g -fomit-frame-pointer \ - -Wall +CFLAGS += $(autodepend-flags) -g -fomit-frame-pointer -Wall CFLAGS += $(call cc-option, -fno-stack-protector, "") CFLAGS += $(call cc-option, -fno-stack-protector-all, "")
You seem to be adding "-I $(KERNELDIR)/include" twice: once here, and once in each config-*.mak file.
Quoted 60 lines
user/Makefile +0
-15@@ -25,21 +24,6 @@ CXXFLAGS = $(autodepend-flags) CXXFLAGS = $(autodepend-flags) autodepend-flags = -MMD -MF $(dir $*).$(notdir $*).d - -all: kvmctl libkvm.a flatfiles - -kvmctl: LDFLAGS += -pthread -lrt - -kvmctl: kvmctl.o main.o - -balloon_ctl: balloon_ctl.o - -libkvm.a: kvmctl.o - $(AR) rcs $@ $^ - -flatfiles-common = test/bootstrap test/vmexit.flat test/smp.flat - -flatfiles: $(flatfiles-common) $(flatfiles) install: install -D kvmctl.h $(DESTDIR)/$(PREFIX)/include/kvmctl.huser/config-i386.mak +4
-0@@ -3,5 +3,9 @@ bits = 32 bits = 32 ldarch = elf32-i386 CFLAGS += -m32 +CFLAGS += -D__i386__ +CFLAGS += -I $(KERNELDIR)/include flatfiles= + +include config-x86-common.makuser/config-x86-common.mak new file +16
-0@@ -0,0 +1,16 @@ +#This is a make file with common rules for both x86 & x86-64 + +all: kvmctl libkvm.a flatfiles + +kvmctl: LDFLAGS += -pthread -lrt + +kvmctl: kvmctl.o main.o + +libkvm.a: kvmctl.o + $(AR) rcs $@ $^ + +balloon_ctl: balloon_ctl.o + +flatfiles-common = test/bootstrap test/vmexit.flat test/smp.flat + +flatfiles: $(flatfiles-common) $(flatfiles)
user/config-x86_64.mak bits = 64 · line 11
Quoted 9 lines
user/config-x86_64.mak +4
-0@@ -3,5 +3,9 @@ bits = 64 bits = 64 ldarch = elf64-x86-64 CFLAGS += -m64 +CFLAGS += -D__x86_64__ +CFLAGS += -I $(KERNELDIR)/include flatfiles = test/access.flat test/irq.flat test/sieve.flat test/simple.flat test/stringio.flat test/memtest1.flat + +include config-x86-common.mak
I think you're clobbering flatfiles in config-x86-common.mak .
Philosophically, I don't think that targets like "all" should be moved into arch-specific makefiles. Also, the kvmctl and libkvm.a targets should both be in the common Makefile.
Signature · 9 lines
Hollis Blanchard IBM Linux Technology Center ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/
Quoted 9 lines · Hollis Blanchard
user/Makefile cc-option = $(shell if $(CC) $(1) -S -o · line 20
Quoted 6 lines
user/Makefile +1
-2-CFLAGS += -I $(KERNELDIR)/include $(autodepend-flags) -g -fomit-frame-pointer \ - -Wall +CFLAGS += $(autodepend-flags) -g -fomit-frame-pointer -Wall CFLAGS += $(call cc-option, -fno-stack-protector, "") CFLAGS += $(call cc-option, -fno-stack-protector-all, "")You seem to be adding "-I $(KERNELDIR)/include" twice: once here, and once in each config-*.mak file.
My bad; I read the diff backwards. :)
Are you sure about that move though? Why doesn't every arch need that -I switch?
Signature · 9 lines
Hollis Blanchard IBM Linux Technology Center ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/
Quoted 11 lines · Hollis Blanchard
Quoted 9 lines · Hollis Blanchard
user/Makefile cc-option = $(shell if $(CC) $(1) -S -o · line 20
Quoted 6 lines
user/Makefile +1
-2-CFLAGS += -I $(KERNELDIR)/include $(autodepend-flags) -g -fomit-frame-pointer \ - -Wall +CFLAGS += $(autodepend-flags) -g -fomit-frame-pointer -Wall CFLAGS += $(call cc-option, -fno-stack-protector, "") CFLAGS += $(call cc-option, -fno-stack-protector-all, "")You seem to be adding "-I $(KERNELDIR)/include" twice: once here, and once in each config-*.mak file.
Quoted 4 lines
My bad; I read the diff backwards. :)
Are you sure about that move though? Why doesn't every arch need that -I switch?
Actually no. For our powerpc stuff having -I $(KERNELDIR)/include causes hell with errno.h & it's definitions. Since we do not include any of the kernel headers in our codes we don't need this, but x86 does as it includes nice headears like "linux/paravirt.h".
Now including kernel headers is a totally different argument. But basically from what I know is you should "never" do it.
Quoted 1 line
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/
Quoted 94 lines · Hollis Blanchard
Quoted 15 lines · Jerone Young
This patch removes arch specific make rules for x86 & x86-64 out of the main
Makefile. These rules are now moved into config-$(ARCH) and a new file config-x86-common has been created to consolidate common rules amongst x86 & x86-64.v1 changes:
*fix x86-64 building by removing redundant rules from
config-x86-64.makSigned-off-by Jerone Young <jyoung5-r/[email protected]>user/Makefile cc-option = $(shell if $(CC) $(1) -S -o · line 20
Quoted 8 lines
user/Makefile +1
-2@@ -15,8 +15,7 @@ cc-option = $(shell if $(CC) $(1) -S -o cc-option = $(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null \ > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;) -CFLAGS += -I $(KERNELDIR)/include $(autodepend-flags) -g -fomit-frame-pointer \ - -Wall +CFLAGS += $(autodepend-flags) -g -fomit-frame-pointer -Wall CFLAGS += $(call cc-option, -fno-stack-protector, "") CFLAGS += $(call cc-option, -fno-stack-protector-all, "")You seem to be adding "-I $(KERNELDIR)/include" twice: once here, and once in each config-*.mak file.
Quoted 66 lines
user/Makefile +0
-15@@ -25,21 +24,6 @@ CXXFLAGS = $(autodepend-flags) CXXFLAGS = $(autodepend-flags) autodepend-flags = -MMD -MF $(dir $*).$(notdir $*).d - -all: kvmctl libkvm.a flatfiles - -kvmctl: LDFLAGS += -pthread -lrt - -kvmctl: kvmctl.o main.o - -balloon_ctl: balloon_ctl.o - -libkvm.a: kvmctl.o - $(AR) rcs $@ $^ - -flatfiles-common = test/bootstrap test/vmexit.flat test/smp.flat - -flatfiles: $(flatfiles-common) $(flatfiles) install: install -D kvmctl.h $(DESTDIR)/$(PREFIX)/include/kvmctl.huser/config-i386.mak +4
-0@@ -3,5 +3,9 @@ bits = 32 bits = 32 ldarch = elf32-i386 CFLAGS += -m32 +CFLAGS += -D__i386__ +CFLAGS += -I $(KERNELDIR)/include flatfiles= + +include config-x86-common.makuser/config-x86-common.mak new file +16
-0@@ -0,0 +1,16 @@ +#This is a make file with common rules for both x86 & x86-64 + +all: kvmctl libkvm.a flatfiles + +kvmctl: LDFLAGS += -pthread -lrt + +kvmctl: kvmctl.o main.o + +libkvm.a: kvmctl.o + $(AR) rcs $@ $^ + +balloon_ctl: balloon_ctl.o + +flatfiles-common = test/bootstrap test/vmexit.flat test/smp.flat + +flatfiles: $(flatfiles-common) $(flatfiles)user/config-x86_64.mak +2
-0@@ -3,5 +3,9 @@ bits = 64 bits = 64 ldarch = elf64-x86-64 CFLAGS += -m64 +CFLAGS += -D__x86_64__ +CFLAGS += -I $(KERNELDIR)/include
Quoted 5 lines
user/config-x86_64.mak bits = 64 · line 11
Quoted 3 lines
user/config-x86_64.mak +2
-0flatfiles = test/access.flat test/irq.flat test/sieve.flat test/simple.flat test/stringio.flat test/memtest1.flat + +include config-x86-common.makI think you're clobbering flatfiles in config-x86-common.mak .
PATCH 2 moves all the rest of the flatfile rules to config-x86-common.mak. So nothing gets clobbered.
Quoted 4 lines
Philosophically, I don't think that targets like "all" should be moved into arch-specific makefiles. Also, the kvmctl and libkvm.a targets should both be in the common
Makefile.
So "all" is going to be different for everyone. Since all the test are not common, and all will not use flat files.
Also kvmctl ad libkvm.a will be diffrenent for everyone. But this could also be made into a variable. With new split code (soon to be coming to a kvm-devel list near you). Here is an example of how it will look later. The names may change but you get the idea.
Examples x86:
kvmctl: kvmctl-x86.o kvmctl.o main-x86.o main.o
libkvm.a: kvmctl.o kvmctl-x86.o
This split may also grow more .. as maybe the apic stuff will get
moved to it's own file.
Example Powerpc:
kvmctl: kvmctl-powerpc.o kvmctl.o main.o main-x86.o
Now one way could be is to create a variable in the arch specific makefiles for kvmctl & libkvm . So that for x86 you woud have
KVMCTL= kvmctl-x86.o kvmctl.o main-x86.o main.o
Then in the main Makefile.
kvmctl: $(KVMCTL)
I personally think having the declaration in each arch makes things less confusing.
So for this patch it's mainly about keeping things working today, while
slowly splitting things apart. Future patches will change all of this.
Quoted 1 line
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/
Quoted 32 lines · Jerone Young
Quoted 31 lines · Hollis Blanchard
Quoted 31 lines
user/config-x86-common.mak new file +16
-0@@ -0,0 +1,16 @@ +#This is a make file with common rules for both x86 & x86-64 + +all: kvmctl libkvm.a flatfiles + +kvmctl: LDFLAGS += -pthread -lrt + +kvmctl: kvmctl.o main.o + +libkvm.a: kvmctl.o + $(AR) rcs $@ $^ + +balloon_ctl: balloon_ctl.o + +flatfiles-common = test/bootstrap test/vmexit.flat test/smp.flat + +flatfiles: $(flatfiles-common) $(flatfiles)user/config-x86_64.mak +2
-0@@ -3,5 +3,9 @@ bits = 64 bits = 64 ldarch = elf64-x86-64 CFLAGS += -m64 +CFLAGS += -D__x86_64__ +CFLAGS += -I $(KERNELDIR)/include
Quoted 8 lines
Quoted 5 lines
user/config-x86_64.mak bits = 64 · line 11
Quoted 3 lines
user/config-x86_64.mak +2
-0flatfiles = test/access.flat test/irq.flat test/sieve.flat test/simple.flat test/stringio.flat test/memtest1.flat + +include config-x86-common.makI think you're clobbering flatfiles in config-x86-common.mak .
PATCH 2 moves all the rest of the flatfile rules to config-x86-common.mak. So nothing gets clobbered.
But THIS patch clobbers it.
Quoted 25 lines
Quoted 3 lines
Philosophically, I don't think that targets like "all" should be moved into arch-specific makefiles. Also, the kvmctl and libkvm.a targets should both be in the common
Makefile.So "all" is going to be different for everyone. Since all the test are not common, and all will not use flat files.
Also kvmctl ad libkvm.a will be diffrenent for everyone. But this could also be made into a variable. With new split code (soon to be coming to a kvm-devel list near you). Here is an example of how it will look later. The names may change but you get the idea.
Examples x86:
kvmctl: kvmctl-x86.o kvmctl.o main-x86.o main.olibkvm.a: kvmctl.o kvmctl-x86.o
This split may also grow more .. as maybe the apic stuff will get
moved to it's own file.Example Powerpc:
kvmctl: kvmctl-powerpc.o kvmctl.o main.o main-x86.o
Quoted 8 lines
Now one way could be is to create a variable in the arch specific makefiles for kvmctl & libkvm . So that for x86 you woud have
KVMCTL= kvmctl-x86.o kvmctl.o main-x86.o main.o
Then in the main
Makefile.kvmctl: $(KVMCTL)
Exactly: that way we can ensure that every arch builds a common set of targets.
Quoted 2 lines
I personally think having the declaration in each arch makes things less confusing.
I can't tell if you're agreeing or if you forgot a negative. I agree that each arch should define e.g. "kvmctl_objs".
Signature · 9 lines
Hollis Blanchard IBM Linux Technology Center ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/
Quoted 39 lines · Hollis Blanchard
Quoted 38 lines · Jerone Young
Quoted 36 lines · Hollis Blanchard
Quoted 25 lines
user/config-x86-common.mak new file +16
-0@@ -0,0 +1,16 @@ +#This is a make file with common rules for both x86 & x86-64 + +all: kvmctl libkvm.a flatfiles + +kvmctl: LDFLAGS += -pthread -lrt + +kvmctl: kvmctl.o main.o + +libkvm.a: kvmctl.o + $(AR) rcs $@ $^ + +balloon_ctl: balloon_ctl.o + +flatfiles-common = test/bootstrap test/vmexit.flat test/smp.flat + +flatfiles: $(flatfiles-common) $(flatfiles)user/config-x86_64.mak bits = 64 · line 11
Quoted 9 lines
user/config-x86_64.mak +4
-0@@ -3,5 +3,9 @@ bits = 64 bits = 64 ldarch = elf64-x86-64 CFLAGS += -m64 +CFLAGS += -D__x86_64__ +CFLAGS += -I $(KERNELDIR)/include flatfiles = test/access.flat test/irq.flat test/sieve.flat test/simple.flat test/stringio.flat test/memtest1.flat + +include config-x86-common.makI think you're clobbering flatfiles in config-x86-common.mak .
Quoted 4 lines
Quoted 2 lines
PATCH 2 moves all the rest of the flatfile rules to config-x86-common.mak. So nothing gets clobbered.
But THIS patch clobbers it.
Oh, It does not clobber flatfiles. It uses it. So in config-x86-common.mak there is a rule
flatfiles: $(flatfiles-common) $(flatfiles)
Acutally I thought the same too. But this is actually in the original makefile. It doesn't clobber it apparently. But for saftey I'll change the name of this rule as it shouldn't be the same name as variable.
Quoted 35 lines
Quoted 26 lines
Quoted 4 lines
Philosophically, I don't think that targets like "all" should be moved into arch-specific makefiles. Also, the kvmctl and libkvm.a targets should both be in the common
Makefile.So "all" is going to be different for everyone. Since all the test are not common, and all will not use flat files.
Also kvmctl ad libkvm.a will be diffrenent for everyone. But this could also be made into a variable. With new split code (soon to be coming to a kvm-devel list near you). Here is an example of how it will look later. The names may change but you get the idea.
Examples x86:
kvmctl: kvmctl-x86.o kvmctl.o main-x86.o main.olibkvm.a: kvmctl.o kvmctl-x86.o
This split may also grow more .. as maybe the apic stuff will get
moved to it's own file.Example Powerpc:
kvmctl: kvmctl-powerpc.o kvmctl.o main.o main-x86.oQuoted 8 lines
Now one way could be is to create a variable in the arch specific makefiles for kvmctl & libkvm . So that for x86 you woud have
KVMCTL= kvmctl-x86.o kvmctl.o main-x86.o main.o
Then in the main
Makefile.kvmctl: $(KVMCTL)
Quoted 8 lines
Exactly: that way we can ensure that every arch builds a common set of targets.
Quoted 2 lines
I personally think having the declaration in each arch makes things less confusing.
I can't tell if you're agreeing or if you forgot a negative. I agree that each arch should define e.g. "
kvmctl_objs".
Well I guess I'm doing both :-). Either way will work. Having a variable "kvmctl_objs" may be a better way. I'll redo and send again.
Quoted 1 line
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/
Quoted 6 lines · Jerone Young
Quoted 5 lines
Quoted 3 lines
PATCH 2 moves all the rest of the flatfile rules to config-x86-common.mak. So nothing gets clobbered.
But THIS patch clobbers it.
Quoted 8 lines
Oh, It does not clobber flatfiles. It uses it. So in config-x86-common.mak there is a rule
flatfiles: $(flatfiles-common) $(flatfiles)
Acutally I thought the same too. But this is actually in the original makefile. It doesn't clobber it apparently. But for saftey I'll change the name of this rule as it shouldn't be the same name as variable.
My mistake again. However, it's a little confusing that there is a variable *and* a target named "flatfiles"...
Signature · 9 lines
Hollis Blanchard IBM Linux Technology Center ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/