<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Nov 26, 2013 at 11:44 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:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div class="im">On 26 November 2013 15:36, Rob Stewart <span dir="ltr"><<a href="mailto:robstewart57@gmail.com" target="_blank">robstewart57@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">$ clang -v -target armv7a-linux-eabi -mcpu=cortex-a9 -mfloat-abi=soft<br>


-mfpu=neon helloworld.c<br></blockquote><div><br></div></div><div>Hi Rod,</div><div><br></div><div>You need cross-binutils installed on your box. If you use Debian, there are packages (gcc-4.7-arm-linux-gnueabi and friends). Other distros may have similar packages, but you can always download the Linaro toolchain (<a href="http://releases.linaro.org/latest/components/toolchain" target="_blank">http://releases.linaro.org/latest/components/toolchain</a>).</div>

<div><br></div><div>Supposing you already have it, and it's in the PATH, Clang only recognizes it automatically if your triple is identical to the name of your cross compiler (See "Toolchain Options" in the referred doc). That means, you either need to have an "armv7a-linux-eabi-gcc" on the path, or you have to change your triple to something like "arm-linux-gnueabi", because that's what your cross-GCC will probably be called. The -mcpu will take care of choosing v7A.</div>

<div><br></div><div>Otherwise, you'll have to set --sysroot or --gcc-name as well as the triple, but that's not recommended.</div><div class="im"><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

 "/usr/bin/as" -mfpu=neon -mfloat-abi=soft -mcpu=cortex-a9 -mfpu=neon<br></blockquote><div></div></div></div><br></div><div class="gmail_extra">As you can see, it chose the platform assembler, which is x86_64-only, not a cross-assembler. That's the hint that Clang didn't find your cross-binutils.</div>
</div></blockquote><div><br></div><div>Out of curiosity, can't clang do the assembly itself in this case?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">
<div class="gmail_extra"><br></div><div class="gmail_extra">I know, Clang could have better error detection and stop when it's clearly the wrong architecture, but hey, Clang can deal with all archs on the same binary, there's no reason your system assembler (whatever it is) can't, too. One day, LLVM binutils will be... ;)</div>
</div></blockquote><div><br></div><div>Well, just remember that the GNU binutils that those tools are derived from support far more architectures (3x, 5x?) than LLVM does (just supporting linux requires like 30 architectures). When we get to that point, it will probably not make sense for a distro to ship a binary targeting all the architectures that we support, for the same reason it doesn't make sense for them to install binaries for every target supported by the GNU toolchain. (but at least in LLVM's case, it would be a conscious tradeoff, while IIRC the GNU toolchain simply can't be built in a way that targets all of them from a single binary).</div>
<div><br></div><div>-- Sean Silva</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">
<div class="gmail_extra"><br></div><div class="gmail_extra">cheers,</div><div class="gmail_extra">--renato</div></div>
<br>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br></blockquote></div><br></div></div>