[llvm-commits] [PATCH] Change Compiler.h to make ARM target works under MSVC

Howard Su howard0su at gmail.com
Tue Jun 16 16:32:07 PDT 2009


This patch actaully fixes this error:
LLVMARMCodeGen.lib(ARMTargetMachine.cpp.obj) : error LNK2001: unresolved
external symbol "public: virtual unsigned int _
_thiscall llvm::ARMTargetAsmInfo<class
llvm::TargetAsmInfo>::getInlineAsmLength(char const *)const "
(?getInlineAsmLengt
h@?$ARMTargetAsmInfo at VTargetAsmInfo@llvm@@@llvm@@UBEIPBD at Z)
..\..\bin\llc.exe : fatal error LNK1120: 1 unresolved externals

Based on MSVC document, it should support EXTERN_TEMPLATE_INSTANTIATION. See
the reference link. This acutally fix the build ARM under MSVC-x86.
otherwise, there is a link error.
http://msdn.microsoft.com/en-us/library/7y5ca42y.aspx

I am not sure if this is  the best fix.


On Mon, Jun 15, 2009 at 2:04 PM, Chris Lattner <clattner at apple.com> wrote:

>
> On May 21, 2009, at 5:30 AM, Howard Su wrote:
>
> > C++ standard (MSVC included) do support template specializations
> > while it doesn't support extern template specializations. So the
> > following define is wrong to me.
> > #ifdef __GNUC__
> > #define EXTERN_TEMPLATE_INSTANTIATION(X) __extension__ extern
> > template X
> > #define TEMPLATE_INSTANTIATION(X) template X
> > #else
> > #define EXTERN_TEMPLATE_INSTANTIATION(X)
> > #define TEMPLATE_INSTANTIATION(X)   <======== wrong, C++ supports
> > this.
> > #endif
> > Please verify.
>
> Hi Howard,
>
> Does this patch actually fix a real problem?
>
> -Chris
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>



-- 
-Howard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20090617/94b8efdc/attachment.html>


More information about the llvm-commits mailing list