[cfe-dev] Cross compiling with clang
mats petersson
mats at planetcatfish.com
Tue May 12 02:09:10 PDT 2015
You will need to have a full set of "binary tools" for ARM - or at least a
linker, C/C++ library and a debugger that understands ARM.
You can almost certainly build the Clang + LLVM toolchain into something
that will work for you, but you will need to do some more work than you
have so far, and it may involve some interesting challenges in building
tools that work on Windows...
--
Mats
On 12 May 2015 at 09:55, Guilherme <guibufolo+llvm at gmail.com> wrote:
> Hello,
>
> I would like to cross compile C code i have to ARM. My host system is a
> windows machine.
>
> I have found, the rather short,
> http://clang.llvm.org/docs/CrossCompilation.html guide and it does
> concisely explain what you need to do when you have a version of clang that
> is able to cross compile.
>
> But what I could not find is a list, link or reference to where get a
> version of clang for windows which is able to cross-compile to ARM.
>
> Using the version I got from the downloads site i get:
> D:\Playground\xcompile-arm>c:\llvm\bin\clang --version
> clang version 3.5.0 (217039)
> Target: i686-pc-windows-gnu
> Thread model: posix
>
> D:\Playground\xcompile-arm>c:\llvm\bin\clang.exe -target
> armv7-unknown-none-elf main.c
> clang.exe: warning: unknown platform, assuming -mfloat-abi=soft
> clang.exe: warning: unknown platform, assuming -mfloat-abi=soft
> c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe:
> C:\Users\uidw8099\AppData\Local\Temp\main-4763a2.o: Relocations in generic
> ELF (EM: 40)
> C:\Users\uidw8099\AppData\Local\Temp\main-4763a2.o: error adding symbols:
> File in wrong format
> collect2.exe: error: ld returned 1 exit status
> clang.exe: error: linker (via gcc) command failed with exit code 1 (use -v
> to see invocation)
>
> Second: I'm not able to find which sub-arch a certain processor belongs
> to: For instance i have a e200z4, which sub-arch does it belong to? Can i
> read that from the Reference manual?
>
> For the sys part of the triple, if i'm doing bare metal development,
> should i use None? What exactly does the sys part change when compiling
> code?
>
> Thank you for your help
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150512/415b2bb0/attachment.html>
More information about the cfe-dev
mailing list