I'm trying to call a function in a dll compiled with Visual Studio from JITed code. Unfortunately, the mangled name generated by the codegen does not match the one that ends up being exported by the dll. LLVM generates a *nix style mangled name() where it needs the windows mangled named.<br>
<br>my external header:<br><br>class __declspec(dllimport) mod_test<br>{<br>public:<br> static void test();<br>};<br><br>my generated module after compiling:<br><br>; ModuleID = 'random'<br>target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-f80:128:128-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32"<br>
target triple = "i686-pc-win32"<br><br>define void @_Z5hellov() nounwind {<br>entry:<br> call void @_ZN8mod_test4testEv()<br> ret void<br>}<br><br>declare void @_ZN8mod_test4testEv()<br><br>...while the exported name is ?test@mod_test@SAXXZ. I use clang as a library, without going through the Driver class. Since calls to the system libraries work fine, I'm quite sure that I'm not trying to do something that is not supported.<br>
<br>I would be grateful if anyone could shed some light on this.<br><br>-- <br>Daan Nijs<br><a href="http://www.bogartindustries.com/blog" target="_blank">http://www.bogartindustries.com/blog</a><br><br>BE: +32 494864702<br>
DE +49 151 23308763 <br>Skype : poptunes<div style="padding:0px;margin-left:0px;margin-top:0px;overflow:hidden;word-wrap:break-word;color:black;font-size:10px;text-align:left;line-height:130%">
</div><div style="padding:0px;margin-left:0px;margin-top:0px;overflow:hidden;word-wrap:break-word;color:black;font-size:10px;text-align:left;line-height:130%"></div><br>