Hi, I have some questions about LLVM Since it is available in several and different platforms like Intel x86, PowerPc and Sparc, how do you handle the differences between these platforms in your bytecode? For example, Can a bytecode generated under MacOS run in the LLVM version under Linux x86? How do you handle things like little endian / big endian? How do you handle the difference in pointer sizes: Sparcs' 64 bit pointers and Intel x86 32 bits pointers? Thanks for your help __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20050224/48bfeca7/attachment.html>
On Thu, 24 Feb 2005, xavier wrote:> Hi, > > I have some questions about LLVM > > Since it is available in several and different platforms like Intel x86, > PowerPc and Sparc, how do you handle the differences between these > platforms in your bytecode? For example, Can a bytecode generated under > MacOS run in the LLVM version under Linux x86? How do you handle things > like little endian / big endian? How do you handle the difference in > pointer sizes: Sparcs' 64 bit pointers and Intel x86 32 bits pointers?There are two ways to do this. A front-end (e.g. our Java front-end in development) that generates portable LLVM code (code that does not depend on the target) can just do so and things will magically work. LLVM bytecode like this is portable. For front-ends that compile non-type-safe languages (e.g. our C/C++ front-ends), we explicitly encode the target, and some additional information (including pointersize and endianness) in the bytecode file. These files MAY be portable, or they may not be, but there is no guarantee. In the case of C/C++, basically anything that includes a standard header will not be portable, at least not across systems with different implementations of libc. -Chris -- http://nondot.org/sabre/ http://llvm.cs.uiuc.edu/
On Thu, 24 Feb 2005 23:26:53 -0600, Chris Lattner wrote:> In the case of C/C++, basically anything that includes a > standard header will not be portable, at least not across systems with > different implementations of libc.Do you mean portable across operating systems here, or portable across CPU architectures? Presumably the former ...
Reasonably Related Threads
- [LLVMdev] Re: Re: LLVM bytecode portability
- [LLVMdev] Re: LLVM bytecode portability
- [LLVMdev] Byte code portability (was Re: libstdc++ as bytecode, and compiling C++ to C)
- [LLVMdev] LLVM bytecode portability
- [LLVMdev] Byte code portability (was Re: libstdc++ as bytecode, and compiling C++ to C)