[clang] 14dde43 - With MSVC, file needs to be compiled with /BIGOBJ

Adrian McCarthy via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 17 09:43:26 PDT 2020


Author: Adrian McCarthy
Date: 2020-07-17T09:43:06-07:00
New Revision: 14dde438d69c81ab4651157a94d32e5555e804ff

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

LOG: With MSVC, file needs to be compiled with /BIGOBJ

MSVC, by default, limits the number of sections generated by a single
translation unit to 2^16.  In a debug build, each function or method
can require 4 sections, so it's not uncommon to hit it.

I saw the problem when building tests for LLDB (but, interestingly, not
for LLDB itself).

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

Added: 
    

Modified: 
    clang/lib/ARCMigrate/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/clang/lib/ARCMigrate/CMakeLists.txt b/clang/lib/ARCMigrate/CMakeLists.txt
index 6f19bea476da..1d5a185c3b6a 100644
--- a/clang/lib/ARCMigrate/CMakeLists.txt
+++ b/clang/lib/ARCMigrate/CMakeLists.txt
@@ -2,6 +2,12 @@ set(LLVM_LINK_COMPONENTS
   Support
   )
 
+# By default MSVC has a 2^16 limit on the number of sections in an object
+# file, and Transforms.cpp needs more than that.
+if (MSVC)
+  set_source_files_properties(Transforms.cpp PROPERTIES COMPILE_FLAGS /bigobj)
+endif()
+
 add_clang_library(clangARCMigrate
   ARCMT.cpp
   ARCMTActions.cpp


        


More information about the cfe-commits mailing list