<div dir="ltr">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.</div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jan 15, 2015 at 7:51 PM, Force.Charlie <span dir="ltr"><<a href="mailto:ipvb@qq.com" target="_blank">ipvb@qq.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>By default ,Clang is full-Target compiler ,it's size 30MB+, default target like i686-pc-win32.</div><div>and Your can use: </div><div><i>clang --target=armv7a-none-eabi</i></div><div>or</div><div><i>clang -target armv7a-none-eabi </i></div><div>Android NDK .ToolChain clang default target is x86.</div><div><br></div><div><br></div><div style="padding:2px 0px;font-family:Arial Narrow;font-size:12px">------------------ 原始邮件 ------------------</div><div style="background:rgb(239,239,239);padding:8px;font-size:12px"><div><b>发件人:</b> "Daniel Dilts"<<a href="mailto:diltsman@gmail.com" target="_blank">diltsman@gmail.com</a>>; </div><div><b>发送时间:</b> 2015年1月16日(星期五) 凌晨5:53</div><div><b>收件人:</b> "Clang"<<a href="mailto:cfe-dev@cs.uiuc.edu" target="_blank">cfe-dev@cs.uiuc.edu</a>>; </div><div><b>主题:</b> [cfe-dev] Building Cross Compiler</div></div><div class="HOEnZb"><div class="h5"><div><br></div><div dir="ltr"><div>I am using the following CMake command to (hopefully) build a cross compiler.</div><div><br></div><div>cmake -DLLVM_TARGET_ARCH=ARM -DLLVM_TARGETS_TO_BUILD=ARM -DLLVM_DEFAULT_TARGET_TRIPLE=armv7a-none-eabi -DCMAKE_CROSSCOMPILING=True ..\llvm</div><div><br></div><div>In the CMake output I see </div><div><br></div><div>-- Target triple: i686-pc-win32<br>-- Native target architecture is ARM</div><div><br></div><div>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</div><div><br></div><div>PS D:\llvm\build> clang --version<br>clang version 3.7.0 (trunk 226193)<br>Target: armv7a-none--eabi<br>Thread model: posix</div><div><br></div><div>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?<br></div></div>
</div></div></blockquote></div><br></div>