[LLVMdev] LLVM 3.6: problems building on Windows using MSVC 2013

Alan Garny agarny at hellix.com
Mon Mar 9 17:37:20 PDT 2015


Yes, I did try that and noticed a few differences that were expected (i.e. some definitions and include directories that are specific to my project), as well as a few flags that were unset in the ‘normal’ build while not in mine (namely /GR /EHsc in my case while /GR- /EHs-c- in the ‘normal’ build). Anyway, just to be certain, I did configure my CMake file in such a way that it would generate exactly the same command lines (besides my project specific definitions and include directories), but to no avail.

 

I think I might try to create a CMake project from scratch with the view of building LLVM/Clang in a way that is similar to what I need for my project. Hopefully, that will result in a positive build, which will then help me to identify what is ‘wrong’ with my project’s LLVM/Clang build (which I am sure there must be since a ‘normal’ build works fine).

 

Alan

 

From: Zachary Turner [mailto:zturner at google.com] 
Sent: 10 March 2015 01:02
To: Alan Garny; llvmdev at cs.uiuc.edu
Subject: Re: [LLVMdev] LLVM 3.6: problems building on Windows using MSVC 2013

 

Can you go to the build directory of the build that works (i.e. the normal LLVM/Clang build), open your build.ninja file, find the line for clang/lib/Driver/Compilation.cpp, and it should show you the exact command line.  Compare this command line to the one you're running above that fails.  It might give you a hint about what's going wrong.

 

On Mon, Mar 9, 2015 at 4:23 PM Alan Garny <agarny at hellix.com> wrote:

Sorry, I am using CMake+JOM or CMake+Ninja, if Ninja is available on the developer’s machine. Either way, it fails in both cases with a message similar to the one I included below (which was obtained using CMake+Ninja).

 

Just in case, my (current) CMakeLists.txt file can be found at here <https://github.com/opencor/opencor/blob/c4a7eb072713f2649fa51ae506340fd3634b3b70/src/plugins/thirdParty/LLVM/CMakeLists.txt>  (and some other CMake related stuff here <https://github.com/opencor/opencor/blob/c4a7eb072713f2649fa51ae506340fd3634b3b70/cmake/common.cmake> ).

 

Alan

 

From: Zachary Turner [mailto:zturner at google.com] 
Sent: 09 March 2015 23:16
To: Alan Garny; llvmdev at cs.uiuc.edu
Subject: Re: [LLVMdev] LLVM 3.6: problems building on Windows using MSVC 2013

 

When you say you build it "as part of your project" what does that mean exactly?  Are you using CMake + ninja?  MSBuild?  Something else?

 

On Mon, Mar 9, 2015 at 1:31 PM Alan Garny <agarny at hellix.com> wrote:

Hi,

 

I have been using LLVM+Clang in my project for some time and it has been working just fine up to now (I am currently using version 3.5.1).

 

However, with version 3.6 having just been released, I thought I would give it a try and update my code to use MCJIT rather than the now discontinued JIT. Well, this proved to be a relatively smooth process, and everything is now working fine on Linux and OS X. However, on Windows, I am having problems building LLVM+Clang. Actually, Clang itself, it would seem.

 

I guess it’s worth mentioning that I don’t build LLVM+Clang the ‘normal’ way. Instead, LLVM+Clang is part of my project repository and I build it as part of my project. Now, as mentioned above, I am having problems building version 3.6 on Windows, this using MSVC 2013. I am basically getting things like:

 

---------------------------------------

FAILED: C:\PROGRA~2\MICROS~2.0\VC\bin\X86_AM~1\cl.exe   /nologo /TP /DWIN32 /D_WINDOWS  /GR /EHsc /DNDEBUG /MD /O2 /Ob2 /wd4267 /wd4146 /wd4180 /wd4244 /wd4258 /wd4267 /wd4291 /wd4345 /wd4351 /wd4355 /wd4456 /wd4457 /wd4458 /wd4459 /wd4503 /wd4624 /wd4722 /wd4800 /w14062 /we4238 -Isrc\plugins\thirdParty\LLVM -I..\src\plugins\thirdParty\LLVM -I..\src\misc -I..\src\plugins -I..\src\plugins\miscellaneous\Core\src -I..\src\3rdparty\QtSingleApplication\src -I..\src\plugins\thirdParty\LLVM\include -I..\src\plugins\thirdParty\LLVM\lib\Target\X86 -I..\src\plugins\thirdParty\LLVM\src -I..\src\plugins\thirdParty\LLVM\tools\clang\include -IC:\Qt\5.4\msvc2013_64\include -IC:\Qt\5.4\msvc2013_64\include\QtCore -IC:\Qt\5.4\msvc2013_64\mkspecs\win32-msvc2013 /showIncludes -DLLVMPlugin_EXPORTS -DLLVM_PLUGIN -DQT_CORE_LIB -DQT_DEPRECATED_WARNINGS -DQT_NO_DEBUG -DUNICODE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D_UNICODE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS /Fosrc\plugins\thirdParty\LLVM\CMakeFiles\LLVMPlugin.dir\tools\clang\lib\Driver\Compilation.cpp.obj /Fdsrc\plugins\thirdParty\LLVM\CMakeFiles\LLVMPlugin.dir\ /FS -c ..\src\plugins\thirdParty\LLVM\tools\clang\lib\Driver\Compilation.cpp

C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\xutility(2045) : error C2280: 'std::unique_ptr<clang::driver::Job,std::default_delete<_Ty>> &std::unique_ptr<_Ty,std::default_delete<_Ty>>::operator =(const std::unique_ptr<_Ty,std::default_delete<_Ty>> &)' : attempting to reference a deleted function

        with

        [

            _Ty=clang::driver::Job

        ]

        C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\memory(1487) : see declaration of 'std::unique_ptr<clang::driver::Job,std::default_delete<_Ty>>::operator ='

        with

        [

            _Ty=clang::driver::Job

        ]

        C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\xutility(2066) : see reference to function template instantiation '_OutIt std::_Copy_impl<_InIt,_OutIt>(_InIt,_InIt,_OutIt,std::_Nonscalar_ptr_iterator_tag)' being compiled

        with

        [

            _OutIt=std::unique_ptr<clang::driver::Job,std::default_delete<clang::driver::Job>> *

,            _InIt=const std::unique_ptr<clang::driver::Job,std::default_delete<clang::driver::Job>> *

        ]

        C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\INCLUDE\xutility(2077) : see reference to function template instantiation '_OutIt std::_Copy_impl<_Iter,std::unique_ptr<clang::driver::Job,std::default_delete<_Ty>>>(_InIt,_InIt,_OutIt)' being compiled

        with

        [

            _OutIt=std::unique_ptr<clang::driver::Job,std::default_delete<clang::driver::Job>> *

,            _Iter=const std::unique_ptr<clang::driver::Job,std::default_delete<clang::driver::Job>> *

,            _Ty=clang::driver::Job

,            _InIt=const std::unique_ptr<clang::driver::Job,std::default_delete<clang::driver::Job>> *

        ]

        ..\src\plugins\thirdParty\LLVM\include\llvm/ADT/SmallVector.h(773) : see reference to function template instantiation '_OutIt std::copy<const std::unique_ptr<clang::driver::Job,std::default_delete<_Ty>>,std::unique_ptr<_Ty,std::default_delete<_Ty>>*>(_InIt,_InIt,_OutIt)' being compiled

        with

        [

            _OutIt=std::unique_ptr<clang::driver::Job,std::default_delete<clang::driver::Job>> *

,            _Ty=clang::driver::Job

,            _InIt=const std::unique_ptr<clang::driver::Job,std::default_delete<clang::driver::Job>> *

        ]

        ..\src\plugins\thirdParty\LLVM\include\llvm/ADT/SmallVector.h(761) : while compiling class template member function 'llvm::SmallVectorImpl<T> &llvm::SmallVectorImpl<T>::operator =(const llvm::SmallVectorImpl<T> &)'

        with

        [

            T=std::unique_ptr<clang::driver::Job,std::default_delete<clang::driver::Job>>

        ]

        ..\src\plugins\thirdParty\LLVM\include\llvm/ADT/SmallVector.h(915) : see reference to function template instantiation 'llvm::SmallVectorImpl<T> &llvm::SmallVectorImpl<T>::operator =(const llvm::SmallVectorImpl<T> &)' being compiled

        with

        [

            T=std::unique_ptr<clang::driver::Job,std::default_delete<clang::driver::Job>>

        ]

        ..\src\plugins\thirdParty\LLVM\include\llvm/ADT/SmallVector.h(890) : see reference to class template instantiation 'llvm::SmallVectorImpl<T>' being compiled

        with

        [

            T=std::unique_ptr<clang::driver::Job,std::default_delete<clang::driver::Job>>

        ]

        ..\src\plugins\thirdParty\LLVM\tools\clang\include\clang/Driver/Job.h(169) : see reference to class template instantiation 'llvm::SmallVector<std::unique_ptr<clang::driver::Job,std::default_delete<_Ty>>,4>' being compiled

        with

        [

            _Ty=clang::driver::Job

        ]

---------------------------------------

 

Now, the error message seems to make sense to me (after having had a quick look at the code), but I am clearly missing something since not only does it all work fine on Linux and OS X, but I was (obviously) also able to build LLVM+Clang the ‘normal’ on Windows. So, what am I missing exactly?...

 

Cheers, Alan.

_______________________________________________
LLVM Developers mailing list
LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

_______________________________________________
LLVM Developers mailing list
LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150310/69932c37/attachment.html>


More information about the llvm-dev mailing list