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

Philipp Klaus Krause pkk at spth.de
Fri Nov 24 11:12:17 PST 2006


Anton Korobeynikov schrieb:
> Hello Philipp,
> 
>> Does that mean that I will have to configure llvm as a cross-compiler
>> even when using the C backend?
> Not llvm, but llvm-gcc only. I've successfully used llvm-gcc for
> crosscompiling with host=linux and target=mingw32 platform. 
> 
> So, you have just to supply host, build and target triples to llvm-gcc
> configure and be also sure, that configure will find target headers,
> libraries and binutils (e.g. for mingw32 I'm copying mingw32 runtime,
> cross-binutils & libraries to build directory).

Why does it need target libraries and binutils? Can't I just Compile my
C++ code to C code (maybe using a template-only libstdc++, so I won't
have to link it) and then compile the resulting C code with sdcc and
link it to C libraries compiled directly with sdcc. I don't want to pass
my C libraries through LLVM since LLVM makes the code more inefficient
and they're partially written in assembler.

Philipp



More information about the llvm-dev mailing list