[LLVMdev] accessing a bitcode library exported from C++ using the JIT
Eli Friedman
eli.friedman at gmail.com
Mon Aug 31 13:49:01 PDT 2009
On Mon, Aug 31, 2009 at 12:17 PM, Samuel Crow<samuraileumas at yahoo.com> wrote:
> Hello,
>
> My partner and I am making a small app needs to access a C++ library from the LLVM 2.5 JIT. We've made sure that there are no classes and have put 'extern "c"' in front of the functions we need to access. In order to make this work, we seem to need to have a bitcode version of libstdc++ so we can avoid writing our own implementations of std::string and std::vector. I've been trying to get the version of libstdc++ that came with llvm-gcc-4.2-2.5 to configure and compile. I've set the environment variables to use llvm-gcc and llvm-g++ respectively and placed the --emit-llvm flag in the CCFLAGS and CXXFLAGS environment variables. Configure works but make fails with:
>
> from /Users/samuraicrow/Documents/llvm-gcc4.2-2.5.source/libstdc++-v3/include/precompiled/extc++.h:60:
> /Users/samuraicrow/Documents/llvm-gcc4.2-2.5.source/libstdc++-v3/include/ext/pb_ds/detail/priority_queue_base_dispatch.hpp:79: error: ISO C++ forbids declaration of ‘rc_binomial_heap_’ with no type
> /Users/samuraicrow/Documents/llvm-gcc4.2-2.5.source/libstdc++-v3/include/ext/pb_ds/detail/priority_queue_base_dispatch.hpp:79: error: expected ‘;’ before ‘<’ token
>
> I'm building on MacOSX 10.5.8 and my parnter will be building on MinGW under Windows XP.
>
> Is this a problem with the source or with my configuration? Has this been solved in version 2.6 prerelease or ToT?
It's probably a problem with your configuration, since llvm-gcc can
definitely build libstdc++ as part of the normal build.
This seems like the wrong approach, though... can't you just make your
C APIs take char*/T* instead?
-Eli
More information about the llvm-dev
mailing list