This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: libsanitizer builds slowly
- From: Konstantin Serebryany <konstantin dot s dot serebryany at gmail dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Mike Stump <mikestump at comcast dot net>, Kostya Serebryany <kcc at google dot com>, gcc List <gcc at gcc dot gnu dot org>, "H.J. Lu" <hongjiu dot lu at intel dot com>
- Date: Tue, 17 Dec 2013 08:45:13 +0400
- Subject: Re: libsanitizer builds slowly
- Authentication-results: sourceware.org; auth=none
- References: <01399663-DEE6-47B1-BA41-408E2653758A at comcast dot net> <20131216201707 dot GV892 at tucnak dot redhat dot com>
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 <jakub@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