diff options
| author | Hans Wennborg <hans@hanshq.net> | 2013-10-17 17:49:57 +0000 |
|---|---|---|
| committer | Hans Wennborg <hans@hanshq.net> | 2013-10-17 17:49:57 +0000 |
| commit | fd541f001b25c72301e47a9ea72bd3676cb3a28d (patch) | |
| tree | ad00fe08619ec8bfbb126b410d0c4a2f6b28888a /llvm/cmake/modules | |
| parent | 16754ddc006c3d2ca10dacd04e3a7b6ed75588e4 (diff) | |
| download | bcm5719-llvm-fd541f001b25c72301e47a9ea72bd3676cb3a28d.tar.gz bcm5719-llvm-fd541f001b25c72301e47a9ea72bd3676cb3a28d.zip | |
CMake: set stack size to 2MB for MSVC builds
Compiling under Visual C++ 2012 with the default stack size of 1MB, the stack
overflows at a depth of 216 template instantiations, well before the 256
default limit. This patch modifies the default MSVC stack size to 2MB.
Patch by Yaron Keren!
llvm-svn: 192904
Diffstat (limited to 'llvm/cmake/modules')
| -rw-r--r-- | llvm/cmake/modules/HandleLLVMOptions.cmake | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/cmake/modules/HandleLLVMOptions.cmake b/llvm/cmake/modules/HandleLLVMOptions.cmake index 2cec270e96d..40634294061 100644 --- a/llvm/cmake/modules/HandleLLVMOptions.cmake +++ b/llvm/cmake/modules/HandleLLVMOptions.cmake @@ -153,6 +153,10 @@ endif() if( MSVC ) include(ChooseMSVCCRT) + # Visual C++ default stack size is 1MB. This is not enough for clang to + # instantiate templates up to the default maximum depth allowed, 256. + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -STACK:2097152") + if( MSVC10 ) # MSVC 10 will complain about headers in the STL not being exported, but # will not complain in MSVC 11. |

