<div dir="ltr">There must be some misunderstanding there.<div><br></div><div>The goal is to write:</div><div><br></div><div>> clang++ -target sparc--netbsd -mcpu=... compile_flags --sysroot=... --toolchain=.. -o program.exe program.cpp</div><div><br></div><div>And clang will cross-compile program.cpp for this specific sparc cpu using the includes from the sysroot, and link using the linker and libraries from sysroot+toolchain.</div><div>I do no think there is any reason to try to use "<span style="color:rgb(0,0,0);font-size:12.8px">g++-arm-linux-gnueabi" with sysroot, and the fact that the g++ you refer to does not work with --sysroot is something not relevant to this clang user mailing list --- but I may be missing something. For your specific problem, you may want to give a try to the gcc packaged by linaro (</span><font color="#000000"><span style="font-size:12.8px"><a href="http://www.linaro.org/downloads/">http://www.linaro.org/downloads/</a></span></font><span style="color:rgb(0,0,0);font-size:12.8px">) which works pretty well in my experience.</span></div><div><span style="color:rgb(0,0,0);font-size:12.8px"><br></span></div><div><span style="color:rgb(0,0,0);font-size:12.8px">Kind regards,</span></div><div><span style="color:rgb(0,0,0);font-size:12.8px">Arnaud</span></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 24, 2016 at 8:29 PM, Jeffrey Walton <span dir="ltr"><<a href="mailto:noloader@gmail.com" target="_blank">noloader@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Thu, Mar 24, 2016 at 11:48 AM, Arnaud Allard de Grandmaison via<br>
cfe-users <<a href="mailto:cfe-users@lists.llvm.org">cfe-users@lists.llvm.org</a>> wrote:<br>
> Hi Patrick,<br>
><br>
> This is a common case when cross compiling, so clang knows how to use a<br>
> gcc-toolchain installation: you just have to pass it the "--sysroot=..." and<br>
> "--toolchain=..." arguments, and it will get the header files and linker /<br>
> assembler for your target --- assuming your gcc-toolchain has a standard<br>
> layout.<br>
<br>
</span>That last caveat is the one that gives me the most trouble on Ubuntu.<br>
They seem to have an odd layout for their ARM-HF toolchain, and using<br>
--sysroot fails to compile/link. Also see "g++-arm-linux-gnueabi<br>
cannot compile a C++ program with --sysroot",<br>
<a href="http://bugs.launchpad.net/ubuntu/+source/gcc-defaults-armel-cross/+bug/1375071" rel="noreferrer" target="_blank">http://bugs.launchpad.net/ubuntu/+source/gcc-defaults-armel-cross/+bug/1375071</a>.<br>
<br>
Jeff<br>
</blockquote></div><br></div>