aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/Makefile
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2013-02-14 18:13:55 -0500
committerMichal Marek <mmarek@suse.cz>2013-02-16 17:17:25 -0500
commit70730bca1331fc50c3caacaea00439de1325bd6e (patch)
tree43c9db2193af32e5aec6794dd67e0ae331380c31 /kernel/Makefile
parent6543becf26fff612cdadeed7250ccc8d49f67f27 (diff)
kernel: Replace timeconst.pl with a bc script
bc is the standard tool for multi-precision arithmetic. We switched to Perl because akpm reported a hard-to-reproduce build hang, which was very odd because affected and unaffected machines were all running the same version of GNU bc. Unfortunately switching to Perl required a really ugly "canning" mechanism to support Perl < 5.8 installations lacking the Math::BigInt module. It was recently pointed out to me that some very old versions of GNU make had problems with pipes in subshells, which was indeed the construct used in the Makefile rules in that version of the patch; Perl didn't need it so switching to Perl fixed the problem for unrelated reasons. With the problem (hopefully) root-caused, we can switch back to bc and do the arbitrary-precision arithmetic naturally. Signed-off-by: H. Peter Anvin <hpa@zytor.com> Cc: Andrew Morton <akpm@linux-foundation.org> Acked-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Michal Marek <mmarek@suse.cz>
Diffstat (limited to 'kernel/Makefile')
-rw-r--r--kernel/Makefile16
1 files changed, 12 insertions, 4 deletions
diff --git a/kernel/Makefile b/kernel/Makefile
index 6c072b6da239..ab1e0386bb2d 100644
--- a/kernel/Makefile
+++ b/kernel/Makefile
@@ -127,11 +127,19 @@ $(obj)/config_data.h: $(obj)/config_data.gz FORCE
127 127
128$(obj)/time.o: $(obj)/timeconst.h 128$(obj)/time.o: $(obj)/timeconst.h
129 129
130quiet_cmd_timeconst = TIMEC $@ 130quiet_cmd_hzfile = HZFILE $@
131 cmd_timeconst = $(PERL) $< $(CONFIG_HZ) > $@ 131 cmd_hzfile = echo "hz=$(CONFIG_HZ)" > $@
132
133targets += hz.bc
134$(obj)/hz.bc: $(objtree)/include/config/hz.h FORCE
135 $(call if_changed,hzfile)
136
137quiet_cmd_bc = BC $@
138 cmd_bc = bc -q $(filter-out FORCE,$^) > $@
139
132targets += timeconst.h 140targets += timeconst.h
133$(obj)/timeconst.h: $(src)/timeconst.pl FORCE 141$(obj)/timeconst.h: $(obj)/hz.bc $(src)/timeconst.bc FORCE
134 $(call if_changed,timeconst) 142 $(call if_changed,bc)
135 143
136ifeq ($(CONFIG_MODULE_SIG),y) 144ifeq ($(CONFIG_MODULE_SIG),y)
137# 145#