<div dir="ltr">Hello,<div><br></div><div>I'm currently trying to get Clang to work as a cross compiler in order to enable my colleges to compile the code for Linux (x86_64) on Windows. So far I have a working version GCC to cross compile my, so I have access to the native linkers and binary tools on Windows.</div>
<div><br></div><div>I'm currently using the windows snapshot build of clang and I'm trying to compile a simple hello world example in both C and C++. I invoke clang as follows:</div><div><br></div><div>clang --target=x86_64-unknown-linux-gnu --toolchain=<toolchain-dir> main.c</div>
<div><br></div><div>clang++ --target=x86_64-unknown-linux-gnu --toolchain=<toolchain-dir> main.cpp<br></div><div><br></div><div><br></div><div>At the moment I have the following issues:</div><div><br></div><div>1) I am unable to use the stdlib++ from the cross compiled GCC, am I missing a flag?</div>
<div><br></div><div>2) I am unable to link the final binary for the C example, clang crashes with the following output: <a href="http://justpaste.it/dnpb">http://justpaste.it/dnpb</a></div><div><br></div><div>In theory this should work right? Clang compiles the code to LLVM IR and then uses the native linker to generate the object files, as far as I can tell from the documentation. Or, should I compile Clang from source on Linux, just like I did with GCC in order to have a working cross-compiler? </div>
<div><br></div><div>Leander</div><div><br></div></div>