[llvm] bf95a8c - [MinGW] Always enable -mbig-obj for LLVM build unless using Clang

Martin Storsjö via llvm-commits llvm-commits at lists.llvm.org
Fri May 14 13:48:03 PDT 2021


Author: Mateusz Mikuła
Date: 2021-05-14T23:47:50+03:00
New Revision: bf95a8cf86aea3961f9ebeacc5e8782ec8ce091d

URL: https://github.com/llvm/llvm-project/commit/bf95a8cf86aea3961f9ebeacc5e8782ec8ce091d
DIFF: https://github.com/llvm/llvm-project/commit/bf95a8cf86aea3961f9ebeacc5e8782ec8ce091d.diff

LOG: [MinGW] Always enable -mbig-obj for LLVM build unless using Clang

It's easy to hit 2**16 limit with i686 GNU toolchains these days.
Clang does it automagically, so it's not needed there, and the option
causes warnings about being unused when linking.

Differential Revision: https://reviews.llvm.org/D102419

Added: 
    

Modified: 
    llvm/cmake/modules/HandleLLVMOptions.cmake

Removed: 
    


################################################################################
diff  --git a/llvm/cmake/modules/HandleLLVMOptions.cmake b/llvm/cmake/modules/HandleLLVMOptions.cmake
index a64644a08e599..f2820f65d27b3 100644
--- a/llvm/cmake/modules/HandleLLVMOptions.cmake
+++ b/llvm/cmake/modules/HandleLLVMOptions.cmake
@@ -411,10 +411,8 @@ if(MSVC)
 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)
+  # Pass -mbig-obj to mingw gas to avoid COFF 2**16 section limit.
+  if (NOT CLANG)
     append("-Wa,-mbig-obj" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
   endif()
 endif()


        


More information about the llvm-commits mailing list