Skip to contentSkip to conversation

kernel: prevent unnecessary rebuilding due to config_data.gz

PATCH In review Peter Foley 3 participants 4 messages Jul 5, 2011 – Jul 19, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kernel: prevent unnecessary rebuilding due to config_data.gz

When IKCONFIG is built-in make oldconfig will cause the kernel to be relinked even if .config didn't change. This happens because of a config_data.gz dependency on .config. This patch changes the if_changed to a filechk so that config_data.h is only rebuilt when the contents have actually changed.

---
 kernel/Makefile |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
kernel/Makefile +2 -3
index 2d64cfc..d06467f 100644
@@ -125,11 +125,10 @@ targets += config_data.gz
 $(obj)/config_data.gz: $(KCONFIG_CONFIG) FORCE
 	$(call if_changed,gzip)
 
-quiet_cmd_ikconfiggz = IKCFG   $@
-      cmd_ikconfiggz = (echo "static const char kernel_config_data[] __used = MAGIC_START"; cat $< | scripts/bin2c; echo "MAGIC_END;") > $@
+      filechk_ikconfiggz = (echo "static const char kernel_config_data[] __used = MAGIC_START"; cat $< | scripts/bin2c; echo "MAGIC_END;")
 targets += config_data.h
 $(obj)/config_data.h: $(obj)/config_data.gz FORCE
-	$(call if_changed,ikconfiggz)
+	$(call filechk,ikconfiggz)
 
 $(obj)/time.o: $(obj)/timeconst.h
 
Signature · 1 line
1.7.5.3
#1 lore raw
Quoted 7 lines · On Tue, 05 Jul 2011 19:42:18 -0400 (EDT) Peter Foley wrote:

When IKCONFIG is built-in make oldconfig will cause the kernel to be relinked even if .config didn't change. This happens because of a config_data.gz dependency on .config. This patch changes the if_changed to a filechk so that config_data.h is only rebuilt when the contents have actually changed.

Michal,
If this looks OK to you, please merge it.

Thanks.

Quoted 13 lines
---
 kernel/Makefile |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
kernel/Makefile +0 -0
index 2d64cfc..d06467f 100644
@@ -125,11 +125,10 @@ targets += config_data.gz
 $(obj)/config_data.gz: $(KCONFIG_CONFIG) FORCE
 	$(call if_changed,gzip)
 

kernel/Makefile targets += config_data.gz · line 134

Quoted 10 lines
kernel/Makefile +2 -3
-quiet_cmd_ikconfiggz = IKCFG   $@
-      cmd_ikconfiggz = (echo "static const char kernel_config_data[] __used = MAGIC_START"; cat $< | scripts/bin2c; echo "MAGIC_END;") > $@
+      filechk_ikconfiggz = (echo "static const char kernel_config_data[] __used = MAGIC_START"; cat $< | scripts/bin2c; echo "MAGIC_END;")
 targets += config_data.h
 $(obj)/config_data.h: $(obj)/config_data.gz FORCE
-	$(call if_changed,ikconfiggz)
+	$(call filechk,ikconfiggz)
 
 $(obj)/time.o: $(obj)/timeconst.h
 

---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

#2 lore raw
Quoted 35 lines · Randy Dunlap
Quoted 7 lines · On Tue, 05 Jul 2011 19:42:18 -0400 (EDT) Peter Foley wrote:

When IKCONFIG is built-in make oldconfig will cause the kernel to be relinked even if .config didn't change. This happens because of a config_data.gz dependency on .config. This patch changes the if_changed to a filechk so that config_data.h is only rebuilt when the contents have actually changed.

Michal,
If this looks OK to you, please merge it.

Thanks.

Quoted 20 lines
---
 kernel/Makefile |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
kernel/Makefile +2 -3
index 2d64cfc..d06467f 100644
@@ -125,11 +125,10 @@ targets += config_data.gz
 $(obj)/config_data.gz: $(KCONFIG_CONFIG) FORCE
 	$(call if_changed,gzip)
 
-quiet_cmd_ikconfiggz = IKCFG   $@
-      cmd_ikconfiggz = (echo "static const char kernel_config_data[] __used = MAGIC_START"; cat $< | scripts/bin2c; echo "MAGIC_END;") > $@
+      filechk_ikconfiggz = (echo "static const char kernel_config_data[] __used = MAGIC_START"; cat $< | scripts/bin2c; echo "MAGIC_END;")
 targets += config_data.h
 $(obj)/config_data.h: $(obj)/config_data.gz FORCE
-	$(call if_changed,ikconfiggz)
+	$(call filechk,ikconfiggz)
 
Quoted 9 lines

kernel/Makefile targets += config_data.gz · line 134

Quoted 3 lines
kernel/Makefile +0 -0
 $(obj)/time.o: $(obj)/timeconst.h
 

---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***

Ping?

#3 lore raw
In reply to Randy Dunlap
Quoted 8 lines · Randy Dunlap
Quoted 6 lines · On Tue, 05 Jul 2011 19:42:18 -0400 (EDT) Peter Foley wrote:

When IKCONFIG is built-in make oldconfig will cause the kernel to be relinked even if .config didn't change. This happens because of a config_data.gz dependency on .config. This patch changes the if_changed to a filechk so that config_data.h is only rebuilt when the contents have actually changed.

Quoted 4 lines
Quoted 1 line

Michal,
If this looks OK to you, please merge it.

Thanks, merged to kbuild-2.6.git#kbuild.

Michal