<div>Hi David,</div><blockquote style="margin:0 0 0 40px;border:none;padding:0px">Thank you for your reply.<div><br></div><div>In fact, my question originally came from the google native client. </div><div>I thought that the bitcode can be shared among the different targets as it inherently is.</div>
<div>Therefore, I used the clang to generate the bitcode to prove that my thought is right,</div><div>and I supposed that the different bitcode caused from the different versions of libraries before.</div><div><br></div><div>
Thanks for the above answering, I know the limitations of sharing the bitcode now.</div></blockquote><div><div><br></div><div>Best regards,</div><div>Kenia</div><div><br><div class="gmail_quote">2012/9/26 David Tweed <span dir="ltr"><<a href="mailto:david.tweed@arm.com" target="_blank">david.tweed@arm.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-GB" link="blue" vlink="purple"><div><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Hi Kenia,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">What you might be trying to end up with (rather than the question you're directly asking </span><span style="font-size:11.0pt;font-family:Wingdings;color:#1f497d">J</span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"> ) is a platform independent compiled representation.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">(Of course you might be aiming to do something else, like a cross-platform compile farm, in which case I have no input...)<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">If this is the goal, the google native client team are working on PNaCl, which is (in addition to "safety properties") designed to be<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">platform independent<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><a href="http://www.chromium.org/nativeclient/pnacl/building-and-testing-portable-native-client" target="_blank">http://www.chromium.org/nativeclient/pnacl/building-and-testing-portable-native-client</a><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">I've not kept up with this project, but I believe that this is only achieved by considering all the possible ABIs of the targets and<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">ensuring enough information is provided so that the final to-native compilation stage can resolve everything, so it's more like "bitcode able to accommodate<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">all the listed targets" rather than "bitcode that's target independent".<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">HTH,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Dave<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<div style="border:none;border-top:solid #b5c4df 1.0pt;padding:3.0pt 0cm 0cm 0cm"><p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> <a href="mailto:llvmdev-bounces@cs.uiuc.edu" target="_blank">llvmdev-bounces@cs.uiuc.edu</a> [mailto:<a href="mailto:llvmdev-bounces@cs.uiuc.edu" target="_blank">llvmdev-bounces@cs.uiuc.edu</a>] <b>On Behalf Of </b>Kenia Kuo<br>
<b>Sent:</b> 25 September 2012 15:49<br><b>To:</b> Óscar Fuentes<br><b>Cc:</b> <a href="mailto:llvmdev@cs.uiuc.edu" target="_blank">llvmdev@cs.uiuc.edu</a><br><b>Subject:</b> Re: [LLVMdev] Can clang generate the same bitcode with the toolchains that have same version of libraries but different targets<u></u><u></u></span></p>
</div><div><div class="h5"><p class="MsoNormal"><u></u> <u></u></p><div><p class="MsoNormal">Hi Óscar,<u></u><u></u></p></div><blockquote style="margin-left:30.0pt;margin-right:0cm"><p class="MsoNormal">Thank you for your reply.<u></u><u></u></p>
<div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">It looks like the limitations are the platform's API and ABI (included the size of variable).<u></u><u></u></p></div><div><p class="MsoNormal">
So, if there are two platforms that have the same API, ABI but different ISAs, the bitcode can be shared. Can I say that?<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div></blockquote><div><p class="MsoNormal" style="background:white">
<span style="font-size:10.5pt;font-family:"Arial","sans-serif";color:#222222">Thanks,<u></u><u></u></span></p></div><div><p class="MsoNormal" style="background:white"><span style="font-size:10.5pt;font-family:"Arial","sans-serif";color:#222222">Kenia Kuo<u></u><u></u></span></p>
</div><div><p class="MsoNormal"><u></u> <u></u></p><div><p class="MsoNormal">2012/9/25 Óscar Fuentes <<a href="mailto:ofv@wanadoo.es" target="_blank">ofv@wanadoo.es</a>><u></u><u></u></p><p class="MsoNormal">Kenia Kuo <<a href="mailto:kenkillerkuo@gmail.com" target="_blank">kenkillerkuo@gmail.com</a>> writes:<br>
<br>[snip]<u></u><u></u></p><div><p class="MsoNormal" style="margin-bottom:12.0pt"><br>> Currently, I tried the toolchains of ARM and PowerPC that have the<br>> different versions of libraries, obviously the generated bitcode are<br>
> different.<br>> So I wonder whether the version of library is the only reason why the<br>> generated bitcode are different.<u></u><u></u></p></div><p class="MsoNormal"><a href="http://llvm.org/docs/FAQ.html#can-i-compile-c-or-c-code-to-platform-independent-llvm-bitcode" target="_blank">http://llvm.org/docs/FAQ.html#can-i-compile-c-or-c-code-to-platform-independent-llvm-bitcode</a><u></u><u></u></p>
</div><p class="MsoNormal"><u></u> <u></u></p></div></div></div></div></div></blockquote></div><br></div></div>