* Relinking zImage when nothing changes @ 2011-08-12 17:46 Stephen Boyd 2011-08-12 18:02 ` Sam Ravnborg 0 siblings, 1 reply; 22+ messages in thread From: Stephen Boyd @ 2011-08-12 17:46 UTC (permalink / raw) To: linux-arm-kernel I was hoping with the recent patch e78e8f2 (kernel: prevent unnecessary rebuilding due to config_data.gz, 2011-07-05) compiling ARM linux a second time would amount to no more linking. This doesn't seem to be the case though. Doing a make V=2 I see that lib1funcs.S is shipped and thus we have to recompile it although nothing actually changed. This in turn requires us to relink the compressed vmlinux and then recreate the zImage. Kernel: arch/arm/boot/Image is ready SHIPPED arch/arm/boot/compressed/lib1funcs.S - due to missing .cmd file AS arch/arm/boot/compressed/lib1funcs.o - due to: arch/arm/boot/compressed/lib1funcs.S LD arch/arm/boot/compressed/vmlinux - due to: arch/arm/boot/compressed/lib1funcs.o OBJCOPY arch/arm/boot/zImage - due to: arch/arm/boot/compressed/vmlinux Kernel: arch/arm/boot/zImage is ready Is there any way to avoid this? Perhaps the shipped command could become a bit wiser? -- Sent by an employee of the Qualcomm Innovation Center, Inc. The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum. ^ permalink raw reply [flat|nested] 22+ messages in thread
* Relinking zImage when nothing changes 2011-08-12 17:46 Relinking zImage when nothing changes Stephen Boyd @ 2011-08-12 18:02 ` Sam Ravnborg 2011-08-12 18:12 ` Stephen Boyd 2011-08-12 20:20 ` Relinking zImage when " Arnaud Lacombe 0 siblings, 2 replies; 22+ messages in thread From: Sam Ravnborg @ 2011-08-12 18:02 UTC (permalink / raw) To: linux-arm-kernel On Fri, Aug 12, 2011 at 10:46:24AM -0700, Stephen Boyd wrote: > I was hoping with the recent patch e78e8f2 (kernel: prevent unnecessary > rebuilding due to config_data.gz, 2011-07-05) compiling ARM linux a > second time would amount to no more linking. This doesn't seem to be the > case though. Doing a make V=2 I see that lib1funcs.S is shipped and thus > we have to recompile it although nothing actually changed. This in turn > requires us to relink the compressed vmlinux and then recreate the zImage. > > Kernel: arch/arm/boot/Image is ready > SHIPPED arch/arm/boot/compressed/lib1funcs.S - due to missing .cmd file > AS arch/arm/boot/compressed/lib1funcs.o - due to: arch/arm/boot/compressed/lib1funcs.S > LD arch/arm/boot/compressed/vmlinux - due to: arch/arm/boot/compressed/lib1funcs.o > OBJCOPY arch/arm/boot/zImage - due to: arch/arm/boot/compressed/vmlinux > Kernel: arch/arm/boot/zImage is ready > > > Is there any way to avoid this? Perhaps the shipped command could become > a bit wiser? Following patch will likely fix it: diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile index 0c74a6f..80b6b6e 100644 --- a/arch/arm/boot/compressed/Makefile +++ b/arch/arm/boot/compressed/Makefile @@ -123,7 +123,7 @@ LDFLAGS_vmlinux += -T # For __aeabi_uidivmod lib1funcs = $(obj)/lib1funcs.o -$(obj)/lib1funcs.S: $(srctree)/arch/$(SRCARCH)/lib/lib1funcs.S FORCE +$(obj)/lib1funcs.S: $(srctree)/arch/$(SRCARCH)/lib/lib1funcs.S $(call cmd,shipped) # We need to prevent any GOTOFF relocs being used with references (cut'n'pasted ...) The FORCE prerequisite will tell make to always execute the command. But we only want to execute the command if: 1) $(obj)/lib1funcs.S is missing 2) or $(srctree)/arch/$(SRCARCH)/lib/lib1funcs.S is not older then $(obj)/lib1funcs.S So dropping FORCE should be a safe thing to do. Sam ^ permalink raw reply related [flat|nested] 22+ messages in thread
* Relinking zImage when nothing changes 2011-08-12 18:02 ` Sam Ravnborg @ 2011-08-12 18:12 ` Stephen Boyd 2011-08-12 18:34 ` Sam Ravnborg 2011-08-12 20:20 ` Relinking zImage when " Arnaud Lacombe 1 sibling, 1 reply; 22+ messages in thread From: Stephen Boyd @ 2011-08-12 18:12 UTC (permalink / raw) To: linux-arm-kernel On 08/12/2011 11:02 AM, Sam Ravnborg wrote: > On Fri, Aug 12, 2011 at 10:46:24AM -0700, Stephen Boyd wrote: >> I was hoping with the recent patch e78e8f2 (kernel: prevent unnecessary >> rebuilding due to config_data.gz, 2011-07-05) compiling ARM linux a >> second time would amount to no more linking. This doesn't seem to be the >> case though. Doing a make V=2 I see that lib1funcs.S is shipped and thus >> we have to recompile it although nothing actually changed. This in turn >> requires us to relink the compressed vmlinux and then recreate the zImage. >> >> Kernel: arch/arm/boot/Image is ready >> SHIPPED arch/arm/boot/compressed/lib1funcs.S - due to missing .cmd file >> AS arch/arm/boot/compressed/lib1funcs.o - due to: arch/arm/boot/compressed/lib1funcs.S >> LD arch/arm/boot/compressed/vmlinux - due to: arch/arm/boot/compressed/lib1funcs.o >> OBJCOPY arch/arm/boot/zImage - due to: arch/arm/boot/compressed/vmlinux >> Kernel: arch/arm/boot/zImage is ready >> >> >> Is there any way to avoid this? Perhaps the shipped command could become >> a bit wiser? > Following patch will likely fix it: > diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile > index 0c74a6f..80b6b6e 100644 > --- a/arch/arm/boot/compressed/Makefile > +++ b/arch/arm/boot/compressed/Makefile > @@ -123,7 +123,7 @@ LDFLAGS_vmlinux += -T > # For __aeabi_uidivmod > lib1funcs = $(obj)/lib1funcs.o > > -$(obj)/lib1funcs.S: $(srctree)/arch/$(SRCARCH)/lib/lib1funcs.S FORCE > +$(obj)/lib1funcs.S: $(srctree)/arch/$(SRCARCH)/lib/lib1funcs.S > $(call cmd,shipped) > > # We need to prevent any GOTOFF relocs being used with references > > (cut'n'pasted ...) > > The FORCE prerequisite will tell make to always execute the command. > But we only want to execute the command if: > 1) $(obj)/lib1funcs.S is missing > 2) or $(srctree)/arch/$(SRCARCH)/lib/lib1funcs.S is not older then $(obj)/lib1funcs.S > > So dropping FORCE should be a safe thing to do. > Hm... that fixes the shipped part. But now we still reassemble lib1funcs.o. Kernel: arch/arm/boot/Image is ready AS arch/arm/boot/compressed/lib1funcs.o - due to lib1funcs.o not in $(targets) LD arch/arm/boot/compressed/vmlinux - due to: arch/arm/boot/compressed/lib1funcs.o OBJCOPY arch/arm/boot/zImage - due to: arch/arm/boot/compressed/vmlinux Kernel: arch/arm/boot/zImage is ready Is it correct to add lib1funcs.o to targets? diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile index 0c74a6f..64889e6 100644 --- a/arch/arm/boot/compressed/Makefile +++ b/arch/arm/boot/compressed/Makefile @@ -91,7 +91,7 @@ suffix_$(CONFIG_KERNEL_LZMA) = lzma targets := vmlinux vmlinux.lds \ piggy.$(suffix_y) piggy.$(suffix_y).o \ - font.o font.c head.o misc.o $(OBJS) + font.o font.c head.o misc.o lib1funcs.o $(OBJS) # Make sure files are removed during clean extra-y += piggy.gzip piggy.lzo piggy.lzma lib1funcs.S @@ -123,7 +123,7 @@ LDFLAGS_vmlinux += -T # For __aeabi_uidivmod lib1funcs = $(obj)/lib1funcs.o -$(obj)/lib1funcs.S: $(srctree)/arch/$(SRCARCH)/lib/lib1funcs.S FORCE +$(obj)/lib1funcs.S: $(srctree)/arch/$(SRCARCH)/lib/lib1funcs.S $(call cmd,shipped) # We need to prevent any GOTOFF relocs being used with references -- Sent by an employee of the Qualcomm Innovation Center, Inc. The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum. ^ permalink raw reply related [flat|nested] 22+ messages in thread
* Relinking zImage when nothing changes 2011-08-12 18:12 ` Stephen Boyd @ 2011-08-12 18:34 ` Sam Ravnborg 2011-08-12 18:52 ` Stephen Boyd 0 siblings, 1 reply; 22+ messages in thread From: Sam Ravnborg @ 2011-08-12 18:34 UTC (permalink / raw) To: linux-arm-kernel On Fri, Aug 12, 2011 at 11:12:11AM -0700, Stephen Boyd wrote: > On 08/12/2011 11:02 AM, Sam Ravnborg wrote: > > On Fri, Aug 12, 2011 at 10:46:24AM -0700, Stephen Boyd wrote: > >> I was hoping with the recent patch e78e8f2 (kernel: prevent unnecessary > >> rebuilding due to config_data.gz, 2011-07-05) compiling ARM linux a > >> second time would amount to no more linking. This doesn't seem to be the > >> case though. Doing a make V=2 I see that lib1funcs.S is shipped and thus > >> we have to recompile it although nothing actually changed. This in turn > >> requires us to relink the compressed vmlinux and then recreate the zImage. > >> > >> Kernel: arch/arm/boot/Image is ready > >> SHIPPED arch/arm/boot/compressed/lib1funcs.S - due to missing .cmd file > >> AS arch/arm/boot/compressed/lib1funcs.o - due to: arch/arm/boot/compressed/lib1funcs.S > >> LD arch/arm/boot/compressed/vmlinux - due to: arch/arm/boot/compressed/lib1funcs.o > >> OBJCOPY arch/arm/boot/zImage - due to: arch/arm/boot/compressed/vmlinux > >> Kernel: arch/arm/boot/zImage is ready > >> > >> > >> Is there any way to avoid this? Perhaps the shipped command could become > >> a bit wiser? > > Following patch will likely fix it: > > diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile > > index 0c74a6f..80b6b6e 100644 > > --- a/arch/arm/boot/compressed/Makefile > > +++ b/arch/arm/boot/compressed/Makefile > > @@ -123,7 +123,7 @@ LDFLAGS_vmlinux += -T > > # For __aeabi_uidivmod > > lib1funcs = $(obj)/lib1funcs.o > > > > -$(obj)/lib1funcs.S: $(srctree)/arch/$(SRCARCH)/lib/lib1funcs.S FORCE > > +$(obj)/lib1funcs.S: $(srctree)/arch/$(SRCARCH)/lib/lib1funcs.S > > $(call cmd,shipped) > > > > # We need to prevent any GOTOFF relocs being used with references > > > > (cut'n'pasted ...) > > > > The FORCE prerequisite will tell make to always execute the command. > > But we only want to execute the command if: > > 1) $(obj)/lib1funcs.S is missing > > 2) or $(srctree)/arch/$(SRCARCH)/lib/lib1funcs.S is not older then $(obj)/lib1funcs.S > > > > So dropping FORCE should be a safe thing to do. > > > > Hm... that fixes the shipped part. But now we still reassemble lib1funcs.o. > > Kernel: arch/arm/boot/Image is ready > AS arch/arm/boot/compressed/lib1funcs.o - due to lib1funcs.o not in $(targets) > LD arch/arm/boot/compressed/vmlinux - due to: arch/arm/boot/compressed/lib1funcs.o > OBJCOPY arch/arm/boot/zImage - due to: arch/arm/boot/compressed/vmlinux > Kernel: arch/arm/boot/zImage is ready > > > Is it correct to add lib1funcs.o to targets? Yes - it is a bug this was not done before. > > diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile > index 0c74a6f..64889e6 100644 > --- a/arch/arm/boot/compressed/Makefile > +++ b/arch/arm/boot/compressed/Makefile > @@ -91,7 +91,7 @@ suffix_$(CONFIG_KERNEL_LZMA) = lzma > > targets := vmlinux vmlinux.lds \ > piggy.$(suffix_y) piggy.$(suffix_y).o \ > - font.o font.c head.o misc.o $(OBJS) > + font.o font.c head.o misc.o lib1funcs.o $(OBJS) > > # Make sure files are removed during clean > extra-y += piggy.gzip piggy.lzo piggy.lzma lib1funcs.S > @@ -123,7 +123,7 @@ LDFLAGS_vmlinux += -T > # For __aeabi_uidivmod > lib1funcs = $(obj)/lib1funcs.o While touching the file I would kill this assignment - it confused me. > > -$(obj)/lib1funcs.S: $(srctree)/arch/$(SRCARCH)/lib/lib1funcs.S FORCE > +$(obj)/lib1funcs.S: $(srctree)/arch/$(SRCARCH)/lib/lib1funcs.S > $(call cmd,shipped) > > # We need to prevent any GOTOFF relocs being used with references If you prepare a patch with the changes then you can add my "Acked-by". Sam ^ permalink raw reply [flat|nested] 22+ messages in thread
* Relinking zImage when nothing changes 2011-08-12 18:34 ` Sam Ravnborg @ 2011-08-12 18:52 ` Stephen Boyd 2011-08-12 19:00 ` [PATCH] ARM: zImage: Skip relinking if " Stephen Boyd 0 siblings, 1 reply; 22+ messages in thread From: Stephen Boyd @ 2011-08-12 18:52 UTC (permalink / raw) To: linux-arm-kernel On 08/12/2011 11:34 AM, Sam Ravnborg wrote: > On Fri, Aug 12, 2011 at 11:12:11AM -0700, Stephen Boyd wrote: >> >> Hm... that fixes the shipped part. But now we still reassemble lib1funcs.o. >> >> Kernel: arch/arm/boot/Image is ready >> AS arch/arm/boot/compressed/lib1funcs.o - due to lib1funcs.o not in $(targets) >> LD arch/arm/boot/compressed/vmlinux - due to: arch/arm/boot/compressed/lib1funcs.o >> OBJCOPY arch/arm/boot/zImage - due to: arch/arm/boot/compressed/vmlinux >> Kernel: arch/arm/boot/zImage is ready >> >> >> Is it correct to add lib1funcs.o to targets? > Yes - it is a bug this was not done before. > Ok. I've also added lib1funcs.S because I assume I want to clean that out too with make clean. > >> # For __aeabi_uidivmod >> lib1funcs = $(obj)/lib1funcs.o > While touching the file I would kill this assignment - it confused me. Sure. I've expanded $(lib1funcs) into $(obj)/lib1funcs.o in the vmlinux rule. >> >> -$(obj)/lib1funcs.S: $(srctree)/arch/$(SRCARCH)/lib/lib1funcs.S FORCE >> +$(obj)/lib1funcs.S: $(srctree)/arch/$(SRCARCH)/lib/lib1funcs.S >> $(call cmd,shipped) >> >> # We need to prevent any GOTOFF relocs being used with references > If you prepare a patch with the changes then you can add my "Acked-by". > Thanks will do. -- Sent by an employee of the Qualcomm Innovation Center, Inc. The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum. ^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH] ARM: zImage: Skip relinking if nothing changes 2011-08-12 18:52 ` Stephen Boyd @ 2011-08-12 19:00 ` Stephen Boyd 2011-08-12 20:48 ` Arnaud Lacombe 0 siblings, 1 reply; 22+ messages in thread From: Stephen Boyd @ 2011-08-12 19:00 UTC (permalink / raw) To: linux-arm-kernel lib1funcs.S is reshipped even though the file hasn't changed because the make rule is marked with FORCE. According to Sam Ravnborg: The FORCE prerequisite will tell make to always execute the command. But we only want to execute the command if: 1) $(obj)/lib1funcs.S is missing 2) or $(srctree)/arch/$(SRCARCH)/lib/lib1funcs.S is not older then $(obj)/lib1funcs.S So dropping FORCE should be a safe thing to do. This fixes the shipped problem, but we still have to reassemble lib1funcs.S because it isn't part of $targets. Add lib1funcs.{S,o} to $targets to avoid relinking the compressed vmlinux if nothing changes. Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> Acked-by: Sam Ravnborg <sam@ravnborg.org> --- arch/arm/boot/compressed/Makefile | 8 +++----- 1 files changed, 3 insertions(+), 5 deletions(-) diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile index 0c74a6f..937fd26 100644 --- a/arch/arm/boot/compressed/Makefile +++ b/arch/arm/boot/compressed/Makefile @@ -91,7 +91,7 @@ suffix_$(CONFIG_KERNEL_LZMA) = lzma targets := vmlinux vmlinux.lds \ piggy.$(suffix_y) piggy.$(suffix_y).o \ - font.o font.c head.o misc.o $(OBJS) + font.o font.c head.o misc.o lib1funcs.o lib1funcs.S $(OBJS) # Make sure files are removed during clean extra-y += piggy.gzip piggy.lzo piggy.lzma lib1funcs.S @@ -121,9 +121,7 @@ LDFLAGS_vmlinux += -X LDFLAGS_vmlinux += -T # For __aeabi_uidivmod -lib1funcs = $(obj)/lib1funcs.o - -$(obj)/lib1funcs.S: $(srctree)/arch/$(SRCARCH)/lib/lib1funcs.S FORCE +$(obj)/lib1funcs.S: $(srctree)/arch/$(SRCARCH)/lib/lib1funcs.S $(call cmd,shipped) # We need to prevent any GOTOFF relocs being used with references @@ -140,7 +138,7 @@ bad_syms=$$($(CROSS_COMPILE)nm $@ | sed -n 's/^.\{8\} [bc] \(.*\)/\1/p') && \ echo "$$bad_syms" >&2; rm -f $@; false ) $(obj)/vmlinux: $(obj)/vmlinux.lds $(obj)/$(HEAD) $(obj)/piggy.$(suffix_y).o \ - $(addprefix $(obj)/, $(OBJS)) $(lib1funcs) FORCE + $(addprefix $(obj)/, $(OBJS)) $(obj)/lib1funcs.o FORCE $(call if_changed,ld) @$(check_for_bad_syms) -- Sent by an employee of the Qualcomm Innovation Center, Inc. The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum. ^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH] ARM: zImage: Skip relinking if nothing changes 2011-08-12 19:00 ` [PATCH] ARM: zImage: Skip relinking if " Stephen Boyd @ 2011-08-12 20:48 ` Arnaud Lacombe 2011-08-12 20:55 ` Russell King - ARM Linux 2011-08-12 22:32 ` Arnaud Lacombe 0 siblings, 2 replies; 22+ messages in thread From: Arnaud Lacombe @ 2011-08-12 20:48 UTC (permalink / raw) To: linux-arm-kernel Hi, On Fri, Aug 12, 2011 at 3:00 PM, Stephen Boyd <sboyd@codeaurora.org> wrote: > lib1funcs.S is reshipped even though the file hasn't changed > because the make rule is marked with FORCE. According to Sam > Ravnborg: > > ? ? ? ?The FORCE prerequisite will tell make to always execute > ? ? ? ?the command. > ? ? ? ?But we only want to execute the command if: > ? ? ? ?1) $(obj)/lib1funcs.S is missing > ? ? ? ?2) or $(srctree)/arch/$(SRCARCH)/lib/lib1funcs.S is not > ? ? ? ?older then $(obj)/lib1funcs.S > > ? ? ? ?So dropping FORCE should be a safe thing to do. > > This fixes the shipped problem, but we still have to reassemble > lib1funcs.S because it isn't part of $targets. Add > lib1funcs.{S,o} to $targets to avoid relinking the compressed > vmlinux if nothing changes. > > Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> > Acked-by: Sam Ravnborg <sam@ravnborg.org> > --- > ?arch/arm/boot/compressed/Makefile | ? ?8 +++----- > ?1 files changed, 3 insertions(+), 5 deletions(-) > > diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile > index 0c74a6f..937fd26 100644 > --- a/arch/arm/boot/compressed/Makefile > +++ b/arch/arm/boot/compressed/Makefile > @@ -91,7 +91,7 @@ suffix_$(CONFIG_KERNEL_LZMA) = lzma > > ?targets ? ? ? := vmlinux vmlinux.lds \ > ? ? ? ? ? ? ? ? piggy.$(suffix_y) piggy.$(suffix_y).o \ > - ? ? ? ? ? ? ? ?font.o font.c head.o misc.o $(OBJS) > + ? ? ? ? ? ? ? ?font.o font.c head.o misc.o lib1funcs.o lib1funcs.S $(OBJS) > > ?# Make sure files are removed during clean > ?extra-y ? ? ? += piggy.gzip piggy.lzo piggy.lzma lib1funcs.S > @@ -121,9 +121,7 @@ LDFLAGS_vmlinux += -X > ?LDFLAGS_vmlinux += -T > > ?# For __aeabi_uidivmod > -lib1funcs = $(obj)/lib1funcs.o > - > -$(obj)/lib1funcs.S: $(srctree)/arch/$(SRCARCH)/lib/lib1funcs.S FORCE > +$(obj)/lib1funcs.S: $(srctree)/arch/$(SRCARCH)/lib/lib1funcs.S > ? ? ? ?$(call cmd,shipped) > You should be able to avoid the extra copy altogether by doing something ala: $(obj)/lib1funcs.o: $(srctree)/arch/arm/lib/lib1funcs.S $(call cmd,as_o_S) note that I also remove the $(SRCARCH), as there is no other `arch/*/lib/lib1funcs.S' than `arch/arm/lib/lib1funcs.S' - Arnaud > ?# We need to prevent any GOTOFF relocs being used with references > @@ -140,7 +138,7 @@ bad_syms=$$($(CROSS_COMPILE)nm $@ | sed -n 's/^.\{8\} [bc] \(.*\)/\1/p') && \ > ? ? echo "$$bad_syms" >&2; rm -f $@; false ) > > ?$(obj)/vmlinux: $(obj)/vmlinux.lds $(obj)/$(HEAD) $(obj)/piggy.$(suffix_y).o \ > - ? ? ? ? ? ? ? $(addprefix $(obj)/, $(OBJS)) $(lib1funcs) FORCE > + ? ? ? ? ? ? ? $(addprefix $(obj)/, $(OBJS)) $(obj)/lib1funcs.o FORCE > ? ? ? ?$(call if_changed,ld) > ? ? ? ?@$(check_for_bad_syms) > > -- > Sent by an employee of the Qualcomm Innovation Center, Inc. > The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum. > > -- > To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in > the body of a message to majordomo at vger.kernel.org > More majordomo info at ?http://vger.kernel.org/majordomo-info.html > ^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH] ARM: zImage: Skip relinking if nothing changes 2011-08-12 20:48 ` Arnaud Lacombe @ 2011-08-12 20:55 ` Russell King - ARM Linux 2011-08-12 21:41 ` Arnaud Lacombe 2011-08-12 22:32 ` Arnaud Lacombe 1 sibling, 1 reply; 22+ messages in thread From: Russell King - ARM Linux @ 2011-08-12 20:55 UTC (permalink / raw) To: linux-arm-kernel On Fri, Aug 12, 2011 at 04:48:12PM -0400, Arnaud Lacombe wrote: > You should be able to avoid the extra copy altogether by doing something ala: > > $(obj)/lib1funcs.o: $(srctree)/arch/arm/lib/lib1funcs.S > $(call cmd,as_o_S) > > note that I also remove the $(SRCARCH), as there is no other > `arch/*/lib/lib1funcs.S' than `arch/arm/lib/lib1funcs.S' We tried such things, but it results in kbuild arguing over building lib1funcs.S in arch/arm/lib and arch/arm/boot/compressed. You end up with it rebuilding the arch/arm/lib one, followed by a rebuild of the arch/arm/boot/compressed one. We've ended up with what we have because its about the only way to get kbuild to behave. ^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH] ARM: zImage: Skip relinking if nothing changes 2011-08-12 20:55 ` Russell King - ARM Linux @ 2011-08-12 21:41 ` Arnaud Lacombe 2011-08-12 22:03 ` Sam Ravnborg 0 siblings, 1 reply; 22+ messages in thread From: Arnaud Lacombe @ 2011-08-12 21:41 UTC (permalink / raw) To: linux-arm-kernel Hi, On Fri, Aug 12, 2011 at 4:55 PM, Russell King - ARM Linux <linux@arm.linux.org.uk> wrote: > On Fri, Aug 12, 2011 at 04:48:12PM -0400, Arnaud Lacombe wrote: >> You should be able to avoid the extra copy altogether by doing something ala: >> >> $(obj)/lib1funcs.o: $(srctree)/arch/arm/lib/lib1funcs.S >> ? ? ? ? $(call cmd,as_o_S) >> >> note that I also remove the $(SRCARCH), as there is no other >> `arch/*/lib/lib1funcs.S' than `arch/arm/lib/lib1funcs.S' > > We tried such things, but it results in kbuild arguing over building > lib1funcs.S in arch/arm/lib and arch/arm/boot/compressed. ?You end up > with it rebuilding the arch/arm/lib one, followed by a rebuild of the > arch/arm/boot/compressed one. > hum... I tried this approach on a reduced testcase with an object in arch/x86/boot/ using a prerequisite in arch/x86/lib/ and it seemed to behave as I would expect. From what I can find online, this comes from http://lkml.org/lkml/2009/11/13/246. Albin's original is broken because it refers to object in the source tree. I suspect Martin's change to work only because he had a stale `arch/$(SRCARCH)/lib/lib1funcs.o' in his tree. Sebastian's change is broken because he was badly using $(obj), he should have used $(objtree). All case are otherwise broken because of cross-subdirectory object dependency do not work. The commit I think you refer to should be: commit 4486b86368d72bcac76439638b36667b1c6a1360 Author: Russell King <rmk@dyn-67.arm.linux.org.uk> Date: Sun Jun 3 18:54:42 2007 +0100 [ARM] riscpc: fix decompressor font file handling font_acorn_8x8.o was being built in drivers/video/console/ twice during a build _in the same location_ - once for the kernel proper, and once for the decompressor. The result is when you came to run an install target, the kernel was always rebuilt due to this file apparantly having been built with different compiler arguments. Solve this by making a local copy at build time in the decompressor's directory. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> I suspect this would have done the job: $(obj)/font.o: $(srctree)/drivers/video/console/font_acorn_8x8.c $(cmd,cc_o_c) rather than abusing `cmd_shipped'. font.o would not have been built twice in the _same_ location, but respectively in `drivers/video/console/font_acorn_8x8.o' and `arch/arm/boot/compressed/font.o' - Arnaud > We've ended up with what we have because its about the only way to get > kbuild to behave. > ^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH] ARM: zImage: Skip relinking if nothing changes 2011-08-12 21:41 ` Arnaud Lacombe @ 2011-08-12 22:03 ` Sam Ravnborg 2011-08-12 22:17 ` Arnaud Lacombe 0 siblings, 1 reply; 22+ messages in thread From: Sam Ravnborg @ 2011-08-12 22:03 UTC (permalink / raw) To: linux-arm-kernel > > I suspect this would have done the job: > > $(obj)/font.o: $(srctree)/drivers/video/console/font_acorn_8x8.c > $(cmd,cc_o_c)' I prefer using $(call,shipped) and let kbuild figure out how build an .o file from a .c file. In other words - avoiding use of the internal to Makefile.build variables in various places. Sam ^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH] ARM: zImage: Skip relinking if nothing changes 2011-08-12 22:03 ` Sam Ravnborg @ 2011-08-12 22:17 ` Arnaud Lacombe 2011-08-13 6:34 ` Sam Ravnborg 0 siblings, 1 reply; 22+ messages in thread From: Arnaud Lacombe @ 2011-08-12 22:17 UTC (permalink / raw) To: linux-arm-kernel Hi, On Fri, Aug 12, 2011 at 6:03 PM, Sam Ravnborg <sam@ravnborg.org> wrote: >> >> I suspect this would have done the job: >> >> $(obj)/font.o: $(srctree)/drivers/video/console/font_acorn_8x8.c >> ? ? ? ? $(cmd,cc_o_c)' > > I prefer using $(call,shipped) and let kbuild figure out how > build an .o file from a .c file. > > In other words - avoiding use of the internal to Makefile.build > variables in various places. > indeed, but I'd argue that 1) this would not be the first Makefile using these internal macros (alpha and ia64 are using such construct for aliasing) and 2) the `cmd_shipped' stuff is as internal than other functions :-) I wonder if we could not make kbuild provide an interface for such code-reuse... - Arnaud ^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH] ARM: zImage: Skip relinking if nothing changes 2011-08-12 22:17 ` Arnaud Lacombe @ 2011-08-13 6:34 ` Sam Ravnborg 2011-08-13 16:02 ` Arnaud Lacombe 0 siblings, 1 reply; 22+ messages in thread From: Sam Ravnborg @ 2011-08-13 6:34 UTC (permalink / raw) To: linux-arm-kernel On Fri, Aug 12, 2011 at 06:17:25PM -0400, Arnaud Lacombe wrote: > Hi, > > On Fri, Aug 12, 2011 at 6:03 PM, Sam Ravnborg <sam@ravnborg.org> wrote: > >> > >> I suspect this would have done the job: > >> > >> $(obj)/font.o: $(srctree)/drivers/video/console/font_acorn_8x8.c > >> ? ? ? ? $(cmd,cc_o_c)' > > > > I prefer using $(call,shipped) and let kbuild figure out how > > build an .o file from a .c file. > > > > In other words - avoiding use of the internal to Makefile.build > > variables in various places. > > > indeed, but I'd argue that 1) this would not be the first Makefile > using these internal macros (alpha and ia64 are using such construct > for aliasing) and 2) the `cmd_shipped' stuff is as internal than other > functions :-) A quick grep in Documentation/kbuild will show that only the shipped variant is documented. We could implement a general copy command - this is needed in some places like this. Sam ^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH] ARM: zImage: Skip relinking if nothing changes 2011-08-13 6:34 ` Sam Ravnborg @ 2011-08-13 16:02 ` Arnaud Lacombe 0 siblings, 0 replies; 22+ messages in thread From: Arnaud Lacombe @ 2011-08-13 16:02 UTC (permalink / raw) To: linux-arm-kernel Hi, On Sat, Aug 13, 2011 at 2:34 AM, Sam Ravnborg <sam@ravnborg.org> wrote: > On Fri, Aug 12, 2011 at 06:17:25PM -0400, Arnaud Lacombe wrote: >> Hi, >> >> On Fri, Aug 12, 2011 at 6:03 PM, Sam Ravnborg <sam@ravnborg.org> wrote: >> >> >> >> I suspect this would have done the job: >> >> >> >> $(obj)/font.o: $(srctree)/drivers/video/console/font_acorn_8x8.c >> >> ? ? ? ? $(cmd,cc_o_c)' >> > >> > I prefer using $(call,shipped) and let kbuild figure out how >> > build an .o file from a .c file. >> > >> > In other words - avoiding use of the internal to Makefile.build >> > variables in various places. >> > >> indeed, but I'd argue that 1) this would not be the first Makefile >> using these internal macros (alpha and ia64 are using such construct >> for aliasing) and 2) the `cmd_shipped' stuff is as internal than other >> functions :-) > A quick grep in Documentation/kbuild will show that only the shipped > variant is documented. > > We could implement a general copy command - this is needed in some places > like this. > I was more thinking of a way to use a single source file, for multiple target, built in different location, without having to make useless copy or cross-subdirectory target dependencies, and removing all non-internal use of cc_c_o, and friends. - Arnaud ^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH] ARM: zImage: Skip relinking if nothing changes 2011-08-12 20:48 ` Arnaud Lacombe 2011-08-12 20:55 ` Russell King - ARM Linux @ 2011-08-12 22:32 ` Arnaud Lacombe 2011-08-18 3:44 ` Nicolas Pitre 1 sibling, 1 reply; 22+ messages in thread From: Arnaud Lacombe @ 2011-08-12 22:32 UTC (permalink / raw) To: linux-arm-kernel Hi, On Fri, Aug 12, 2011 at 4:48 PM, Arnaud Lacombe <lacombar@gmail.com> wrote: > Hi, > > On Fri, Aug 12, 2011 at 3:00 PM, Stephen Boyd <sboyd@codeaurora.org> wrote: >> lib1funcs.S is reshipped even though the file hasn't changed >> because the make rule is marked with FORCE. According to Sam >> Ravnborg: >> >> ? ? ? ?The FORCE prerequisite will tell make to always execute >> ? ? ? ?the command. >> ? ? ? ?But we only want to execute the command if: >> ? ? ? ?1) $(obj)/lib1funcs.S is missing >> ? ? ? ?2) or $(srctree)/arch/$(SRCARCH)/lib/lib1funcs.S is not >> ? ? ? ?older then $(obj)/lib1funcs.S >> >> ? ? ? ?So dropping FORCE should be a safe thing to do. >> >> This fixes the shipped problem, but we still have to reassemble >> lib1funcs.S because it isn't part of $targets. Add >> lib1funcs.{S,o} to $targets to avoid relinking the compressed >> vmlinux if nothing changes. >> >> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> >> Acked-by: Sam Ravnborg <sam@ravnborg.org> >> --- >> ?arch/arm/boot/compressed/Makefile | ? ?8 +++----- >> ?1 files changed, 3 insertions(+), 5 deletions(-) >> >> diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile >> index 0c74a6f..937fd26 100644 >> --- a/arch/arm/boot/compressed/Makefile >> +++ b/arch/arm/boot/compressed/Makefile >> @@ -91,7 +91,7 @@ suffix_$(CONFIG_KERNEL_LZMA) = lzma >> >> ?targets ? ? ? := vmlinux vmlinux.lds \ >> ? ? ? ? ? ? ? ? piggy.$(suffix_y) piggy.$(suffix_y).o \ >> - ? ? ? ? ? ? ? ?font.o font.c head.o misc.o $(OBJS) >> + ? ? ? ? ? ? ? ?font.o font.c head.o misc.o lib1funcs.o lib1funcs.S $(OBJS) >> >> ?# Make sure files are removed during clean >> ?extra-y ? ? ? += piggy.gzip piggy.lzo piggy.lzma lib1funcs.S >> @@ -121,9 +121,7 @@ LDFLAGS_vmlinux += -X >> ?LDFLAGS_vmlinux += -T >> >> ?# For __aeabi_uidivmod >> -lib1funcs = $(obj)/lib1funcs.o >> - >> -$(obj)/lib1funcs.S: $(srctree)/arch/$(SRCARCH)/lib/lib1funcs.S FORCE >> +$(obj)/lib1funcs.S: $(srctree)/arch/$(SRCARCH)/lib/lib1funcs.S >> ? ? ? ?$(call cmd,shipped) >> > You should be able to avoid the extra copy altogether by doing something ala: > > $(obj)/lib1funcs.o: $(srctree)/arch/arm/lib/lib1funcs.S > ? ? ? ?$(call cmd,as_o_S) > > note that I also remove the $(SRCARCH), as there is no other > `arch/*/lib/lib1funcs.S' than `arch/arm/lib/lib1funcs.S' > I withdraw this proposal and will hack around this to find a proper solution from within kbuild, and eventually come back on these uses :-) - Arnaud >> ?# We need to prevent any GOTOFF relocs being used with references >> @@ -140,7 +138,7 @@ bad_syms=$$($(CROSS_COMPILE)nm $@ | sed -n 's/^.\{8\} [bc] \(.*\)/\1/p') && \ >> ? ? echo "$$bad_syms" >&2; rm -f $@; false ) >> >> ?$(obj)/vmlinux: $(obj)/vmlinux.lds $(obj)/$(HEAD) $(obj)/piggy.$(suffix_y).o \ >> - ? ? ? ? ? ? ? $(addprefix $(obj)/, $(OBJS)) $(lib1funcs) FORCE >> + ? ? ? ? ? ? ? $(addprefix $(obj)/, $(OBJS)) $(obj)/lib1funcs.o FORCE >> ? ? ? ?$(call if_changed,ld) >> ? ? ? ?@$(check_for_bad_syms) >> >> -- >> Sent by an employee of the Qualcomm Innovation Center, Inc. >> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum. >> >> -- >> To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in >> the body of a message to majordomo at vger.kernel.org >> More majordomo info at ?http://vger.kernel.org/majordomo-info.html >> > ^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH] ARM: zImage: Skip relinking if nothing changes 2011-08-12 22:32 ` Arnaud Lacombe @ 2011-08-18 3:44 ` Nicolas Pitre 2011-08-18 18:03 ` Arnaud Lacombe 0 siblings, 1 reply; 22+ messages in thread From: Nicolas Pitre @ 2011-08-18 3:44 UTC (permalink / raw) To: linux-arm-kernel On Fri, 12 Aug 2011, Arnaud Lacombe wrote: > On Fri, Aug 12, 2011 at 4:48 PM, Arnaud Lacombe <lacombar@gmail.com> wrote: > > On Fri, Aug 12, 2011 at 3:00 PM, Stephen Boyd <sboyd@codeaurora.org> wrote: > >> diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile > >> index 0c74a6f..937fd26 100644 > >> --- a/arch/arm/boot/compressed/Makefile > >> +++ b/arch/arm/boot/compressed/Makefile > >> @@ -91,7 +91,7 @@ suffix_$(CONFIG_KERNEL_LZMA) = lzma > >> > >> ?targets ? ? ? := vmlinux vmlinux.lds \ > >> ? ? ? ? ? ? ? ? piggy.$(suffix_y) piggy.$(suffix_y).o \ > >> - ? ? ? ? ? ? ? ?font.o font.c head.o misc.o $(OBJS) > >> + ? ? ? ? ? ? ? ?font.o font.c head.o misc.o lib1funcs.o lib1funcs.S $(OBJS) > >> > >> ?# Make sure files are removed during clean > >> ?extra-y ? ? ? += piggy.gzip piggy.lzo piggy.lzma lib1funcs.S > >> @@ -121,9 +121,7 @@ LDFLAGS_vmlinux += -X > >> ?LDFLAGS_vmlinux += -T > >> > >> ?# For __aeabi_uidivmod > >> -lib1funcs = $(obj)/lib1funcs.o > >> - > >> -$(obj)/lib1funcs.S: $(srctree)/arch/$(SRCARCH)/lib/lib1funcs.S FORCE > >> +$(obj)/lib1funcs.S: $(srctree)/arch/$(SRCARCH)/lib/lib1funcs.S > >> ? ? ? ?$(call cmd,shipped) > >> > > You should be able to avoid the extra copy altogether by doing something ala: > > > > $(obj)/lib1funcs.o: $(srctree)/arch/arm/lib/lib1funcs.S > > ? ? ? ?$(call cmd,as_o_S) > > > > note that I also remove the $(SRCARCH), as there is no other > > `arch/*/lib/lib1funcs.S' than `arch/arm/lib/lib1funcs.S' > > > I withdraw this proposal and will hack around this to find a proper > solution from within kbuild, and eventually come back on these uses > :-) Any progress on this? I have a patch doing multiple similar $(call cmd,shipped) at the moment and this is far from looking nice. Nicolas ^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH] ARM: zImage: Skip relinking if nothing changes 2011-08-18 3:44 ` Nicolas Pitre @ 2011-08-18 18:03 ` Arnaud Lacombe 2011-08-18 19:31 ` Russell King - ARM Linux 0 siblings, 1 reply; 22+ messages in thread From: Arnaud Lacombe @ 2011-08-18 18:03 UTC (permalink / raw) To: linux-arm-kernel Hi, On Wed, Aug 17, 2011 at 11:44 PM, Nicolas Pitre <nico@fluxnic.net> wrote: > On Fri, 12 Aug 2011, Arnaud Lacombe wrote: >> On Fri, Aug 12, 2011 at 4:48 PM, Arnaud Lacombe <lacombar@gmail.com> wrote: >> > On Fri, Aug 12, 2011 at 3:00 PM, Stephen Boyd <sboyd@codeaurora.org> wrote: >> >> diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile >> >> index 0c74a6f..937fd26 100644 >> >> --- a/arch/arm/boot/compressed/Makefile >> >> +++ b/arch/arm/boot/compressed/Makefile >> >> @@ -91,7 +91,7 @@ suffix_$(CONFIG_KERNEL_LZMA) = lzma >> >> >> >> ?targets ? ? ? := vmlinux vmlinux.lds \ >> >> ? ? ? ? ? ? ? ? piggy.$(suffix_y) piggy.$(suffix_y).o \ >> >> - ? ? ? ? ? ? ? ?font.o font.c head.o misc.o $(OBJS) >> >> + ? ? ? ? ? ? ? ?font.o font.c head.o misc.o lib1funcs.o lib1funcs.S $(OBJS) >> >> >> >> ?# Make sure files are removed during clean >> >> ?extra-y ? ? ? += piggy.gzip piggy.lzo piggy.lzma lib1funcs.S >> >> @@ -121,9 +121,7 @@ LDFLAGS_vmlinux += -X >> >> ?LDFLAGS_vmlinux += -T >> >> >> >> ?# For __aeabi_uidivmod >> >> -lib1funcs = $(obj)/lib1funcs.o >> >> - >> >> -$(obj)/lib1funcs.S: $(srctree)/arch/$(SRCARCH)/lib/lib1funcs.S FORCE >> >> +$(obj)/lib1funcs.S: $(srctree)/arch/$(SRCARCH)/lib/lib1funcs.S >> >> ? ? ? ?$(call cmd,shipped) >> >> >> > You should be able to avoid the extra copy altogether by doing something ala: >> > >> > $(obj)/lib1funcs.o: $(srctree)/arch/arm/lib/lib1funcs.S >> > ? ? ? ?$(call cmd,as_o_S) >> > >> > note that I also remove the $(SRCARCH), as there is no other >> > `arch/*/lib/lib1funcs.S' than `arch/arm/lib/lib1funcs.S' >> > >> I withdraw this proposal and will hack around this to find a proper >> solution from within kbuild, and eventually come back on these uses >> :-) > > Any progress on this? > > I have a patch doing multiple similar $(call cmd,shipped) at the moment > and this is far from looking nice. > What is your use-case ? Is it re-use of code in a different subdirectory (use-case presented in this thread), or aliasing of the same source under different object name in the same directory (as used in the alpha tree) ? If it is the former, I potentially have a solution, but it is highlighting bad use of the kbuild infrastructure. I have not been able to yet measure the impact of the breakage, ie. either localized or tree-wide. I should be able to provide you with more info, hopefully, this evening. Thanks, - Arnaud ^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH] ARM: zImage: Skip relinking if nothing changes 2011-08-18 18:03 ` Arnaud Lacombe @ 2011-08-18 19:31 ` Russell King - ARM Linux 2011-08-18 22:25 ` Troy Kisky 0 siblings, 1 reply; 22+ messages in thread From: Russell King - ARM Linux @ 2011-08-18 19:31 UTC (permalink / raw) To: linux-arm-kernel On Thu, Aug 18, 2011 at 02:03:43PM -0400, Arnaud Lacombe wrote: > Hi, > > On Wed, Aug 17, 2011 at 11:44 PM, Nicolas Pitre <nico@fluxnic.net> wrote: > > On Fri, 12 Aug 2011, Arnaud Lacombe wrote: > >> On Fri, Aug 12, 2011 at 4:48 PM, Arnaud Lacombe <lacombar@gmail.com> wrote: > >> > On Fri, Aug 12, 2011 at 3:00 PM, Stephen Boyd <sboyd@codeaurora.org> wrote: > >> >> diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile > >> >> index 0c74a6f..937fd26 100644 > >> >> --- a/arch/arm/boot/compressed/Makefile > >> >> +++ b/arch/arm/boot/compressed/Makefile > >> >> @@ -91,7 +91,7 @@ suffix_$(CONFIG_KERNEL_LZMA) = lzma > >> >> > >> >> ?targets ? ? ? := vmlinux vmlinux.lds \ > >> >> ? ? ? ? ? ? ? ? piggy.$(suffix_y) piggy.$(suffix_y).o \ > >> >> - ? ? ? ? ? ? ? ?font.o font.c head.o misc.o $(OBJS) > >> >> + ? ? ? ? ? ? ? ?font.o font.c head.o misc.o lib1funcs.o lib1funcs.S $(OBJS) > >> >> > >> >> ?# Make sure files are removed during clean > >> >> ?extra-y ? ? ? += piggy.gzip piggy.lzo piggy.lzma lib1funcs.S > >> >> @@ -121,9 +121,7 @@ LDFLAGS_vmlinux += -X > >> >> ?LDFLAGS_vmlinux += -T > >> >> > >> >> ?# For __aeabi_uidivmod > >> >> -lib1funcs = $(obj)/lib1funcs.o > >> >> - > >> >> -$(obj)/lib1funcs.S: $(srctree)/arch/$(SRCARCH)/lib/lib1funcs.S FORCE > >> >> +$(obj)/lib1funcs.S: $(srctree)/arch/$(SRCARCH)/lib/lib1funcs.S > >> >> ? ? ? ?$(call cmd,shipped) > >> >> > >> > You should be able to avoid the extra copy altogether by doing something ala: > >> > > >> > $(obj)/lib1funcs.o: $(srctree)/arch/arm/lib/lib1funcs.S > >> > ? ? ? ?$(call cmd,as_o_S) > >> > > >> > note that I also remove the $(SRCARCH), as there is no other > >> > `arch/*/lib/lib1funcs.S' than `arch/arm/lib/lib1funcs.S' > >> > > >> I withdraw this proposal and will hack around this to find a proper > >> solution from within kbuild, and eventually come back on these uses > >> :-) > > > > Any progress on this? > > > > I have a patch doing multiple similar $(call cmd,shipped) at the moment > > and this is far from looking nice. > > What is your use-case ? Is it re-use of code in a different > subdirectory (use-case presented in this thread), or aliasing of the > same source under different object name in the same directory (as used > in the alpha tree) ? It is to be able to reuse the same file source file in both the main kernel and the decompressor, sometimes rebuilding it with differing options from the main kernel build. As the two environments are entirely separate, it is not always appropriate to clone the previously built object file. Hence, we copy the source file and re-build it. The alternative is that we could keep two copies of the same source in two different locations, but that's just plain idiotic just to satisfy some silly kbuild restriction. ^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH] ARM: zImage: Skip relinking if nothing changes 2011-08-18 19:31 ` Russell King - ARM Linux @ 2011-08-18 22:25 ` Troy Kisky 2011-08-18 22:38 ` Arnaud Lacombe 0 siblings, 1 reply; 22+ messages in thread From: Troy Kisky @ 2011-08-18 22:25 UTC (permalink / raw) To: linux-arm-kernel On 8/18/2011 12:31 PM, Russell King - ARM Linux wrote: > On Thu, Aug 18, 2011 at 02:03:43PM -0400, Arnaud Lacombe wrote: >> Hi, >> >> On Wed, Aug 17, 2011 at 11:44 PM, Nicolas Pitre<nico@fluxnic.net> wrote: >>> On Fri, 12 Aug 2011, Arnaud Lacombe wrote: >>>> On Fri, Aug 12, 2011 at 4:48 PM, Arnaud Lacombe<lacombar@gmail.com> wrote: >>>>> On Fri, Aug 12, 2011 at 3:00 PM, Stephen Boyd<sboyd@codeaurora.org> wrote: >>>>>> diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile >>>>>> index 0c74a6f..937fd26 100644 >>>>>> --- a/arch/arm/boot/compressed/Makefile >>>>>> +++ b/arch/arm/boot/compressed/Makefile >>>>>> @@ -91,7 +91,7 @@ suffix_$(CONFIG_KERNEL_LZMA) = lzma >>>>>> >>>>>> targets := vmlinux vmlinux.lds \ >>>>>> piggy.$(suffix_y) piggy.$(suffix_y).o \ >>>>>> - font.o font.c head.o misc.o $(OBJS) >>>>>> + font.o font.c head.o misc.o lib1funcs.o lib1funcs.S $(OBJS) >>>>>> >>>>>> # Make sure files are removed during clean >>>>>> extra-y += piggy.gzip piggy.lzo piggy.lzma lib1funcs.S >>>>>> @@ -121,9 +121,7 @@ LDFLAGS_vmlinux += -X >>>>>> LDFLAGS_vmlinux += -T >>>>>> >>>>>> # For __aeabi_uidivmod >>>>>> -lib1funcs = $(obj)/lib1funcs.o >>>>>> - >>>>>> -$(obj)/lib1funcs.S: $(srctree)/arch/$(SRCARCH)/lib/lib1funcs.S FORCE >>>>>> +$(obj)/lib1funcs.S: $(srctree)/arch/$(SRCARCH)/lib/lib1funcs.S >>>>>> $(call cmd,shipped) >>>>>> >>>>> You should be able to avoid the extra copy altogether by doing something ala: >>>>> >>>>> $(obj)/lib1funcs.o: $(srctree)/arch/arm/lib/lib1funcs.S >>>>> $(call cmd,as_o_S) >>>>> >>>>> note that I also remove the $(SRCARCH), as there is no other >>>>> `arch/*/lib/lib1funcs.S' than `arch/arm/lib/lib1funcs.S' >>>>> >>>> I withdraw this proposal and will hack around this to find a proper >>>> solution from within kbuild, and eventually come back on these uses >>>> :-) >>> Any progress on this? >>> >>> I have a patch doing multiple similar $(call cmd,shipped) at the moment >>> and this is far from looking nice. >> What is your use-case ? Is it re-use of code in a different >> subdirectory (use-case presented in this thread), or aliasing of the >> same source under different object name in the same directory (as used >> in the alpha tree) ? > It is to be able to reuse the same file source file in both the main > kernel and the decompressor, sometimes rebuilding it with differing > options from the main kernel build. > > As the two environments are entirely separate, it is not always > appropriate to clone the previously built object file. > > Hence, we copy the source file and re-build it. > > The alternative is that we could keep two copies of the same source > in two different locations, but that's just plain idiotic just to > satisfy some silly kbuild restriction. > Can the second file just contain a "#include " of the 1st? ^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH] ARM: zImage: Skip relinking if nothing changes 2011-08-18 22:25 ` Troy Kisky @ 2011-08-18 22:38 ` Arnaud Lacombe 0 siblings, 0 replies; 22+ messages in thread From: Arnaud Lacombe @ 2011-08-18 22:38 UTC (permalink / raw) To: linux-arm-kernel Hi, On Thu, Aug 18, 2011 at 6:25 PM, Troy Kisky <troy.kisky@boundarydevices.com> wrote: > On 8/18/2011 12:31 PM, Russell King - ARM Linux wrote: >> >> On Thu, Aug 18, 2011 at 02:03:43PM -0400, Arnaud Lacombe wrote: >>> >>> Hi, >>> >>> On Wed, Aug 17, 2011 at 11:44 PM, Nicolas Pitre<nico@fluxnic.net> ?wrote: >>>> >>>> On Fri, 12 Aug 2011, Arnaud Lacombe wrote: >>>>> >>>>> On Fri, Aug 12, 2011 at 4:48 PM, Arnaud Lacombe<lacombar@gmail.com> >>>>> ?wrote: >>>>>> >>>>>> On Fri, Aug 12, 2011 at 3:00 PM, Stephen Boyd<sboyd@codeaurora.org> >>>>>> ?wrote: >>>>>>> >>>>>>> diff --git a/arch/arm/boot/compressed/Makefile >>>>>>> b/arch/arm/boot/compressed/Makefile >>>>>>> index 0c74a6f..937fd26 100644 >>>>>>> --- a/arch/arm/boot/compressed/Makefile >>>>>>> +++ b/arch/arm/boot/compressed/Makefile >>>>>>> @@ -91,7 +91,7 @@ suffix_$(CONFIG_KERNEL_LZMA) = lzma >>>>>>> >>>>>>> ?targets ? ? ? := vmlinux vmlinux.lds \ >>>>>>> ? ? ? ? ? ? ? ? piggy.$(suffix_y) piggy.$(suffix_y).o \ >>>>>>> - ? ? ? ? ? ? ? ?font.o font.c head.o misc.o $(OBJS) >>>>>>> + ? ? ? ? ? ? ? ?font.o font.c head.o misc.o lib1funcs.o lib1funcs.S >>>>>>> $(OBJS) >>>>>>> >>>>>>> ?# Make sure files are removed during clean >>>>>>> ?extra-y ? ? ? += piggy.gzip piggy.lzo piggy.lzma lib1funcs.S >>>>>>> @@ -121,9 +121,7 @@ LDFLAGS_vmlinux += -X >>>>>>> ?LDFLAGS_vmlinux += -T >>>>>>> >>>>>>> ?# For __aeabi_uidivmod >>>>>>> -lib1funcs = $(obj)/lib1funcs.o >>>>>>> - >>>>>>> -$(obj)/lib1funcs.S: $(srctree)/arch/$(SRCARCH)/lib/lib1funcs.S FORCE >>>>>>> +$(obj)/lib1funcs.S: $(srctree)/arch/$(SRCARCH)/lib/lib1funcs.S >>>>>>> ? ? ? ?$(call cmd,shipped) >>>>>>> >>>>>> You should be able to avoid the extra copy altogether by doing >>>>>> something ala: >>>>>> >>>>>> $(obj)/lib1funcs.o: $(srctree)/arch/arm/lib/lib1funcs.S >>>>>> ? ? ? ?$(call cmd,as_o_S) >>>>>> >>>>>> note that I also remove the $(SRCARCH), as there is no other >>>>>> `arch/*/lib/lib1funcs.S' than `arch/arm/lib/lib1funcs.S' >>>>>> >>>>> I withdraw this proposal and will hack around this to find a proper >>>>> solution from within kbuild, and eventually come back on these uses >>>>> :-) >>>> >>>> Any progress on this? >>>> >>>> I have a patch doing multiple similar $(call cmd,shipped) at the moment >>>> and this is far from looking nice. >>> >>> What is your use-case ? Is it re-use of code in a different >>> subdirectory (use-case presented in this thread), or aliasing of the >>> same source under different object name in the same directory (as used >>> in the alpha tree) ? >> >> It is to be able to reuse the same file source file in both the main >> kernel and the decompressor, sometimes rebuilding it with differing >> options from the main kernel build. >> >> As the two environments are entirely separate, it is not always >> appropriate to clone the previously built object file. >> >> Hence, we copy the source file and re-build it. >> >> The alternative is that we could keep two copies of the same source >> in two different locations, but that's just plain idiotic just to >> satisfy some silly kbuild restriction. >> > Can the second file just contain a "#include " of the 1st? > <personal opinion> Sorry, but it'd taste awfully disgusting, and broken. <personal opinion/> - Arnaud ^ permalink raw reply [flat|nested] 22+ messages in thread
* Relinking zImage when nothing changes 2011-08-12 18:02 ` Sam Ravnborg 2011-08-12 18:12 ` Stephen Boyd @ 2011-08-12 20:20 ` Arnaud Lacombe 2011-08-12 20:24 ` Sam Ravnborg 1 sibling, 1 reply; 22+ messages in thread From: Arnaud Lacombe @ 2011-08-12 20:20 UTC (permalink / raw) To: linux-arm-kernel Hi, On Fri, Aug 12, 2011 at 2:02 PM, Sam Ravnborg <sam@ravnborg.org> wrote: > On Fri, Aug 12, 2011 at 10:46:24AM -0700, Stephen Boyd wrote: >> I was hoping with the recent patch e78e8f2 (kernel: prevent unnecessary >> rebuilding due to config_data.gz, 2011-07-05) compiling ARM linux a >> second time would amount to no more linking. This doesn't seem to be the >> case though. Doing a make V=2 I see that lib1funcs.S is shipped and thus >> we have to recompile it although nothing actually changed. This in turn >> requires us to relink the compressed vmlinux and then recreate the zImage. >> >> ? Kernel: arch/arm/boot/Image is ready >> ? SHIPPED arch/arm/boot/compressed/lib1funcs.S - due to missing .cmd file >> ? AS ? ? ?arch/arm/boot/compressed/lib1funcs.o - due to: arch/arm/boot/compressed/lib1funcs.S >> ? LD ? ? ?arch/arm/boot/compressed/vmlinux - due to: arch/arm/boot/compressed/lib1funcs.o >> ? OBJCOPY arch/arm/boot/zImage - due to: arch/arm/boot/compressed/vmlinux >> ? Kernel: arch/arm/boot/zImage is ready >> >> >> Is there any way to avoid this? Perhaps the shipped command could become >> a bit wiser? > > Following patch will likely fix it: > diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile > index 0c74a6f..80b6b6e 100644 > --- a/arch/arm/boot/compressed/Makefile > +++ b/arch/arm/boot/compressed/Makefile > @@ -123,7 +123,7 @@ LDFLAGS_vmlinux += -T > ?# For __aeabi_uidivmod > ?lib1funcs = $(obj)/lib1funcs.o > > -$(obj)/lib1funcs.S: $(srctree)/arch/$(SRCARCH)/lib/lib1funcs.S FORCE > +$(obj)/lib1funcs.S: $(srctree)/arch/$(SRCARCH)/lib/lib1funcs.S > ? ? ? ?$(call cmd,shipped) > AFAIK, we have a generic rule to handle shipped files: from scripts/Makefile.lib: $(obj)/%: $(src)/%_shipped $(call cmd,shipped) so, that rule should not be needed at all. - Arnaud > ?# We need to prevent any GOTOFF relocs being used with references > > (cut'n'pasted ...) > > The FORCE prerequisite will tell make to always execute the command. > But we only want to execute the command if: > 1) $(obj)/lib1funcs.S is missing > 2) or $(srctree)/arch/$(SRCARCH)/lib/lib1funcs.S is not older then $(obj)/lib1funcs.S > > So dropping FORCE should be a safe thing to do. > > ? ? ? ?Sam > -- > To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in > the body of a message to majordomo at vger.kernel.org > More majordomo info at ?http://vger.kernel.org/majordomo-info.html > ^ permalink raw reply [flat|nested] 22+ messages in thread
* Relinking zImage when nothing changes 2011-08-12 20:20 ` Relinking zImage when " Arnaud Lacombe @ 2011-08-12 20:24 ` Sam Ravnborg 2011-08-12 20:31 ` Arnaud Lacombe 0 siblings, 1 reply; 22+ messages in thread From: Sam Ravnborg @ 2011-08-12 20:24 UTC (permalink / raw) To: linux-arm-kernel On Fri, Aug 12, 2011 at 04:20:15PM -0400, Arnaud Lacombe wrote: > Hi, > > On Fri, Aug 12, 2011 at 2:02 PM, Sam Ravnborg <sam@ravnborg.org> wrote: > > On Fri, Aug 12, 2011 at 10:46:24AM -0700, Stephen Boyd wrote: > >> I was hoping with the recent patch e78e8f2 (kernel: prevent unnecessary > >> rebuilding due to config_data.gz, 2011-07-05) compiling ARM linux a > >> second time would amount to no more linking. This doesn't seem to be the > >> case though. Doing a make V=2 I see that lib1funcs.S is shipped and thus > >> we have to recompile it although nothing actually changed. This in turn > >> requires us to relink the compressed vmlinux and then recreate the zImage. > >> > >> ? Kernel: arch/arm/boot/Image is ready > >> ? SHIPPED arch/arm/boot/compressed/lib1funcs.S - due to missing .cmd file > >> ? AS ? ? ?arch/arm/boot/compressed/lib1funcs.o - due to: arch/arm/boot/compressed/lib1funcs.S > >> ? LD ? ? ?arch/arm/boot/compressed/vmlinux - due to: arch/arm/boot/compressed/lib1funcs.o > >> ? OBJCOPY arch/arm/boot/zImage - due to: arch/arm/boot/compressed/vmlinux > >> ? Kernel: arch/arm/boot/zImage is ready > >> > >> > >> Is there any way to avoid this? Perhaps the shipped command could become > >> a bit wiser? > > > > Following patch will likely fix it: > > diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile > > index 0c74a6f..80b6b6e 100644 > > --- a/arch/arm/boot/compressed/Makefile > > +++ b/arch/arm/boot/compressed/Makefile > > @@ -123,7 +123,7 @@ LDFLAGS_vmlinux += -T > > ?# For __aeabi_uidivmod > > ?lib1funcs = $(obj)/lib1funcs.o > > > > -$(obj)/lib1funcs.S: $(srctree)/arch/$(SRCARCH)/lib/lib1funcs.S FORCE > > +$(obj)/lib1funcs.S: $(srctree)/arch/$(SRCARCH)/lib/lib1funcs.S > > ? ? ? ?$(call cmd,shipped) > > > AFAIK, we have a generic rule to handle shipped files: > > from scripts/Makefile.lib: > > $(obj)/%: $(src)/%_shipped > $(call cmd,shipped) > > so, that rule should not be needed at all. In this case the cmd_shipped is misused to make a copy of a file. So the generic rule does not apply. Sam ^ permalink raw reply [flat|nested] 22+ messages in thread
* Relinking zImage when nothing changes 2011-08-12 20:24 ` Sam Ravnborg @ 2011-08-12 20:31 ` Arnaud Lacombe 0 siblings, 0 replies; 22+ messages in thread From: Arnaud Lacombe @ 2011-08-12 20:31 UTC (permalink / raw) To: linux-arm-kernel Hi, On Fri, Aug 12, 2011 at 4:24 PM, Sam Ravnborg <sam@ravnborg.org> wrote: > On Fri, Aug 12, 2011 at 04:20:15PM -0400, Arnaud Lacombe wrote: >> Hi, >> >> On Fri, Aug 12, 2011 at 2:02 PM, Sam Ravnborg <sam@ravnborg.org> wrote: >> > On Fri, Aug 12, 2011 at 10:46:24AM -0700, Stephen Boyd wrote: >> >> I was hoping with the recent patch e78e8f2 (kernel: prevent unnecessary >> >> rebuilding due to config_data.gz, 2011-07-05) compiling ARM linux a >> >> second time would amount to no more linking. This doesn't seem to be the >> >> case though. Doing a make V=2 I see that lib1funcs.S is shipped and thus >> >> we have to recompile it although nothing actually changed. This in turn >> >> requires us to relink the compressed vmlinux and then recreate the zImage. >> >> >> >> ? Kernel: arch/arm/boot/Image is ready >> >> ? SHIPPED arch/arm/boot/compressed/lib1funcs.S - due to missing .cmd file >> >> ? AS ? ? ?arch/arm/boot/compressed/lib1funcs.o - due to: arch/arm/boot/compressed/lib1funcs.S >> >> ? LD ? ? ?arch/arm/boot/compressed/vmlinux - due to: arch/arm/boot/compressed/lib1funcs.o >> >> ? OBJCOPY arch/arm/boot/zImage - due to: arch/arm/boot/compressed/vmlinux >> >> ? Kernel: arch/arm/boot/zImage is ready >> >> >> >> >> >> Is there any way to avoid this? Perhaps the shipped command could become >> >> a bit wiser? >> > >> > Following patch will likely fix it: >> > diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile >> > index 0c74a6f..80b6b6e 100644 >> > --- a/arch/arm/boot/compressed/Makefile >> > +++ b/arch/arm/boot/compressed/Makefile >> > @@ -123,7 +123,7 @@ LDFLAGS_vmlinux += -T >> > ?# For __aeabi_uidivmod >> > ?lib1funcs = $(obj)/lib1funcs.o >> > >> > -$(obj)/lib1funcs.S: $(srctree)/arch/$(SRCARCH)/lib/lib1funcs.S FORCE >> > +$(obj)/lib1funcs.S: $(srctree)/arch/$(SRCARCH)/lib/lib1funcs.S >> > ? ? ? ?$(call cmd,shipped) >> > >> AFAIK, we have a generic rule to handle shipped files: >> >> from scripts/Makefile.lib: >> >> $(obj)/%: $(src)/%_shipped >> ? ? ? ? $(call cmd,shipped) >> >> so, that rule should not be needed at all. > > In this case the cmd_shipped is misused to make a copy of a file. > So the generic rule does not apply. > oh, indeed. I see your point. - Arnaud ^ permalink raw reply [flat|nested] 22+ messages in thread
end of thread, other threads:[~2011-08-18 22:38 UTC | newest] Thread overview: 22+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2011-08-12 17:46 Relinking zImage when nothing changes Stephen Boyd 2011-08-12 18:02 ` Sam Ravnborg 2011-08-12 18:12 ` Stephen Boyd 2011-08-12 18:34 ` Sam Ravnborg 2011-08-12 18:52 ` Stephen Boyd 2011-08-12 19:00 ` [PATCH] ARM: zImage: Skip relinking if " Stephen Boyd 2011-08-12 20:48 ` Arnaud Lacombe 2011-08-12 20:55 ` Russell King - ARM Linux 2011-08-12 21:41 ` Arnaud Lacombe 2011-08-12 22:03 ` Sam Ravnborg 2011-08-12 22:17 ` Arnaud Lacombe 2011-08-13 6:34 ` Sam Ravnborg 2011-08-13 16:02 ` Arnaud Lacombe 2011-08-12 22:32 ` Arnaud Lacombe 2011-08-18 3:44 ` Nicolas Pitre 2011-08-18 18:03 ` Arnaud Lacombe 2011-08-18 19:31 ` Russell King - ARM Linux 2011-08-18 22:25 ` Troy Kisky 2011-08-18 22:38 ` Arnaud Lacombe 2011-08-12 20:20 ` Relinking zImage when " Arnaud Lacombe 2011-08-12 20:24 ` Sam Ravnborg 2011-08-12 20:31 ` Arnaud Lacombe
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).