Skip to contentSkip to conversation

Relinking zImage when nothing changes

PATCH In review Stephen Boyd 6 participants 22 messages Aug 12, 2011 – Aug 18, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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?

Signature · 2 lines
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
#1 lore raw
Quoted 15 lines · Stephen Boyd

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

Quoted 2 lines

Is there any way to avoid this? Perhaps the shipped command could become a bit wiser?

Following patch will likely fix it:

arch/arm/boot/compressed/Makefile +1 -1
index 0c74a6f..80b6b6e 100644
@@ -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

#2 lore raw
Quoted 33 lines · Sam Ravnborg
Quoted 15 lines · Stephen Boyd

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

Quoted 2 lines

Is there any way to avoid this? Perhaps the shipped command could become a bit wiser?

Following patch will likely fix it:

arch/arm/boot/compressed/Makefile +1 -1
index 0c74a6f..80b6b6e 100644
@@ -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
Quoted 9 lines

(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?

arch/arm/boot/compressed/Makefile +2 -2
index 0c74a6f..64889e6 100644
@@ -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
Signature · 2 lines
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
#3 lore raw
Quoted 46 lines · Stephen Boyd
Quoted 33 lines · Sam Ravnborg
Quoted 15 lines · Stephen Boyd

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

Quoted 2 lines

Is there any way to avoid this? Perhaps the shipped command could become a bit wiser?

Following patch will likely fix it:

arch/arm/boot/compressed/Makefile +1 -1
index 0c74a6f..80b6b6e 100644
@@ -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
Quoted 9 lines

(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.

Quoted 8 lines
  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.

Quoted 15 lines
arch/arm/boot/compressed/Makefile +1 -1
index 0c74a6f..64889e6 100644
@@ -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

arch/arm/boot/compressed/Makefile LDFLAGS_vmlinux += -T · line 125

Quoted 3 lines
arch/arm/boot/compressed/Makefile +0 -0
@@ -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.

arch/arm/boot/compressed/Makefile LDFLAGS_vmlinux += -T · line 129

Quoted 6 lines
arch/arm/boot/compressed/Makefile +1 -1
-$(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

#4 lore raw
Quoted 11 lines · Sam Ravnborg
Quoted 10 lines · Stephen Boyd

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
Quoted 3 lines
Quoted 1 line

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.

Quoted 4 lines
Quoted 3 lines

# 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.

Quoted 8 lines
Quoted 6 lines

-$(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.

Signature · 2 lines
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
#5 lore raw

PATCH 1/1 ARM: zImage: Skip relinking if nothing changes

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.

---
 arch/arm/boot/compressed/Makefile |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)
arch/arm/boot/compressed/Makefile +3 -5
index 0c74a6f..937fd26 100644
@@ -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)
 
Signature · 2 lines
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
#6 lore raw

Re: [PATCH] ARM: zImage: Skip relinking if nothing changes

Hi,

Quoted 45 lines · Stephen Boyd

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.

---
?arch/arm/boot/compressed/Makefile | ? ?8 +++----- ?1 files changed, 3 insertions(+), 5 deletions(-)

arch/arm/boot/compressed/Makefile +1 -1
index 0c74a6f..937fd26 100644
@@ -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

arch/arm/boot/compressed/Makefile +0 -0
@@ -121,9 +121,7 @@ LDFLAGS_vmlinux += -X

?LDFLAGS_vmlinux += -T

?# For __aeabi_uidivmod

arch/arm/boot/compressed/Makefile +1 -3
-lib1funcs = $(obj)/lib1funcs.o
-
-$(obj)/lib1funcs.S: $(srctree)/arch/$(SRCARCH)/lib/lib1funcs.S FORCE
+$(obj)/lib1funcs.S: $(srctree)/arch/$(SRCARCH)/lib/lib1funcs.S
Quoted 2 lines

? ? ? ?$(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

Quoted 19 lines

?# We need to prevent any GOTOFF relocs being used with references

arch/arm/boot/compressed/Makefile +1 -2
@@ -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

#7 lore raw

Re: [PATCH] ARM: zImage: Skip relinking if nothing changes

Quoted 7 lines · Arnaud Lacombe

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.

#8 lore raw

Re: [PATCH] ARM: zImage: Skip relinking if nothing changes

Hi,

Quoted 6 lines · Russell King - ARM Linux
Quoted 5 lines · Arnaud Lacombe

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)

Quoted 8 lines
Quoted 2 lines

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 <[email protected]>
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.

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

Quoted 3 lines

We've ended up with what we have because its about the only way to get kbuild to behave.

#9 lore raw

Re: [PATCH] ARM: zImage: Skip relinking if nothing changes

Quoted 5 lines

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

#10 lore raw

Re: [PATCH] ARM: zImage: Skip relinking if nothing changes

Hi,

Quoted 12 lines · Sam Ravnborg
Quoted 5 lines

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

#11 lore raw

Re: [PATCH] ARM: zImage: Skip relinking if nothing changes

Quoted 12 lines · Arnaud Lacombe

Hi,

Quoted 9 lines · Sam Ravnborg
Quoted 5 lines

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.

Quoted 7 lines
Quoted 3 lines

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

#12 lore raw

Re: [PATCH] ARM: zImage: Skip relinking if nothing changes

Hi,

Quoted 20 lines · Sam Ravnborg
Quoted 12 lines · Arnaud Lacombe

Hi,

Quoted 9 lines · Sam Ravnborg
Quoted 5 lines

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.

Quoted 7 lines
Quoted 3 lines

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 :-)

Quoted 6 lines

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

#13 lore raw

Re: [PATCH] ARM: zImage: Skip relinking if nothing changes

In reply to Arnaud Lacombe

Hi,

Quoted 52 lines · Arnaud Lacombe

Hi,

Quoted 45 lines · Stephen Boyd

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.

---
?arch/arm/boot/compressed/Makefile | ? ?8 +++----- ?1 files changed, 3 insertions(+), 5 deletions(-)

arch/arm/boot/compressed/Makefile +1 -1
index 0c74a6f..937fd26 100644
@@ -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

arch/arm/boot/compressed/Makefile +0 -0
@@ -121,9 +121,7 @@ LDFLAGS_vmlinux += -X

?LDFLAGS_vmlinux += -T

?# For __aeabi_uidivmod

arch/arm/boot/compressed/Makefile +1 -3
-lib1funcs = $(obj)/lib1funcs.o
-
-$(obj)/lib1funcs.S: $(srctree)/arch/$(SRCARCH)/lib/lib1funcs.S FORCE
+$(obj)/lib1funcs.S: $(srctree)/arch/$(SRCARCH)/lib/lib1funcs.S
Quoted 2 lines

? ? ? ?$(call cmd,shipped)

You should be able to avoid the extra copy altogether by doing something ala:

Quoted 6 lines

$(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

Quoted 20 lines
Quoted 19 lines

?# We need to prevent any GOTOFF relocs being used with references

arch/arm/boot/compressed/Makefile +1 -2
@@ -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

#14 lore raw

Re: [PATCH] ARM: zImage: Skip relinking if nothing changes

Quoted 30 lines · Arnaud Lacombe
Quoted 29 lines · Arnaud Lacombe
Quoted 21 lines · Stephen Boyd
arch/arm/boot/compressed/Makefile +1 -1
index 0c74a6f..937fd26 100644
@@ -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

arch/arm/boot/compressed/Makefile +0 -0
@@ -121,9 +121,7 @@ LDFLAGS_vmlinux += -X

?LDFLAGS_vmlinux += -T

?# For __aeabi_uidivmod

arch/arm/boot/compressed/Makefile +1 -3
-lib1funcs = $(obj)/lib1funcs.o
-
-$(obj)/lib1funcs.S: $(srctree)/arch/$(SRCARCH)/lib/lib1funcs.S FORCE
+$(obj)/lib1funcs.S: $(srctree)/arch/$(SRCARCH)/lib/lib1funcs.S
Quoted 2 lines

? ? ? ?$(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)

Quoted 6 lines
Quoted 3 lines

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

#15 lore raw

Re: [PATCH] ARM: zImage: Skip relinking if nothing changes

Hi,

Quoted 34 lines · Nicolas Pitre
Quoted 33 lines · Arnaud Lacombe
Quoted 32 lines · Arnaud Lacombe
Quoted 21 lines · Stephen Boyd
arch/arm/boot/compressed/Makefile +1 -1
index 0c74a6f..937fd26 100644
@@ -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

arch/arm/boot/compressed/Makefile +0 -0
@@ -121,9 +121,7 @@ LDFLAGS_vmlinux += -X

?LDFLAGS_vmlinux += -T

?# For __aeabi_uidivmod

arch/arm/boot/compressed/Makefile +1 -3
-lib1funcs = $(obj)/lib1funcs.o
-
-$(obj)/lib1funcs.S: $(srctree)/arch/$(SRCARCH)/lib/lib1funcs.S FORCE
+$(obj)/lib1funcs.S: $(srctree)/arch/$(SRCARCH)/lib/lib1funcs.S
Quoted 2 lines

? ? ? ?$(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'

Quoted 9 lines
Quoted 3 lines

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

#16 lore raw

Re: [PATCH] ARM: zImage: Skip relinking if nothing changes

Quoted 43 lines · Arnaud Lacombe

Hi,

Quoted 40 lines · Nicolas Pitre
Quoted 30 lines · Arnaud Lacombe
Quoted 29 lines · Arnaud Lacombe
Quoted 21 lines · Stephen Boyd
arch/arm/boot/compressed/Makefile +1 -1
index 0c74a6f..937fd26 100644
@@ -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

arch/arm/boot/compressed/Makefile +0 -0
@@ -121,9 +121,7 @@ LDFLAGS_vmlinux += -X

?LDFLAGS_vmlinux += -T

?# For __aeabi_uidivmod

arch/arm/boot/compressed/Makefile +1 -3
-lib1funcs = $(obj)/lib1funcs.o
-
-$(obj)/lib1funcs.S: $(srctree)/arch/$(SRCARCH)/lib/lib1funcs.S FORCE
+$(obj)/lib1funcs.S: $(srctree)/arch/$(SRCARCH)/lib/lib1funcs.S
Quoted 2 lines

? ? ? ?$(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)

Quoted 6 lines
Quoted 3 lines

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?

Quoted 7 lines
Quoted 2 lines

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.

#17 lore raw

Re: [PATCH] ARM: zImage: Skip relinking if nothing changes

Quoted 53 lines · Russell King - ARM Linux
Quoted 40 lines · Arnaud Lacombe

Hi,

Quoted 37 lines · Nicolas Pitre
Quoted 36 lines · Arnaud Lacombe
Quoted 26 lines · Arnaud Lacombe
Quoted 14 lines · Stephen Boyd
arch/arm/boot/compressed/Makefile +1 -1
index 0c74a6f..937fd26 100644
@@ -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

arch/arm/boot/compressed/Makefile LDFLAGS_vmlinux += -X · line 126

Quoted 9 lines
arch/arm/boot/compressed/Makefile +1 -3
@@ -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:

Quoted 6 lines

$(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 :-)

Quoted 8 lines
Quoted 4 lines

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.

Quoted 9 lines

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?

#18 lore raw

Re: [PATCH] ARM: zImage: Skip relinking if nothing changes

Hi,

Quoted 71 lines · Troy Kisky
Quoted 70 lines · Russell King - ARM Linux
Quoted 53 lines · Arnaud Lacombe

Hi,

Quoted 49 lines · On Wed, Aug 17, 2011 at 11:44 PM, Nicolas Pitre<[email protected]> ?wrote:
Quoted 38 lines · Arnaud Lacombe
Quoted 35 lines · On Fri, Aug 12, 2011 at 4:48 PM, Arnaud Lacombe<[email protected]> ?wrote:
Quoted 24 lines · On Fri, Aug 12, 2011 at 3:00 PM, Stephen Boyd<[email protected]> ?wrote:
arch/arm/boot/compressed/Makefile +1 -1
index 0c74a6f..937fd26 100644
@@ -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

arch/arm/boot/compressed/Makefile +0 -0
@@ -121,9 +121,7 @@ LDFLAGS_vmlinux += -X

?LDFLAGS_vmlinux += -T

?# For __aeabi_uidivmod

arch/arm/boot/compressed/Makefile +1 -3
-lib1funcs = $(obj)/lib1funcs.o
-
-$(obj)/lib1funcs.S: $(srctree)/arch/$(SRCARCH)/lib/lib1funcs.S FORCE
+$(obj)/lib1funcs.S: $(srctree)/arch/$(SRCARCH)/lib/lib1funcs.S
Quoted 2 lines

? ? ? ?$(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)

Quoted 6 lines
Quoted 3 lines

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?

Quoted 7 lines
Quoted 2 lines

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.

Quoted 8 lines
Quoted 6 lines

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

#19 lore raw
In reply to Sam Ravnborg

Hi,

Quoted 28 lines · Sam Ravnborg
Quoted 15 lines · Stephen Boyd

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

Quoted 2 lines

Is there any way to avoid this? Perhaps the shipped command could become a bit wiser?

Following patch will likely fix it:

arch/arm/boot/compressed/Makefile +0 -0
index 0c74a6f..80b6b6e 100644
@@ -123,7 +123,7 @@ LDFLAGS_vmlinux += -T

?# For __aeabi_uidivmod
?lib1funcs = $(obj)/lib1funcs.o

Quoted 4 lines

-$(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

Quoted 17 lines

?# 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

#20 lore raw
Quoted 37 lines · Arnaud Lacombe

Hi,

Quoted 28 lines · Sam Ravnborg
Quoted 15 lines · Stephen Boyd

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

Quoted 2 lines

Is there any way to avoid this? Perhaps the shipped command could become a bit wiser?

Following patch will likely fix it:

arch/arm/boot/compressed/Makefile +0 -0
index 0c74a6f..80b6b6e 100644
@@ -123,7 +123,7 @@ LDFLAGS_vmlinux += -T

?# For __aeabi_uidivmod
?lib1funcs = $(obj)/lib1funcs.o

Quoted 4 lines

-$(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:

Quoted 6 lines

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

#21 lore raw

Hi,

Quoted 40 lines · Sam Ravnborg
Quoted 39 lines · Arnaud Lacombe

Hi,

Quoted 28 lines · Sam Ravnborg
Quoted 15 lines · Stephen Boyd

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

Quoted 2 lines

Is there any way to avoid this? Perhaps the shipped command could become a bit wiser?

Following patch will likely fix it:

arch/arm/boot/compressed/Makefile +0 -0
index 0c74a6f..80b6b6e 100644
@@ -123,7 +123,7 @@ LDFLAGS_vmlinux += -T

?# For __aeabi_uidivmod
?lib1funcs = $(obj)/lib1funcs.o

Quoted 4 lines

-$(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:

Quoted 8 lines
Quoted 4 lines

$(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