[LLVMdev] Can clang generate the same bitcode with the toolchains that have same version of libraries but different targets

Kenia Kuo kenkillerkuo at gmail.com
Tue Sep 25 06:22:16 PDT 2012


Hi,

I'm using clang to build my project as follows:

$ 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

$ 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

$ llvm-link foo.o main.o -o *main.bc*

$ llc main.bc -o main.ARM.s

$ arm-none-linux-gnueabi-g++ main.ARM.s -o main.ARM


1. Can clang generate the same bitcode (*main.bc *in the above
example) with the toolchains that have same version of libraries but
different targets?

2. Is there any possibility that the generated bitcode with the ARM
toolchain (*main.bc *in the above example) can be compiled to another
platform, like PowerPC or mips?

Currently, I tried the toolchains of ARM and PowerPC that have the
different versions of libraries, obviously the generated bitcode are
different.
So I wonder whether the version of library is the only reason why the
generated bitcode are different.


Thanks,
Kenia Kuo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120925/f9587a4e/attachment.html>


More information about the llvm-dev mailing list