mold
mold copied to clipboard
[Question] `gcc+mold` is much slower than `clang+mold` in `./configure`, does it normal?
Not an issue, more like a question:
When I try to run ./configure script with CC='gcc' CFLAGS='-fuse-ld=mold', I found that it is a bit faster than -fuse-ld=gold but still much slower with CC='clang' CFLAGS='-fuse-ld=mold'
My question is does it the expected result (clang is faster than gcc)? Or there is something missing in my CFLAGS/CXXFLAGS variable?
Any answer would be appreciated :)
(This is a request from one of our Chromebrew devs. The question is relevant because we made the mold linker the default earlier today. )
No, it's not expected. So, configure runs various commands one at a time to identify system's capabilities. Did you observe any specific step that is way slower than the others? Or, was every step generally slower?
Almost every step that needs to involve a compiler is slower... For instance, checking for stdio.h... takes ~0.2s on clang but ~1s on gcc
(according to config.log, all header checks are called with -c option passed to the compiler, which tells the compiler not to link it using a linker (Compile and assemble, but do not link.), maybe there is something wrong with the gcc build configuration I am using?)
I think we need to isolate the problem. Can you run the same command as the configure script runs to see if it is indeed slower? If it's slower, then we can probably use strace to see what the process is doing.