[cfe-dev] JIT to MSVC?

Eli Friedman eli.friedman at gmail.com
Tue Aug 23 02:09:23 PDT 2011


On Tue, Aug 23, 2011 at 12:39 AM, Ruben Van Boxem
<vanboxem.ruben at gmail.com> wrote:
> Op 23 aug. 2011 02:22 schreef "Eli Friedman" <eli.friedman at gmail.com> het
> volgende:
>
>>
>> On Mon, Aug 22, 2011 at 4:57 PM, Graham Wakefield
>> <wakefield at mat.ucsb.edu> wrote:
>> > Hi list,
>> >
>> > I'm having an issue JIT compiling some C++ in an application I'm working
>> > on. JIT is failing with an llvm linker error on symbol _Znwj (the C++ new
>> > operator) on Windows, but works fine on OSX. As far as we can tell, this may
>> > be because the JIT is mangling new for the g++ standard library, but the
>> > host application is built using Visual Studio 2008 (aka VC9) which has a
>> > different mangled name for new.
>> >
>> > I was wondering if there are any configuration options we can use for
>> > Clang/LLVM to target MSVC runtime (for JITted code),
>>
>> There is an option to use MSVC-compatible mangling, but it's
>> experimental, and you're likely to run into other C++ ABI issues.  I
>> wouldn't suggest doing this.
>>
>> > or if anyone has any suggestions for strategies for embedding libg++
>> > (the application will need to work on non-developer systems, so we can't
>> > rely on the presence of libraries on the system.)
>>
>> You should be able to link against libstdc++.dll, distribute it with
>> your app, and have everything just work (although note that libstdc++
>> is LGPL).
>
> I was under the impression that libstdc++ fell under GCC's runtime library
> exception, which pretty much means you can use it in any way you see fit
> (including statically linked)

Okay; I don't know the details off the top of my head.

-Eli




More information about the cfe-dev mailing list