[PATCH] D83991: With MSVC, file needs to be compiled with /BIGOBJ

Adrian McCarthy via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 16 15:25:10 PDT 2020


amccarth created this revision.
amccarth added reviewers: labath, aganea.
Herald added a subscriber: mgorny.

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.  The cl.exe option /BIGOBJ raises the limit.

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


https://reviews.llvm.org/D83991

Files:
  clang/lib/ARCMigrate/CMakeLists.txt


Index: clang/lib/ARCMigrate/CMakeLists.txt
===================================================================
--- clang/lib/ARCMigrate/CMakeLists.txt
+++ clang/lib/ARCMigrate/CMakeLists.txt
@@ -2,6 +2,12 @@
   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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D83991.278616.patch
Type: text/x-patch
Size: 521 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200716/0a1b5bc7/attachment.bin>


More information about the llvm-commits mailing list