[llvm] r290358 - Pass -Wa,-mbig-obj in 64-bit mingw builds
Reid Kleckner via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 22 11:12:14 PST 2016
Author: rnk
Date: Thu Dec 22 13:12:14 2016
New Revision: 290358
URL: http://llvm.org/viewvc/llvm-project?rev=290358&view=rev
Log:
Pass -Wa,-mbig-obj in 64-bit mingw builds
COFF has a 2**16 section limit, and on Win64, every COMDAT function
creates at least 3 sections: .text, .pdata, and .xdata. For MSVC, we
enable bigobj on a file-by-file basis, but GCC appears to hit the limit
on different files.
Fixes PR25953
Modified:
llvm/trunk/cmake/modules/HandleLLVMOptions.cmake
Modified: llvm/trunk/cmake/modules/HandleLLVMOptions.cmake
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/HandleLLVMOptions.cmake?rev=290358&r1=290357&r2=290358&view=diff
==============================================================================
--- llvm/trunk/cmake/modules/HandleLLVMOptions.cmake (original)
+++ llvm/trunk/cmake/modules/HandleLLVMOptions.cmake Thu Dec 22 13:12:14 2016
@@ -232,6 +232,13 @@ if(MSVC)
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")
+
+ # Pass -mbig-obj to mingw gas on Win64. COFF has a 2**16 section limit, and
+ # on Win64, every COMDAT function creates at least 3 sections: .text, .pdata,
+ # and .xdata.
+ if (CMAKE_SIZEOF_VOID_P EQUAL 8)
+ append("-Wa,-mbig-obj" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
+ endif()
endif()
if( MSVC )
More information about the llvm-commits
mailing list