[LLVMdev] How to determine the architecture that clang/llvm will compile in CMake.

Jonathan Roelofs jonathan at codesourcery.com
Tue May 26 08:22:52 PDT 2015



On 5/26/15 9:01 AM, Peyton, Jonathan L wrote:
> Thank you. It does help!

Another suggestion: You should model this after the equivalent support 
in compiler-rt as it has to solve the same problem.

Be especially mindful of the distinction between the just-built clang, 
and the host compiler being used to build clang. The cmake flag 
`LLVM_BUILD_EXTERNAL_COMPILER_RT` is used to make sure that compiler-rt 
is built using the just-built clang. See clang/runtime/CMakeLists.txt.


Jon

>
> -- Johnny
>
> *From:* Daniel Sanders [mailto:Daniel.Sanders at imgtec.com]
> *Sent:* Tuesday, May 26, 2015 5:14 AM
> *To:* Peyton, Jonathan L; llvmdev at cs.uiuc.edu
> *Subject:* RE: [LLVMdev] How to determine the architecture that
> clang/llvm will compile in CMake.
>
> Hi,
>
> The default CMake options produce a compiler that is capable of
> targeting all the architectures that were present in the source tree.
> The list of supported architectures can be reduced using
> LLVM_TARGETS_TO_BUILD in case you want to save disk-space,
> compilation-time, etc.. The default architecture targeted by the
> resulting compiler is specified by LLVM_TARGET_ARCH and
> LLVM_DEFAULT_TARGET_TRIPLE.
>
> Hope that helps.
>
> *From:*llvmdev-bounces at cs.uiuc.edu <mailto:llvmdev-bounces at cs.uiuc.edu>
> [mailto:llvmdev-bounces at cs.uiuc.edu] *On Behalf Of *Peyton, Jonathan L
> *Sent:* 22 May 2015 19:12
> *To:* llvmdev at cs.uiuc.edu <mailto:llvmdev at cs.uiuc.edu>
> *Subject:* [LLVMdev] How to determine the architecture that clang/llvm
> will compile in CMake.
>
> I’ve been working on getting the LLVM OpenMP library to build smoothly
> alongside llvm/clang using CMake, but one problem I’m having is
> determining exactly which CMake option designates the architecture the
> compiler will compile.  I see LLVM_TARGET_ARCH, LLVM_TARGETS_TO_BUILD,
> LLVM_DEFAULT_TARGET_TRIPLE, etc.
>
> I thought I should just ask which one designates the architecture the
> compiler will build, but I wouldn’t mind an explanation for all of them J
>
> And yes, I’ve looked at http://llvm.org/docs/CMake.html
> <https://urldefense.proofpoint.com/v2/url?u=http-3A__llvm.org_docs_CMake.html&d=AwMFAg&c=8hUWFZcy2Z-Za5rBPlktOQ&r=Mfk2qtn1LTDThVkh6-oGglNfMADXfJdty4_bhmuhMHA&m=y71jwqIExOpM3n490cz13SVJmybYCml5fWmWLCtYDQc&s=ufiTk8h8xDI8qA2S1uu1O39smCzzKWdbMH3ys2M-Cdw&e=>,
> but am still confused.
>
> Any help is greatly appreciated!
>
> -- Johnny
>
>
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>

-- 
Jon Roelofs
jonathan at codesourcery.com
CodeSourcery / Mentor Embedded




More information about the llvm-dev mailing list