[LLVMdev] Bitcode not portable from linux to solaris?

Óscar Fuentes ofv at wanadoo.es
Wed Feb 2 21:58:32 PST 2011


Lally Singh <lally.singh at gmail.com> writes:
>> I think llvm isn't ported to Solaris i386/x86_64 yet. Particularly, clang
>> there prints the same data layout string as on linux assuming ABI is the
>> same when it isn't. So using your approach certain calls to the externally
>> compiled libraries will cause failures. Some simpler examples may work fine.
>>
> Well, then I'm royally screwed.
>
> What would I have to add to make it work, if only for a very limited
> subset of cases?

Fixing the data layout is simple:

 1. Read the LLVM Laguage Reference to learn how to format the data
    layout string.

 2. Look up what's the actual data layout for your platform.

 3. Implement the string in lib/Target/X86/X86TargetMachine.cpp

The last step may require implementing some handling for the triplet of
your platform, but if you are on a hurry and don't plan to contribute
your changes to LLVM nor to generate code for other platforms an #ifdef
will do.




More information about the llvm-dev mailing list