[cfe-dev] Too much time to compile clang. Suggestions for a starter?

Oleksii Vilchanskyi via cfe-dev cfe-dev at lists.llvm.org
Sat Oct 21 03:10:40 PDT 2017

You can use gold <https://en.wikipedia.org/wiki/Gold_(linker)> to link.
To do so, pass -DLLVM_USE_LINKER=gold at CMake configure time.

This is also a good opportunity to point at a minor issue with CMake
configuration, where even after passing the above switch CMake will
still print

-- Linker detection: GNU ld

instead of

-- Linker detection: GNU Gold

I don't know whether it "just works" for others, but
<https://reviews.llvm.org/D38665> (unreviewed) fixes it for me.

On 21.10.2017 11:11, rNoz via cfe-dev wrote:
> I would like to start "touching" a bit the code, trying to create some
> functionalities, but I have no idea where to start, and I will need many
> trials/tests...
> So, one thing I was expecting is fast times to try (Modify-Compile-Run).
> I did:
> make clang
> and it needed like 3-4 hours. I am ok with that.
> Then, I add some "stupid" statement like 'int a = 3;' somewhere in
> llvm/tools/clang/lib/Frontend/Rewrite/FixItRewriter.cpp
> (FixitRewriter::Diag), and it needed:
> - *6.57s. to compile the target ('make clangRewriteFrontend').*
> - *4min 36.36s to link and build clang (`make clang`).*
> In both cases it spends almost all the time* linking* (first to a static
> lib, then to the clang binary itself).
> This is really a lot of time to try bit a bit without knowledge of the
> whole clang, compiling process, etc. Waiting up to is just really time
> consuming.
> What would you do to try the modifications faster?
> Any recomendation/blog/guide to follow as a starter trying to modify a
> bit the codebase of clang?
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev

Oleksii Vilchanskyi

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20171021/bc522eb3/attachment.sig>

More information about the cfe-dev mailing list