<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:14px;background-color:rgb(255,255,255)">Hi,</span><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:14px;background-color:rgb(255,255,255)">
<br></div><blockquote style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:14px;background-color:rgb(255,255,255);margin:0px 0px 0px 40px;border:none;padding:0px"><div>I'm using clang to build my project as follows:</div>
<div><br></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">$ clang++  -ccc-host-triple arm-none-linux-gnueabi --sysroot=/usr/local/arm-none-linux-gnueabi/arm-none-linux-gnueabi/libc/ -o foo.o -emit-llvm -c foo.cpp</blockquote>
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">$ clang++  -ccc-host-triple arm-none-linux-gnueabi --sysroot=/usr/local/arm-none-linux-gnueabi/arm-none-linux-gnueabi/libc/ -o main.o -emit-llvm -c main.cpp</blockquote>
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">$ llvm-link foo.o main.o -o <b>main.bc</b></blockquote><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">$ llc main.bc -o main.ARM.s</blockquote>
<blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">$ arm-none-linux-gnueabi-g++ main.ARM.s -o main.ARM</blockquote><div><br></div><div>1. Can clang generate the same bitcode (<b>main.bc </b>in the above example) with the toolchains that have same version of libraries but different targets?</div>
<div><br></div><div>2. Is there any possibility that the generated bitcode with the ARM toolchain (<b>main.bc </b>in the above example) can be compiled to another platform, like PowerPC or mips?</div><div><br></div><div>Currently, I tried the toolchains of ARM and PowerPC that have the different versions of libraries, obviously the generated bitcode are different.</div>
<div>So I wonder whether the version of library is the only reason why the generated bitcode are different.</div></blockquote><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:14px;background-color:rgb(255,255,255)">
<br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:14px;background-color:rgb(255,255,255)">Thanks,</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:14px;background-color:rgb(255,255,255)">
Kenia Kuo</div>