[PATCH] [docs] Add necessary CMake options for cross-compiling

Chris Bieneman via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 29 09:35:13 PDT 2016


This LGTM. We should probably at some point clarify that this document isn’t really documentation of using CMake to cross compile as much as a tutorial for cross-targeting ARM Linux from x86_64 Linux.

-Chris
 
> On Jul 28, 2016, at 8:39 PM, Vedant Kumar <vsk at apple.com> wrote:
> 
> LGTM with a nit.
> 
> + Chris Bieneman in case any more changes are needed.
> 
> vedant
> 
>> On Jun 30, 2016, at 1:33 AM, He Kuang via llvm-commits <llvm-commits at lists.llvm.org> wrote:
>> 
>> Mention CMAKE_{C,CXX}_COMPILER in CMake options section for
>> cross-compiling. If user follows the current docs without those options,
>> the building system will succesfully generate the wrong result by using
>> the host compiler. This may take extra works to find the answer from
>> other docs[1].
>> 
>> [1]: http://www.vtk.org/Wiki/CMake_Cross_Compiling#Information_how_to_set_up_various_cross_compiling_toolchains
>> 
>> Signed-off-by: He Kuang <hekuang at huawei.com>
>> ---
>> docs/HowToCrossCompileLLVM.rst | 5 +++++
>> 1 file changed, 5 insertions(+)
>> 
>> diff --git a/docs/HowToCrossCompileLLVM.rst b/docs/HowToCrossCompileLLVM.rst
>> index e71c0b0..e05fcb7 100644
>> --- a/docs/HowToCrossCompileLLVM.rst
>> +++ b/docs/HowToCrossCompileLLVM.rst
>> @@ -48,6 +48,11 @@ The CMake options you need to add are:
>> * ``-DLLVM_TARGET_ARCH=ARM``
>> * ``-DLLVM_TARGETS_TO_BUILD=ARM``
>> 
>> +And specifiy the cross-compiler to use:
> 
> specifiy -> specify
> 
> 
>> +
>> + * ``-DCMAKE_C_COMPILER=<c-cross-compiler>``
>> + * ``-DCMAKE_CXX_COMPILER=<c++-cross-compiler>``
>> +
>> If you're compiling with GCC, you can use architecture options for your target,
>> and the compiler driver will detect everything that it needs:
>> 
>> -- 
>> 1.8.5.2
>> 
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160729/a7195ca1/attachment.html>


More information about the llvm-commits mailing list