Skip to content
This repository was archived by the owner on Apr 23, 2020. It is now read-only.

Commit e1c9f50

Browse files
committed
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290358 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 1d481d5 commit e1c9f50

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

cmake/modules/HandleLLVMOptions.cmake

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,13 @@ if(MSVC)
232232
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /STACK:10000000")
233233
elseif(MINGW) # FIXME: Also cygwin?
234234
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--stack,16777216")
235+
236+
# Pass -mbig-obj to mingw gas on Win64. COFF has a 2**16 section limit, and
237+
# on Win64, every COMDAT function creates at least 3 sections: .text, .pdata,
238+
# and .xdata.
239+
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
240+
append("-Wa,-mbig-obj" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
241+
endif()
235242
endif()
236243

237244
if( MSVC )

0 commit comments

Comments
 (0)