<div dir="ltr">On 7 February 2013 22:35, SON TRAN <span dir="ltr"><<a href="mailto:soq2000@yahoo.com" target="_blank">soq2000@yahoo.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><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">
<div><div style="font-size:10pt;font-family:'Courier New',courier,monaco,monospace,sans-serif"><div><span style="font-size:10pt">-With the front end clang, what can be the possible values for the -target parameter? Can I have a full list of them?</span></div>
</div></div></blockquote><div><br></div><div>Hi Son,</div><div><br></div><div>I'm not sure there is a dynamic list, but if you're feeling adventurous, check the ToolChain.cpp in Clang's source.</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">
<div><div style="font-size:10pt;font-family:'Courier New',courier,monaco,monospace,sans-serif"><div><span style="font-size:10pt">-How can I create a (static) library from the object files as with the command "ar" in linux ? I wonder whether I should use llvm-ar. But then I can not link the resulting file as a lib with clang.</span></div>
</div></div></blockquote><div><br></div><div><br></div><div style>You should use the GNU binutils for your target. Unfortunately, LLVM doesn't provide that part, but most of the time it integrates nicely with it if you're compiling natively. </div>
<div style><br></div><div style>On cross-compilation, you'll have to inform where the tools are with passing the argument "-gcc-toolchain myarch-gcc" with that being the path to your gcc (it should find the rest from it). You should also need to provide the include path of most headers, if your toolchain doesn't have the structure clang is expecting (happens with most modern toolchains, unfortunately).</div>
<div style><br></div><div style>As an example, I use the command line below to cross-compile to ARM:</div><div style><br></div><div style>$ clang -target armv7a-linux-gnueabihf -gcc-toolchain arm-linux-gnueabihf-gcc -I /usr/arm-linux-gnueabihf/include/c++/4.7.2/ -I /usr/arm-linux-gnueabihf/include/c++/4.7.2/arm-linux-gnueabihf/ -I /usr/arm-linux-gnueabihf/include/</div>
<div style><br></div><div style>Since I have the Ubuntu package gcc-4.7-arm-linux-gnueabihf and all its dependencies installed.</div><div style><br></div><div style>cheers,</div><div style>--renato</div></div></div></div>