Hi all. I'm trying to make it faster to re-build rustc after a
./x.py clean (or
git clean -xfd etc.). rustc guide shows a way to use system LLVM which I haven't tried it yet, but I'm wondering why we need to build LLVM from source if standard LLVM dists work. I think rustc guide doesn't say. Can I always use LLVM 7 to bootstrap rustc, or are there any features that won't work or tests that fail if I do that?
(Sorry if this is not the right place for this question! Let me know if that's the case and I'll ask elsewhere)
I'm using llvm9 and it works
you can set it in
config.toml there is a field with the
Thanks. I have LLVM 8 installed and I'm trying with that currently. The question mainly is what do I lose by using system LLVM instead of in-tree.
Hmm, I'm getting
thread 'main' panicked at 'FileCheck executable "/usr/lib/llvm-8/bin/FileCheck" does not exist', src/bootstrap/sanity.rs:167:9
We have a couple of patches in our fork of LLVM that are rust specific. Sometimes they can be critical for Rust to produce working machine code while we wait for upstream to catch up
but currently its just a few patches that e.g. enable dead allocations to be removed by making llvm know about our symbol names.
OK, thanks. Do we have a specified LLVM version that's supposed to work when booting rustc? Or is only the in-tree one is officially supported? I'm currently trying with LLVM 8 but build fails when building
we used to support back to LLVM 6 back when we needed emscripten to work, but now that it is no longer the case, I believe the only version we actively maintain support for is the in-tree one. The same release of external LLVM should in most cases still work.
I suppose that an alternative is having the llvm repository locally, build it and point to it in the
config.toml. You can rebuild it once in a while
FWIW we do have a CI builder that tests on Linux with LLVM 6, so it should not break at least on that platform. I don't expect we'll get rid of that any time soon, either, since some Linux distros package rustc with their system LLVM instead of our fork.
Update: I was able to build rustc with LLVM 9 (failed to build with 7 and 8).