I was unable to find detailed information about the build and tests of compiler-rt and libunwind. They become runtimes but no details how they can be built and tested, what options are on and so on. E.g. libunwind uses compiler-rt, compiler-rt uses libunwind, compiler-rt uses libcxx, libcxx uses compiler-rt and it becomes confusing without examples at least. Compiler-rt also becomes a huge project with sanitizers, fuzzers, profile, scudo, crt etc which is not explained how they can be built and tested standalone or in their interaction with other LLVM tools.
I believe you are looking for the so called runtimes build:
Note that compiler-rt is somehow missing.
Yes, libunwind information is missing at GitHub - llvm-mirror/libunwind: Mirror kept for legacy. Moved to https://github.com/llvm/llvm-project. Compiler-rt states that Tests for sanitizer runtimes are ported to llvm-lit and are run by make check-all command in LLVM/Clang/compiler-rt build tree.
https://compiler-rt.llvm.org/ It turns out that I have to rebuild the whole LLVM in order only to run the compiler-rt tests or I misunderstand it?!
I asked about this a while ago, the intent is to deprecate putting compiler-rt in PROJECTS - Should buildbots switch to ENABLE_RUNTIMES instead of ENABLE_PROJECTS for compiler-rt?
Putting it in RUNTIMES iirc does work the issue was getting the tests to run properly. I think that has been fixed for the majority of configurations.
Just FYI that is not being updated anymore, llvm-project/libunwind at main · llvm/llvm-project · GitHub is the latest now that we’re using Github for hosting officially.
Though it turns out that nothing much has changed in the meantime
I think you are referring to:
To build it together, simply add compiler-rt to the -DLLVM_ENABLE_RUNTIMES= option to cmake.
To build it separately, first build LLVM separately to get llvm-config binary, and then run:
It depends what you have already. If you have a release of llvm or a build you’ve already done, it will include an llvm-config already and you can use that. In that case it will just build compiler-rt and you can run the tests from there.
(so in that case check-all means check compiler-rt because that’s all you built)
If you use the runtimes build it will build a new clang, then use that to build compiler-rt. This can be useful if you don’t have a clang, or have a very old clang that wouldn’t be able to build compiler-rt.
Thank you. I am just asking if your answer and similar ones are not recorded as official build instuctions at the LLVM site and we can build it easy and not wasting time to look for it at other doubtful resources. What I do is now I have to make ezperiments and look for other people’s answers on forums to find the right configure. And most of them turn wrong. So, I am just asking to post more detailed build and test instructions. E.g. if I place compiler-rt in runtimes, cmake stops and asks for git, resource dir etc. How is then built as a runtime and I have to switch again to projects. Libunwind returns bad wind FDE error in clang tests. It is not clearly explained when and how we should use it as project, as a runtime, what is built first and then next what is required.