Mohd-Hanafiah Abdullah
2006-Nov-21 09:33 UTC
[LLVMdev] libstdc++ as bytecode, and compiling C++ to C
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? Thanks. Napi
Emil Mikulic
2006-Nov-21 10:24 UTC
[LLVMdev] libstdc++ as bytecode, and compiling C++ to C
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
Chris Lattner
2006-Nov-21 16:58 UTC
[LLVMdev] libstdc++ as bytecode, and compiling C++ to C
On Tue, 21 Nov 2006, Emil Mikulic wrote:> LLVMers, given the same endianness and pointersize, can one mix and > match LLVM bytecode files produced on different platforms?No, not in general. For example, on the mac, printf it often #defined to printf$ldbl, which doesn't exist on linux. System headers generally foil the ability to move stuff around like that. -Chris -- http://nondot.org/sabre/ http://llvm.org/
Reasonably Related Threads
- [LLVMdev] libstdc++ as bytecode, and compiling C++ to C
- [LLVMdev] libstdc++ as bytecode, and compiling C++ to C
- [LLVMdev] Byte code portability (was Re: libstdc++ as bytecode, and compiling C++ to C)
- [LLVMdev] libstdc++ in LLVM bitcode
- Problem of installing Matrix