[llvm-dev] Building the CRT

Evandro Menezes via llvm-dev llvm-dev at lists.llvm.org
Thu Mar 23 16:26:42 PDT 2017


On 03/20/2017 04:33 PM, Jonathan Roelofs wrote:
> On 3/20/17 3:21 PM, Evandro Menezes via llvm-dev wrote:
>> On 03/20/2017 03:33 PM, Jonathan Roelofs wrote:
>>> On 3/20/17 1:47 PM, Evandro Menezes via llvm-dev wrote:
>>>> Folks,
>>>>
>>>> I'm at a loss trying to add Compiler-RT to an LLVM build, even after
>>>> checking out the instructions at http://compiler-rt.llvm.org, so I'd
>>>> appreciate your help.
>>>>
>>>> I've tried adding the CMake options LLVM_ENABLE_PROJECTS,
>>>> LLVM_BUILD_EXTERNAL_COMPILER_RT, LLVM_EXTERNAL_COMPILER_RT_SOURCE_DIR,
>>>> CLANG_DEFAULT_RTLIB.  All to no avail.
>>>
>>> You'll need to give a lot more details on what you tried, and how it
>>> failed. Without that information, nobody can really help you.
>>
>> OK, what else can I say?
>>
>> I checked out the projects side by side, as I usually do:
>>
>>    ~/src/llvm.tip $ ls
>>    clang              compiler-rt  klee    libcxx     lld   llvm
>>    clang-tools-extra  dragonegg    libclc  libcxxabi  lldb polly
>
> The instructions on http://compiler-rt.llvm.org are for building 
> compiler-rt separately from llvm, which is not how most people build 
> it. If you're just getting started with it, I'd recommend doing it the 
> other way, and that is to do a combined-tree build. For that you'll want:
>
>     *  symlinks in llvm/runtimes to each of libcxx, libcxxabi, 
> compiler-rt respectively
>     *  symlinks in llvm/tools to clang, lld, and lldb respectively
>     *  symlink from llvm/tools/clang/tools/extra to clang-tools-extra


compiler-rt needs clang to be able to generate the code for the intended 
targets.  The suggestion above finally worked, but got stopped at the 
lack of a multiarch linker and archiver.  And the build files of 
compiler-rt don't seem to provide a way to specify either for specific 
targets.  Building compiler-rt separately from clang might allow one to 
specify ancillary tools used just for its build.

Thank you,


-- 
/Evandro Menezes/



More information about the llvm-dev mailing list