<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="font-size: 12px;font-family: Arial Narrow;padding:2px 0 2px 0;">------------------ 原始邮件 ------------------</div><div style="font-size: 12px;background:#efefef;padding:8px;"><div><b>发件人:</b> "Daniel Dilts"<diltsman@gmail.com>; </div><div><b>发送时间:</b> 2015年1月16日(星期五) 凌晨5:53</div><div><b>收件人:</b> "Clang"<cfe-dev@cs.uiuc.edu>; </div><div><b>主题:</b> [cfe-dev] Building Cross Compiler</div></div><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>