Slowness of glibc build process
At least 50% of the time the glibc build spends in GNU make is spent adding pattern rules while reading in the makefile. Pattern rules are those containing "%" wildcards. glibc uses a lot of pattern rules, and make takes O(n^2) time reading them in.
How could we speed up glibc's use of make?
- Change GNU make
- Change glibc's build process. This could have the advantage of making it easier to understand.
- Could we expand out sysd-rules so that it uses concrete rules instead of pattern rules?
- That might produce more rules than before. That might be OK if they can be processed in O(n) time.
- The order of the rules is significant. They are used for searching multiple sysdeps directories.
- The pattern rules in sysd-rules interact with concrete rules in sysd-sysdeps (also automatically generated, by sysdeps/unix/Makefile and sysdeps/unix/make-syscalls.sh), which specify how to generate syscall object files using the assembler. Pattern rules are only used when no concrete rule matches. A further complication is that make-syscalls.sh looks for override files such as nptl/sysdeps/unix/sysv/linux/i386/fork.c in sysdeps directories.
The rules generate object files into the directory of the Makefile that includes them ($(objpfx)).
- Could we expand out sysd-rules so that it uses concrete rules instead of pattern rules?
How can we test that any changes don't change the meaning?
