<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">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>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">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><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><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 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 class="gmail_extra"><br></div><div class="gmail_extra">cheers,</div><div class="gmail_extra">--renato</div></div>