xen/arm: build: add missed dependency for head.S
RFC 1/1 xen/arm: build: add missed dependency for head.S
When we update the header files that had been included in head.S. The build system would not re-compile the head.S. Because in the build rules, the dependencies are setting to .*.d (eg. DEPS = .*.d) files in the same folder as Makefile.
But head.S is very special, it was used by the Makefile in the parent
folder: "ALL_OBJS := $(TARGET_SUBARCH)/head.o".
In this case, the build system could not find the dependency in DEPS. When we update the header files, the build system is unware of this update. If we re-build the Xen without doing make clean or touching the head.S, the build system will not recompile the head.S.
---
In my mind, the better way to fix this bug is converting the DEPS from ALL_OBJS. But I am afraid of the impact. I am not sure whether there are some dependencies are not generated from obj files.
---xen/Rules.mk | 3 ++-
xen/arch/arm/Makefile | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-)
xen/Rules.mk +2 -1
@@ -92,9 +92,10 @@ LDFLAGS += $(LDFLAGS-y) include $(BASEDIR)/arch/$(TARGET_ARCH)/Rules.mk +DEPS = .*.d + include Makefile -DEPS = .*.d define gendep ifneq ($(1),$(subst /,:,$(1))) DEPS += $(dir $(1)).$(notdir $(1)).d
xen/arch/arm/Makefile +2 -0
@@ -51,6 +51,8 @@ endif ALL_OBJS := $(TARGET_SUBARCH)/head.o $(ALL_OBJS) +DEPS += $(TARGET_SUBARCH)/.head.o.d + $(TARGET): $(TARGET)-syms $(TARGET).axf $(OBJCOPY) -O binary -S $< $@ ifeq ($(CONFIG_ARM_64),y)
Signature · 7 lines
2.7.4 _______________________________________________ Xen-devel mailing list [email protected] http://lists.xen.org/xen-devel
(CC Ian)
Hi,
Quoted 13 lines · Wei Chen
When we update the header files that had been included in
head.S. The build system would not re-compile thehead.S. Because in the build rules, the dependencies are setting to .*.d (eg. DEPS = .*.d) files in the same folder asMakefile.But
head.Sis very special, it was used by theMakefilein the parent
folder: "ALL_OBJS:= $(TARGET_SUBARCH)/head.o".In this case, the build system could not find the dependency in DEPS. When we update the header files, the build system is unware of this update. If we re-build the Xen without doing make clean or touching the
head.S, the build system will not recompile thehead.S.
Quoted 5 lines
Signed-off-by Wei Chen <[email protected]>---
In my mind, the better way to fix this bug is converting the DEPS fromALL_OBJS. But I am afraid of the impact. I am not sure whether there are some dependencies are not generated from obj files.
My knowledge of the build system is limited. Stefano, Ian, Wei, could you give a look?
Regards,
Quoted 35 lines
---
xen/Rules.mk| 3 ++-xen/arch/arm/Makefile | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-)xen/Rules.mk +2
-1@@ -92,9 +92,10 @@ LDFLAGS += $(LDFLAGS-y) include $(BASEDIR)/arch/$(TARGET_ARCH)/Rules.mk +DEPS = .*.d + include Makefile -DEPS = .*.d define gendep ifneq ($(1),$(subst /,:,$(1))) DEPS += $(dir $(1)).$(notdir $(1)).dxen/arch/arm/Makefile +2
-0@@ -51,6 +51,8 @@ endif ALL_OBJS := $(TARGET_SUBARCH)/head.o $(ALL_OBJS) +DEPS += $(TARGET_SUBARCH)/.head.o.d + $(TARGET): $(TARGET)-syms $(TARGET).axf $(OBJCOPY) -O binary -S $< $@ ifeq ($(CONFIG_ARM_64),y)
Signature · 6 lines
Julien Grall _______________________________________________ Xen-devel mailing list [email protected] http://lists.xen.org/xen-devel
Ian Jackson
Acked-byJulien Grall writes ("Re: [RFC] xen/arm: build: add missed dependency for head.S"):
Quoted 9 lines · Wei Chen
Quoted 8 lines
When we update the header files that had been included in
head.S. The build system would not re-compile thehead.S. Because in the build rules, the dependencies are setting to .*.d (eg. DEPS = .*.d) files in the same folder asMakefile.But
head.Sis very special, it was used by theMakefilein the parent
folder: "ALL_OBJS:= $(TARGET_SUBARCH)/head.o".
Quoted 6 lines
Quoted 6 lines
In this case, the build system could not find the dependency in DEPS. When we update the header files, the build system is unware of this update. If we re-build the Xen without doing make clean or touching the
head.S, the build system will not recompile thehead.S.Signed-off-by Wei Chen <[email protected]>
This should be in 4.7 and is a backport candidate.
Quoted 3 lines
Quoted 3 lines
In my mind, the better way to fix this bug is converting the DEPS from
ALL_OBJS. But I am afraid of the impact. I am not sure whether there are some dependencies are not generated from obj files.
I do like this idea but I have the same worry. It might be possible to dump ALL_OBJS out somehow and check this, but it might be arch-dependent.
Wei Chen's patch is IMO a straightforward fix.
Thanks,
Ian.
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Hi Ian,
Quoted 15 lines · Ian Jackson
Julien Grall writes ("Re: [RFC] xen/arm: build: add missed dependency for
head.S"):Quoted 14 lines · Wei Chen
Quoted 13 lines
When we update the header files that had been included in
head.S. The build system would not re-compile thehead.S. Because in the build rules, the dependencies are setting to .*.d (eg. DEPS = .*.d) files in the same folder asMakefile.But
head.Sis very special, it was used by theMakefilein the parent
folder: "ALL_OBJS:= $(TARGET_SUBARCH)/head.o".In this case, the build system could not find the dependency in DEPS. When we update the header files, the build system is unware of this update. If we re-build the Xen without doing make clean or touching the
head.S, the build system will not recompile thehead.S.
Quoted 5 lines
Quoted 1 line
Quoted 1 line
Signed-off-by Wei Chen <[email protected]>Acked-by Ian Jackson <[email protected]>This should be in 4.7 and is a backport candidate.
Sounds good to me.
Quoted 7 lines
Quoted 3 lines
Quoted 3 lines
In my mind, the better way to fix this bug is converting the DEPS from
ALL_OBJS. But I am afraid of the impact. I am not sure whether there are some dependencies are not generated from obj files.I do like this idea but I have the same worry. It might be possible to dump
ALL_OBJSout somehow and check this, but it might be arch-dependent.
FWIW, Wei sent a new version today [1] which implement his suggestion. Although it might be too risky for Xen 4.7.
Regards,
[1] http://lists.xenproject.org/archives/html/xen-devel/2016-06/msg00781.html
Signature · 6 lines
Julien Grall _______________________________________________ Xen-devel mailing list [email protected] http://lists.xen.org/xen-devel
RFC v2 1/1 xen/arm: build: add missed dependency for head.S
In current Xen build rules, the build system will only check the dependencies in current folder and obj-y generated dependencies in other folder.
But Makefile may add some objects to ALL_OBJS. These objects may be not in the same folder as Makefile. Use arch/arm/Makefile as an example:
ALL_OBJS := $(TARGET_SUBARCH)/head.o
The head.o is not in the same folder as Makefile and is not listed in obj-y. So, when we update the header files that had been included in head.S. The build system would not check the dependency of head.S. The head.S would not be re-compiled.
In this patch, we will get objects added by Makefile and add their dependencies to check list.
---
v1 -> v2:
- Use a generic method instead of changing Makefiles
--- xen/Rules.mk | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
xen/Rules.mk +10 -1
@@ -95,12 +95,21 @@ include $(BASEDIR)/arch/$(TARGET_ARCH)/Rules.mk include Makefile DEPS = .*.d + +# In obj-y and ALL_OBJS, there may have some objects are not in the +# same folder as Makefile, so we have to use gendep to generate +# dependencies for them. +DEP_OBJS = $(obj-y) + +# Extract objects from ALL_OBJS added by Makefile. +DEP_OBJS += $(filter-out %built_in.o,$(ALL_OBJS)) + define gendep ifneq ($(1),$(subst /,:,$(1))) DEPS += $(dir $(1)).$(notdir $(1)).d endif endef -$(foreach o,$(filter-out %/,$(obj-y)),$(eval $(call gendep,$(o)))) +$(foreach o,$(filter-out %/,$(DEP_OBJS)),$(eval $(call gendep,$(o)))) # Ensure each subdirectory has exactly one trailing slash. subdir-n := $(patsubst %,%/,$(patsubst %/,%,$(subdir-n) $(subdir-)))
Signature · 7 lines
2.7.4 _______________________________________________ Xen-devel mailing list [email protected] http://lists.xen.org/xen-devel
Quoted 30 lines · Wei Chen
In current Xen build rules, the build system will only check the dependencies in current folder and obj-y generated dependencies in other folder.
But
Makefilemay add some objects toALL_OBJS. These objects may be not in the same folder asMakefile. Usearch/arm/Makefileas an example:ALL_OBJS := $(TARGET_SUBARCH)/head.oThe head.o is not in the same folder as
Makefileand is not listed in obj-y. So, when we update the header files that had been included inhead.S. The build system would not check the dependency ofhead.S. Thehead.Swould not be re-compiled.In this patch, we will get objects added by
Makefileand add their dependencies to check list.Signed-off-by Wei Chen <[email protected]>---
v1 -> v2:
- Use a generic method instead of changing Makefiles--- xen/Rules.mk | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)xen/Rules.mk +0
-0
xen/Rules.mk include $(BASEDIR)/arch/$(TARGET_ARCH)/Rules.mk · line 99
Quoted 5 lines
xen/Rules.mk +2
-0@@ -95,12 +95,21 @@ include $(BASEDIR)/arch/$(TARGET_ARCH)/Rules.mk include Makefile DEPS = .*.d + +# In obj-y and ALL_OBJS, there may have some objects are not in the
You are missing a verb here.
I think you mean to say 'there may be some objects which are not in the'
Quoted 25 lines
xen/Rules.mk +8
-1+# same folder as Makefile, so we have to use gendep to generate +# dependencies for them. +DEP_OBJS = $(obj-y) + +# Extract objects from ALL_OBJS added by Makefile. +DEP_OBJS += $(filter-out %built_in.o,$(ALL_OBJS)) + define gendep ifneq ($(1),$(subst /,:,$(1))) DEPS += $(dir $(1)).$(notdir $(1)).d endif endef -$(foreach o,$(filter-out %/,$(obj-y)),$(eval $(call gendep,$(o)))) +$(foreach o,$(filter-out %/,$(DEP_OBJS)),$(eval $(call gendep,$(o)))) # Ensure each subdirectory has exactly one trailing slash. subdir-n := $(patsubst %,%/,$(patsubst %/,%,$(subdir-n) $(subdir-)))Signature · 7 lines
2.7.4 _______________________________________________ Xen-devel mailing list [email protected] http://lists.xen.org/xen-devel
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Quoted 33 lines · Konrad Rzeszutek Wilk
Quoted 32 lines · Wei Chen
In current Xen build rules, the build system will only check the dependencies in current folder and obj-y generated dependencies in other folder.
But
Makefilemay add some objects toALL_OBJS. These objects may be not in the same folder asMakefile. Usearch/arm/Makefileas an example:ALL_OBJS := $(TARGET_SUBARCH)/head.oThe head.o is not in the same folder as
Makefileand is not listed in obj-y. So, when we update the header files that had been included inhead.S. The build system would not check the dependency ofhead.S. Thehead.Swould not be re-compiled.In this patch, we will get objects added by
Makefileand add their dependencies to check list.Signed-off-by Wei Chen <[email protected]>---
v1 -> v2:
- Use a generic method instead of changing Makefiles--- xen/Rules.mk | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)xen/Rules.mk +0
-0@@ -95,12 +95,21 @@ include $(BASEDIR)/arch/$(TARGET_ARCH)/Rules.mk include Makefile
Quoted 7 lines
xen/Rules.mk include $(BASEDIR)/arch/$(TARGET_ARCH)/Rules.mk · line 99
Quoted 3 lines
xen/Rules.mk +2
-0DEPS = .*.d + +# In obj-y and ALL_OBJS, there may have some objects are not in theYou are missing a verb here.
I think you mean to say 'there may be some objects which are not in the'
Thank you! it's my mistake.
Quoted 21 lines
Quoted 21 lines
xen/Rules.mk +8
-2+# same folder as Makefile, so we have to use gendep to generate +# dependencies for them. +DEP_OBJS = $(obj-y) + +# Extract objects from ALL_OBJS added by Makefile. +DEP_OBJS += $(filter-out %built_in.o,$(ALL_OBJS)) + define gendep ifneq ($(1),$(subst /,:,$(1))) DEPS += $(dir $(1)).$(notdir $(1)).d endif endef -$(foreach o,$(filter-out %/,$(obj-y)),$(eval $(call gendep,$(o)))) +$(foreach o,$(filter-out %/,$(DEP_OBJS)),$(eval $(call gendep,$(o)))) # Ensure each subdirectory has exactly one trailing slash. subdir-n := $(patsubst %,%/,$(patsubst %/,%,$(subdir-n) $(subdir-))) --2.7.4
Quoted 4 lines
Quoted 4 lines
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Re: [RFC v2] xen/arm: build: add missed dependency for head.S [and 1 more messages]
In reply to Wei ChenWei Chen writes ("[RFC v2] xen/arm: build: add missed dependency for head.S"):
Quoted 8 lines
In current Xen build rules, the build system will only check the dependencies in current folder and obj-y generated dependencies in other folder.
But
Makefilemay add some objects toALL_OBJS. These objects may be not in the same folder asMakefile. Usearch/arm/Makefileas an example:ALL_OBJS := $(TARGET_SUBARCH)/head.o
Thanks for the v2.
But I think I actually somewhat prefer the v1 approach, for these reasons:
Quoted 4 lines · Wei Chen
In my mind, the better way to fix this bug is converting the DEPS from
ALL_OBJS. But I am afraid of the impact. I am not sure whether there are some dependencies are not generated from obj files.
Ian Jackson writes ("Re: [RFC] xen/arm: build: add missed dependency for head.S"):
Quoted 5 lines
I do like this idea but I have the same worry. It might be possible to dump
ALL_OBJSout somehow and check this, but it might be arch-dependent.Wei Chen's patch is IMO a straightforward fix.
I won't NAK the v2 but I think if Wei Chen is still happy for us to do so, we should commit the v1.
Ian.
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Re: [RFC v2] xen/arm: build: add missed dependency for head.S [and 1 more messages]
Quoted 25 lines · Ian Jackson
Wei Chen writes ("[RFC v2] xen/arm: build: add missed dependency for
head.S"):Quoted 8 lines
In current Xen build rules, the build system will only check the dependencies in current folder and obj-y generated dependencies in other folder.
But
Makefilemay add some objects toALL_OBJS. These objects may be not in the same folder asMakefile. Usearch/arm/Makefileas an example:ALL_OBJS := $(TARGET_SUBARCH)/head.oThanks for the v2.
But I think I actually somewhat prefer the v1 approach, for these reasons:
Quoted 4 lines · Wei Chen
In my mind, the better way to fix this bug is converting the DEPS from
ALL_OBJS. But I am afraid of the impact. I am not sure whether there are some dependencies are not generated from obj files.Ian Jackson writes ("Re: [RFC] xen/arm: build: add missed dependency for
head.S"):Quoted 4 lines
I do like this idea but I have the same worry. It might be possible to dump
ALL_OBJSout somehow and check this, but it might be arch-dependent.
Quoted 6 lines
Quoted 1 line
Wei Chen's patch is IMO a straightforward fix.
I won't NAK the v2 but I think if Wei Chen is still happy for us to do so, we should commit the v1.
Ian.
We shall take either v1 or v2. I don't really have an opinion which one.
Either one:
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Re: [RFC v2] xen/arm: build: add missed dependency for head.S [and 1 more messages]
Hi,
Quoted 26 lines · Wei Liu
Quoted 25 lines · Ian Jackson
Wei Chen writes ("[RFC v2] xen/arm: build: add missed dependency for
head.S"):Quoted 8 lines
In current Xen build rules, the build system will only check the dependencies in current folder and obj-y generated dependencies in other folder.
But
Makefilemay add some objects toALL_OBJS. These objects may be not in the same folder asMakefile. Usearch/arm/Makefileas an example:ALL_OBJS := $(TARGET_SUBARCH)/head.oThanks for the v2.
But I think I actually somewhat prefer the v1 approach, for these reasons:
Quoted 4 lines · Wei Chen
In my mind, the better way to fix this bug is converting the DEPS from
ALL_OBJS. But I am afraid of the impact. I am not sure whether there are some dependencies are not generated from obj files.Ian Jackson writes ("Re: [RFC] xen/arm: build: add missed dependency for
head.S"):Quoted 4 lines
I do like this idea but I have the same worry. It might be possible to dump
ALL_OBJSout somehow and check this, but it might be arch-dependent.
Quoted 9 lines
Quoted 6 lines
Quoted 1 line
Wei Chen's patch is IMO a straightforward fix.
I won't NAK the v2 but I think if Wei Chen is still happy for us to do so, we should commit the v1.
Ian.
We shall take either v1 or v2. I don't really have an opinion which one.
Thank you. I will be happy if anyone would be committed. IMO, please commit the v1 patch.
The v1 patch gives the arch Makefile more right to add dependencies not just only in ALL_OBJS.
Quoted 3 lines
Either one:
Release-acked-by Wei Liu <[email protected]>
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Re: [RFC v2] xen/arm: build: add missed dependency for head.S [and 1 more messages]
Quoted 34 lines · Wei Chen
Hi,
Quoted 31 lines · Wei Liu
Quoted 30 lines · Ian Jackson
Wei Chen writes ("[RFC v2] xen/arm: build: add missed dependency for
head.S"):Quoted 8 lines
In current Xen build rules, the build system will only check the dependencies in current folder and obj-y generated dependencies in other folder.
But
Makefilemay add some objects toALL_OBJS. These objects may be not in the same folder asMakefile. Usearch/arm/Makefileas an example:ALL_OBJS := $(TARGET_SUBARCH)/head.oThanks for the v2.
But I think I actually somewhat prefer the v1 approach, for these reasons:
Quoted 4 lines · Wei Chen
In my mind, the better way to fix this bug is converting the DEPS from
ALL_OBJS. But I am afraid of the impact. I am not sure whether there are some dependencies are not generated from obj files.Ian Jackson writes ("Re: [RFC] xen/arm: build: add missed dependency for
head.S"):Quoted 5 lines
I do like this idea but I have the same worry. It might be possible to dump
ALL_OBJSout somehow and check this, but it might be arch-dependent.Wei Chen's patch is IMO a straightforward fix.
I won't NAK the v2 but I think if Wei Chen is still happy for us to do so, we should commit the v1.
Quoted 7 lines
Quoted 4 lines
Quoted 1 line
Ian.
We shall take either v1 or v2. I don't really have an opinion which one.
Thank you. I will be happy if anyone would be committed. IMO, please commit the v1 patch.
Thanks for confirming.
Since both you and Ian prefer v1, I've queued up v1 for both xen-unstable and 4.7 branch.
Wei.
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel