Hi all. I fully understand that the problem is a bit OT for llvmdev, but I'm stuck for two days now and I really need some direct push. To the problem. I have a C++ shared library, that's working with llvm C++ api. Consider a function: static Object llvm_Target_createMCAsmInfo(Object self, Object tripleName) { llvm::Target target = from_ruby<llvm::Target>(self); char const *triple = from_ruby<char const *>(tripleName); llvm::MCAsmInfo *MAI = target.createMCAsmInfo(triple); return to_ruby<llvm::MCAsmInfo>(*MAI); } The problem here, is it's ok to use llvm::MCAsmInfo objects, but as soon as I use it in the cast (e.g. to_ruby), I immediately get an undefined symbol __ZTIN4llvm9MCAsmInfoE. Similar symbols for other llvm classes are there in my library's .o file, this one does not. Any hints? -- Vladimir Pouzanov http://www.farcaller.net/ -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4454 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20121210/cabaab67/attachment.bin>
Llvm typically doesn't build with RTTI enabled. Perhaps that's what you're running into? Jim On Dec 10, 2012, at 1:27 PM, Vladimir Pouzanov <farcaller at gmail.com> wrote:> Hi all. > > I fully understand that the problem is a bit OT for llvmdev, but I'm stuck for two days now and I really need some direct push. > > To the problem. I have a C++ shared library, that's working with llvm C++ api. Consider a function: > > static Object llvm_Target_createMCAsmInfo(Object self, Object tripleName) > { > llvm::Target target = from_ruby<llvm::Target>(self); > char const *triple = from_ruby<char const *>(tripleName); > > llvm::MCAsmInfo *MAI = target.createMCAsmInfo(triple); > return to_ruby<llvm::MCAsmInfo>(*MAI); > } > > The problem here, is it's ok to use llvm::MCAsmInfo objects, but as soon as I use it in the cast (e.g. to_ruby), I immediately get an undefined symbol __ZTIN4llvm9MCAsmInfoE. Similar symbols for other llvm classes are there in my library's .o file, this one does not. > > Any hints? > > -- > Vladimir Pouzanov > http://www.farcaller.net/ > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
I've actually tried to compile both LLVM and my lib with -frtti with same results. On Dec 10, 2012, at 21:57, Jim Grosbach <grosbach at apple.com> wrote:> Llvm typically doesn't build with RTTI enabled. Perhaps that's what you're running into? > > Jim-- Vladimir Pouzanov http://www.farcaller.net/ -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4454 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20121210/9ee47c04/attachment.bin>