FTR, LLVM build system takes 6 seconds to build asan&tsan run-time (well, I have a good machine). % date; ninja libclang_rt.asan-x86_64.a libclang_rt.asan-i386.a libclang_rt.tsan-x86_64.a; date Tue Dec 17 08:34:14 MSK 2013 [126/126] Linking CXX static library lib/clang/3.5/lib/linux/libclang_rt.tsan-x86_64.a Tue Dec 17 08:34:20 MSK 2013
The amount of work here is less than in GCC build system because on linux LLVM doesn't build .so variant of run-time, only the .a variant. (BTW, I remain unconvinced that we need asan.so or tsan.so on linux, but that's another story) Indeed, the compile time is dominated by asan_interceptors.cc: % touch ~/llvm/projects/compiler-rt/lib/asan/asan_interceptors.cc % date; ninja libclang_rt.asan-x86_64.a libclang_rt.asan-i386.a ; date Tue Dec 17 08:39:38 MSK 2013 [4/4] Linking CXX static library lib/clang/3.5/lib/linux/libclang_rt.asan-i386.a Tue Dec 17 08:39:42 MSK 2013 But I think that 4 seconds for one file (+link time) is reasonable enough. --kcc On Tue, Dec 17, 2013 at 12:17 AM, Jakub Jelinek <ja...@redhat.com> wrote: > On Mon, Dec 16, 2013 at 12:04:09PM -0800, Mike Stump wrote: >> I've been doing make -j70 and -j70 restrap and libasan seems to build 1 file >> at a time. > > That is certainly not the case, look more carefully and you'll note that it > will start compiling tons of sources at once, the problem is just that there > is one > file that takes significantly longer to compile than any other > (asan_interceptors.cc), and with multilib it is compiled 4 times effectively > sequentially (because, libtool always compiles the -fPIC and non-pic > versions one after each other), and multilib variants are also serialized. > > Jakub