[cfe-dev] Building Cross Compiler

Daniel Dilts diltsman at gmail.com
Thu Jan 15 21:13:02 PST 2015


I have done that with the --target flag, but I am attempting to use the
clang I am compiling to build compiler-rt.  I can't figure out how to get
compiler-rt's build system to attempt to compile for anything except i386,
so I am going to try to build an ARM cross compiler to see if that will
build compiler-rt for ARM.

On Thu, Jan 15, 2015 at 7:51 PM, Force.Charlie <ipvb at qq.com> wrote:

> By default ,Clang is full-Target compiler ,it's size 30MB+, default target
> like i686-pc-win32.
> and Your can use:
> *clang --target=armv7a-none-eabi*
> or
> *clang -target armv7a-none-eabi *
> Android NDK .ToolChain clang default target is x86.
>
>
> ------------------ 原始邮件 ------------------
> *发件人:* "Daniel Dilts"<diltsman at gmail.com>;
> *发送时间:* 2015年1月16日(星期五) 凌晨5:53
> *收件人:* "Clang"<cfe-dev at cs.uiuc.edu>;
> *主题:* [cfe-dev] Building Cross Compiler
>
> I am using the following CMake command to (hopefully) build a cross
> compiler.
>
> cmake -DLLVM_TARGET_ARCH=ARM -DLLVM_TARGETS_TO_BUILD=ARM
> -DLLVM_DEFAULT_TARGET_TRIPLE=armv7a-none-eabi -DCMAKE_CROSSCOMPILING=True
> ..\llvm
>
> In the CMake output I see
>
> -- Target triple: i686-pc-win32
> -- Native target architecture is ARM
>
> Which confused me.  I spent two days (5 minutes here and there) trying to
> get the triple right before I gave up.  I compiled the VS2013 solution that
> was generated and then ran clang --version and got the following output
>
> PS D:\llvm\build> clang --version
> clang version 3.7.0 (trunk 226193)
> Target: armv7a-none--eabi
> Thread model: posix
>
> It seems that the CMake script outputs the wrong triple, but clang outputs
> the correct triple (with an extra '-').  Am I missing something or is this
> a bug in the build script?
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150115/3d574a9b/attachment.html>


More information about the cfe-dev mailing list