[LLVMdev] Byte code portability (was Re: libstdc++ as bytecode, and compiling C++ to C)

Reid Spencer rspencer at reidspencer.com
Fri Nov 24 11:42:58 PST 2006


On Fri, 2006-11-24 at 20:13 +0100, Philipp Klaus Krause wrote:
> Reid Spencer schrieb:
> 
> > hat you do need to do
> > is configure your front end to be a cross compiler. Then it will
> > generate the correct LLVM input for that platform (and consequently LLVM
> > will generate code for that platform) regardless of the platform on
> > which either LLVM or your front end are running.
> > 
> 
> Is that needed for thing like sizeof() and size of native datatypes only
> or for other things, too?

Yes, platform specific #ifdef too.  When you tell the llvm-gcc front end
which target to generate code for then its output (input to llvm) will
be correct for that target and llvm will generate the corresponding code
for that target.  If you don't set the target (i.e. configure a
cross-compiler) then llvm-gcc will be assuming the target is your
llvm-gcc host and the resulting C code won't work on the target (if it
differs from the llvm-gcc host).

Reid.

> 
> Philipp
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev




More information about the llvm-dev mailing list