bc
is used during the kernel build to generate time constants in header files. You can see it invoked in Kbuild
, where it processes kernel/time/timeconst.bc
to generate timeconst.h
.
This could be implemented as a C program which is built and run during the build, but it’s easier to use bc
(which is small and common; in fact it’s part of the set of tools which are mandatory on a POSIX systems — the kernel does expect GNU bc
though).
bc
is used here instead of Perl. The commit message suggests that bc
was used previously, but I can’t find a trace of that; Perl has been used since 2008 (much to some people’s chagrin, although that patch set was never merged).