[LLVMdev] C++ to C

John Criswell criswell at cs.uiuc.edu
Mon Nov 20 08:36:21 PST 2006


Mohd-Hanafiah Abdullah wrote:
> On Fri, 2006-11-17 at 11:43 -0800, Chris Lattner wrote:
>   
>> On Fri, 17 Nov 2006, John Criswell wrote:
>>     
>>> I don't think you will need to deal with any names.  The C++ standard
>>> library has already been compiled to LLVM bytecode (it is part of the
>>> llvm-gcc/llvm-g++ distribution).  If you use "llvm-g++ -lstdc++" it
>>> should link in whatever libstdc++ functions are needed by your program;
>>> they will get translated to C code along with the rest of your program
>>> when you use llc.
>>>       
>> Note that that only works with llvm-gcc3.  With llvm-gcc4 you need to 
>> compile libstdc++ to bytecode explicitly.
>>     
>
> In llvm-gcc3 where could I find the bytecode version of libstdc++ ?
>   
You can download llvm-gcc3 from here (look for the LLVM-GCC 3.4 frontend
for your platform):
http://llvm.org/releases/download.html#1.9

The pre-compiled libstdc++ should be in <platform>/llvm-gcc/lib/libstdc++.a.

Two caveats:

1) I don't know if using this bytecode version of libstdc++ will work
with llvm-gcc4.  If you want to use it, you may need to use llvm-gcc3.

2. llvm-gcc3 is missing features from llvm-gcc4.  Furthermore, support
for llvm-gcc3 will probably be dropped in the LLVM 2.0 release.

-- John T.

> Thanks.
>
> Napi
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>   




More information about the llvm-dev mailing list