<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Hi,<br>
<br>
I figured it out:<br>
I need to manually compile libstdc++ to LLVM bytecode, generate c code
from the LLVM bytecode, then build build shared lib with gcc compiler
and then I can use the same to build/link my applications.<br>
<br>
Thanks<br>
Chandrashekhar Kumar wrote:
<blockquote cite="mid45091DEE.6090902@catalytic.com" type="cite">
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
Hi,<br>
I am newbie to llvm.<br>
  <br>
I am unable to generate bytecode for the following c++ code(to be used
for c-code generation)<br>
  <br>
#include <vector><br>
using namespace std;<br>
  <br>
int main()<br>
{<br>
    vector<int> v;<br>
}<br>
  <br>
$ llvm-g++ test.cpp<br>
  <br>
gccld: CallGraph.cpp:277: void
llvm::CallGraphNode::removeCallEdgeTo(llvm::CallGraphNode*): Assertion
`i && "Cannot find callee to remove!"' failed.<br>
gccld((anonymous namespace)::PrintStackTrace()+0x18)[0x84833b4]<br>
gccld((anonymous namespace)::SignalHandler(int)+0x100)[0x848363c]<br>
/lib/tls/libc.so.6[0xbe7a48]<br>
/lib/tls/libc.so.6(abort+0x129)[0xbe9319]<br>
/lib/tls/libc.so.6(__assert_fail+0x101)[0xbe0f41]<br>
gccld(llvm::CallGraphNode::removeCallEdgeTo(llvm::CallGraphNode*)+0x3d)[0x837697f]<br>
gccld((anonymous
namespace)::PruneEH::DeleteBasicBlock(llvm::BasicBlock*)+0x16f)[0x8348265]<br>
gccld((anonymous
namespace)::PruneEH::SimplifyFunction(llvm::Function*)+0x2d4)[0x8347eee]<br>
gccld((anonymous
namespace)::PruneEH::runOnSCC(std::vector<llvm::CallGraphNode*,
std::allocator<llvm::CallGraphNode*> >
const&)+0x76)[0x8347804]<br>
gccld(llvm::CallGraphSCCPass::runOnModule(llvm::Module&)+0x99)[0x8378e29]<br>
gccld(llvm::ModulePassManager::runPass(llvm::ModulePass*,
llvm::Module*)+0x1b)[0x842a111]<br>
gccld(llvm::PassManagerT<llvm::MTraits>::runPasses(llvm::Module*,
std::map<llvm::Pass*, std::vector<llvm::Pass*,
std::allocator<llvm::Pass*> >, std::less<llvm::Pass*>,
std::allocator<std::pair<llvm::Pass* const,
std::vector<llvm::Pass*, std::allocator<llvm::Pass*> > >
> >&)+0x11c)[0x8429098]<br>
gccld(llvm::PassManagerT<llvm::MTraits>::runOnUnit(llvm::Module*)+0x16a)[0x8428f60]<br>
gccld(llvm::ModulePassManager::runOnModule(llvm::Module&)+0x22)[0x841477e]<br>
gccld(llvm::PassManager::run(llvm::Module&)+0x1f)[0x8414aa9]<br>
gccld(llvm::GenerateBytecode(llvm::Module*, int, bool,
std::basic_ostream<char, std::char_traits<char>
>*)+0x3af)[0x82a252f]<br>
gccld(main+0xb23)[0x82a6dd7]<br>
/lib/tls/libc.so.6(__libc_start_main+0xe3)[0xbd4e33]<br>
gccld(__gxx_personality_v0+0x121)[0x82a1965]<br>
llvm-g++: Internal error: Aborted (program gccld)<br>
Please submit a full bug report.<br>
See <a class="moz-txt-link-rfc1738" href="http://llvm.cs.uiuc.edu"><URL:http://llvm.cs.uiuc.edu></a>
for instructions.<br>
  <br>
  <br>
</blockquote>
<div class="moz-signature">
<p><br>
</p>
</div>
</body>
</html>