[llvm] r280303 - [CMake] Increase stack size to 16MiB for all mingw executables.

NAKAMURA Takumi via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 31 15:43:23 PDT 2016


Author: chapuni
Date: Wed Aug 31 17:43:23 2016
New Revision: 280303

URL: http://llvm.org/viewvc/llvm-project?rev=280303&view=rev
Log:
[CMake] Increase stack size to 16MiB for all mingw executables.

Modified:
    llvm/trunk/cmake/modules/HandleLLVMOptions.cmake
    llvm/trunk/cmake/modules/TableGen.cmake

Modified: llvm/trunk/cmake/modules/HandleLLVMOptions.cmake
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/HandleLLVMOptions.cmake?rev=280303&r1=280302&r2=280303&view=diff
==============================================================================
--- llvm/trunk/cmake/modules/HandleLLVMOptions.cmake (original)
+++ llvm/trunk/cmake/modules/HandleLLVMOptions.cmake Wed Aug 31 17:43:23 2016
@@ -224,6 +224,17 @@ if( MSVC_IDE )
   endif()
 endif()
 
+# set stack reserved size to ~10MB
+if(MSVC)
+  # CMake previously automatically set this value for MSVC builds, but the
+  # behavior was changed in CMake 2.8.11 (Issue 12437) to use the MSVC default
+  # value (1 MB) which is not enough for us in tasks such as parsing recursive
+  # C++ templates in Clang.
+  set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /STACK:10000000")
+elseif(MINGW) # FIXME: Also cygwin?
+  set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--stack,16777216")
+endif()
+
 if( MSVC )
   if( CMAKE_CXX_COMPILER_VERSION VERSION_LESS 19.0 )
     # For MSVC 2013, disable iterator null pointer checking in debug mode,
@@ -233,13 +244,6 @@ if( MSVC )
   
   include(ChooseMSVCCRT)
 
-  # set stack reserved size to ~10MB
-  # CMake previously automatically set this value for MSVC builds, but the
-  # behavior was changed in CMake 2.8.11 (Issue 12437) to use the MSVC default
-  # value (1 MB) which is not enough for us in tasks such as parsing recursive
-  # C++ templates in Clang.
-  set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /STACK:10000000")
-
   if( MSVC11 )
     add_llvm_definitions(-D_VARIADIC_MAX=10)
   endif()

Modified: llvm/trunk/cmake/modules/TableGen.cmake
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/TableGen.cmake?rev=280303&r1=280302&r2=280303&view=diff
==============================================================================
--- llvm/trunk/cmake/modules/TableGen.cmake (original)
+++ llvm/trunk/cmake/modules/TableGen.cmake Wed Aug 31 17:43:23 2016
@@ -133,11 +133,6 @@ macro(add_tablegen target project)
     endif()
   endif()
 
-  if( MINGW )
-    if(CMAKE_SIZEOF_VOID_P MATCHES "8")
-      set_target_properties(${target} PROPERTIES LINK_FLAGS -Wl,--stack,16777216)
-    endif(CMAKE_SIZEOF_VOID_P MATCHES "8")
-  endif( MINGW )
   if (${project} STREQUAL LLVM AND NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
     install(TARGETS ${target}
             EXPORT LLVMExports




More information about the llvm-commits mailing list