* [PATCH] ARM: zImage: Skip relinking if nothing changes
[not found] <4E457682.5020107@codeaurora.org>
@ 2011-08-12 19:00 ` Stephen Boyd
2011-08-12 20:48 ` Arnaud Lacombe
0 siblings, 1 reply; 14+ messages in thread
From: Stephen Boyd @ 2011-08-12 19:00 UTC (permalink / raw)
To: Sam Ravnborg; +Cc: linux-kernel, linux-arm-kernel, linux-kbuild
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] 14+ messages in thread
* Re: [PATCH] ARM: zImage: Skip relinking if nothing changes
2011-08-12 19:00 ` [PATCH] ARM: zImage: Skip relinking if nothing changes 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; 14+ messages in thread
From: Arnaud Lacombe @ 2011-08-12 20:48 UTC (permalink / raw)
To: Stephen Boyd; +Cc: Sam Ravnborg, linux-kernel, linux-arm-kernel, linux-kbuild
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@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [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; 14+ messages in thread
From: Russell King - ARM Linux @ 2011-08-12 20:55 UTC (permalink / raw)
To: Arnaud Lacombe
Cc: Stephen Boyd, Sam Ravnborg, linux-kernel, linux-arm-kernel,
linux-kbuild
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] 14+ messages in thread
* Re: [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; 14+ messages in thread
From: Arnaud Lacombe @ 2011-08-12 21:41 UTC (permalink / raw)
To: Russell King - ARM Linux
Cc: Stephen Boyd, Sam Ravnborg, linux-kernel, linux-arm-kernel,
linux-kbuild
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] 14+ messages in thread
* Re: [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; 14+ messages in thread
From: Sam Ravnborg @ 2011-08-12 22:03 UTC (permalink / raw)
To: Arnaud Lacombe
Cc: Russell King - ARM Linux, Stephen Boyd, linux-kernel,
linux-arm-kernel, linux-kbuild
>
> 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] 14+ messages in thread
* Re: [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; 14+ messages in thread
From: Arnaud Lacombe @ 2011-08-12 22:17 UTC (permalink / raw)
To: Sam Ravnborg
Cc: Russell King - ARM Linux, Stephen Boyd, linux-kernel,
linux-arm-kernel, linux-kbuild
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] 14+ messages in thread
* Re: [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; 14+ messages in thread
From: Arnaud Lacombe @ 2011-08-12 22:32 UTC (permalink / raw)
To: Stephen Boyd; +Cc: Sam Ravnborg, linux-kernel, linux-arm-kernel, linux-kbuild
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@vger.kernel.org
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>>
>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [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; 14+ messages in thread
From: Sam Ravnborg @ 2011-08-13 6:34 UTC (permalink / raw)
To: Arnaud Lacombe
Cc: Russell King - ARM Linux, Stephen Boyd, linux-kernel,
linux-arm-kernel, linux-kbuild
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] 14+ messages in thread
* Re: [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; 14+ messages in thread
From: Arnaud Lacombe @ 2011-08-13 16:02 UTC (permalink / raw)
To: Sam Ravnborg
Cc: Russell King - ARM Linux, Stephen Boyd, linux-kernel,
linux-arm-kernel, linux-kbuild
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] 14+ messages in thread
* Re: [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; 14+ messages in thread
From: Nicolas Pitre @ 2011-08-18 3:44 UTC (permalink / raw)
To: Arnaud Lacombe
Cc: Stephen Boyd, Sam Ravnborg, lkml, linux-arm-kernel, linux-kbuild
[-- Attachment #1: Type: TEXT/PLAIN, Size: 1777 bytes --]
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] 14+ messages in thread
* Re: [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; 14+ messages in thread
From: Arnaud Lacombe @ 2011-08-18 18:03 UTC (permalink / raw)
To: Nicolas Pitre
Cc: Stephen Boyd, Sam Ravnborg, lkml, linux-arm-kernel, linux-kbuild
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] 14+ messages in thread
* Re: [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; 14+ messages in thread
From: Russell King - ARM Linux @ 2011-08-18 19:31 UTC (permalink / raw)
To: Arnaud Lacombe
Cc: Nicolas Pitre, Sam Ravnborg, Stephen Boyd, lkml, linux-arm-kernel,
linux-kbuild
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] 14+ messages in thread
* Re: [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; 14+ messages in thread
From: Troy Kisky @ 2011-08-18 22:25 UTC (permalink / raw)
To: Russell King - ARM Linux
Cc: Arnaud Lacombe, linux-kbuild, Nicolas Pitre, Stephen Boyd, lkml,
Sam Ravnborg, 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] 14+ messages in thread
* Re: [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; 14+ messages in thread
From: Arnaud Lacombe @ 2011-08-18 22:38 UTC (permalink / raw)
To: Troy Kisky
Cc: Russell King - ARM Linux, linux-kbuild, Nicolas Pitre,
Stephen Boyd, lkml, Sam Ravnborg, 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] 14+ messages in thread
end of thread, other threads:[~2011-08-18 22:38 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <4E457682.5020107@codeaurora.org>
2011-08-12 19:00 ` [PATCH] ARM: zImage: Skip relinking if nothing changes 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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox