<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, May 12, 2015 at 11:19 AM, Renato Golin <span dir="ltr"><<a href="mailto:renato.golin@linaro.org" target="_blank">renato.golin@linaro.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="">On 12 May 2015 at 09:55, Guilherme <<a href="mailto:guibufolo%2Bllvm@gmail.com">guibufolo+llvm@gmail.com</a>> wrote:<br>
</span><span class="">> But what I could not find is a list, link or reference to where get a<br>
> version of clang for windows which is able to cross-compile to ARM.<br>
<br>
</span>Hi Guilherme,<br>
<br>
Clang+LLVM is a native cross-compiler. If the appropriate back-end is<br>
bundled, it will produce that target's assembly or, if integrated<br>
assembler is supported, object files. But it will not generate<br>
executables, since we don't distribute (yet) a cross-linker, nor all<br>
targets' libraries. You'll need to source that elsewhere.<br>
<span class=""><br>
<br>
> D:\Playground\xcompile-arm>c:\llvm\bin\clang.exe -target<br>
> armv7-unknown-none-elf main.c<br>
> clang.exe: warning: unknown platform, assuming -mfloat-abi=soft<br>
> clang.exe: warning: unknown platform, assuming -mfloat-abi=soft<br>
<br>
</span>It seems that your binary doesn't have the ARM back-end compiled with<br>
it. I believe we should be a lot better in specifying this, as this<br>
error message is very misleading.<br>
<br>
It also seems that the PowerPC back-end was not compiled with your<br>
binary, so you'll need to either find someone that has compiled a<br>
Windows binary that can cross-compile to PPC, or do it yourself.<br>
<br>
By default, a standard build of LLVM builds *all* back-ends, so if you<br>
just follow the website's "getting started" guide, you'll get all you<br>
need in the compiler side.<br></blockquote><div><br></div><div>So it seems that the provided binary on the llvm site does not have *all* the backends. I get following error when trying to create an object file.<br><br>D:\Playground\xcompile-arm>c:\llvm\bin\clang.exe -target powerpc-unknown-none-eabi -c main.c<br>Assembler messages:<br>Fatal error: invalid listing option `3'<br>clang.exe: error: assembler command failed with exit code 1 (use -v to see invocation)<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
But you'll still need a PPC linker, and probably some PPC static<br>
libraries for bare-metal.<br>
<span class=""><br>
<br>
> For the sys part of the triple, if i'm doing bare metal development, should<br>
> i use None? What exactly does the sys part change when compiling code?<br>
<br>
</span>In ARM, "none-eabi" specifies bare-metal, I don't know in PPC. Triples<br>
have a lot of target specific idiosyncrasies, and that's older than<br>
LLVM, so we're just following the legacy. :)<br>
<br>
cheers,<br>
--renato<br></blockquote><div><br></div><div>How do i find out what the proper triple is? Can somebody help me? <br></div></div><br></div></div>