[cfe-dev] 回复: Building Cross Compiler

Force.Charlie ipvb at qq.com
Thu Jan 15 19:51:50 PST 2015


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/20150116/1d1438ac/attachment.html>


More information about the cfe-dev mailing list