[LLVMdev] libstdc++ as bytecode, and compiling C++ to C
Emil Mikulic
emil at cs.rmit.edu.au
Tue Nov 21 02:24:42 PST 2006
On Tue, Nov 21, 2006 at 05:33:32PM +0800, Mohd-Hanafiah Abdullah wrote:
> Emil:
>
> I'm using LLVM 1.9 now. When I tried to do what you did I got the
> following though:
>
> $ llvm-g++ -emit-llvm -c x.cpp
> $ llvm-link -o=linked.o x.o std/*.o sup/*.o
> WARNING: Linking two modules of different target triples!
> WARNING: Linking two modules of different target triples!
> WARNING: Linking two modules of different target triples!
> ...
>
> $ lli linked.o
> lli((anonymous namespace)::PrintStackTrace()+0x19)[0x846d7f9]
> lli(llvm::MachineFunctionPass::runOnFunction(llvm::Function&)+0x29)[0x811af59]
> Segmentation fault
>
>
> What could be the problem?
I don't know. =/
All my bytecode files are built for:
target datalayout = "e-p:32:32"
target endian = little
target pointersize = 32
target triple = "i386-portbld-freebsd7.0"
Build a small bytecode file on your end, disassemble it, and compare.
(llvm-dis < yourfile.o | head -5)
LLVMers, given the same endianness and pointersize, can one mix and
match LLVM bytecode files produced on different platforms?
--Emil
More information about the llvm-dev
mailing list