summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNAKAMURA Takumi <geek4civic@gmail.com>2016-08-31 22:43:23 +0000
committerNAKAMURA Takumi <geek4civic@gmail.com>2016-08-31 22:43:23 +0000
commit96a6c49b6be60c2de831f0417cc9408ae4fcfa68 (patch)
treea3e0df3a9bda0be45c942dddd3508f89894c52a8
parent23d57103a47c8cd9be764ae85fa2b52217069836 (diff)
downloadbcm5719-llvm-96a6c49b6be60c2de831f0417cc9408ae4fcfa68.tar.gz
bcm5719-llvm-96a6c49b6be60c2de831f0417cc9408ae4fcfa68.zip
[CMake] Increase stack size to 16MiB for all mingw executables.
llvm-svn: 280303
-rw-r--r--llvm/cmake/modules/HandleLLVMOptions.cmake18
-rw-r--r--llvm/cmake/modules/TableGen.cmake5
2 files changed, 11 insertions, 12 deletions
diff --git a/llvm/cmake/modules/HandleLLVMOptions.cmake b/llvm/cmake/modules/HandleLLVMOptions.cmake
index 6a4f7e5f074..02685483808 100644
--- a/llvm/cmake/modules/HandleLLVMOptions.cmake
+++ b/llvm/cmake/modules/HandleLLVMOptions.cmake
@@ -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()
diff --git a/llvm/cmake/modules/TableGen.cmake b/llvm/cmake/modules/TableGen.cmake
index c88ee3fc196..b84fa93e90d 100644
--- a/llvm/cmake/modules/TableGen.cmake
+++ b/llvm/cmake/modules/TableGen.cmake
@@ -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
OpenPOWER on IntegriCloud