title: GCC equivalent of MS's /bigobj
body: <p>We are making heavy use of <code>boost::serialization</code> and templates in general. All seems to be going well.</p>
  <p>Except, we've hit a snag on our Windows builds. It seems to cause issues in the object files being too large. We're using MinGW/Msys with g++ 4.7.0.</p>
  <pre><code>c:/mingw/bin/../lib/gcc/mingw32/4.7.0/../../../../mingw32/bin/as.exe: CMakeFiles/source.dir/sourcecode.cpp.obj: too many sections (33396)
  C:\Users\username\AppData\Local\Temp\ccnAocvD.s: Assembler messages:
  C:\Users\username\AppData\Local\Temp\ccnAocvD.s: Fatal error: can't write CMakeFiles/source.dir/sourcecode.cpp.obj: File too big
  </code></pre>
  <p>Master google revealed this archived message, <a href="http://sourceforge.net/mailarchive/forum.php?thread_name=CA%2Bsc5mkLvj%3DW9w2%3DsY%3Dc_N%3DEwnsQuPDEX%3DiBcbsbxS3CuE_5Bg%40mail.gmail.com&amp;forum_name=mingw-users" rel="noreferrer">http://sourceforge.net/mailarchive/forum.php?thread_name=CA%2Bsc5mkLvj%3DW9w2%3DsY%3Dc_N%3DEwnsQuPDEX%3DiBcbsbxS3CuE_5Bg%40mail.gmail.com&amp;forum_name=mingw-users</a></p>
  <p>In it, it indicates that another person hit pretty much the same snag. It did point to an option for Visual Studio's <code>/bigobj</code> option which appears to do what we would need. However, we're unable to move to Visual Studio.</p>
  <p>One suggestion was to add --hash-size to the assembler options. This did not help.</p>
  <p>If I'm not mistaken, the issue lies in the fact that the object files have a limit of 2^16 entries in them. Actually, according to the error message, I would venture that it's a signed 2^16 entries, but that's peanuts. The <code>/bigobj</code> option for Visual Studio would change that to 2^32. The mailing list result did not know of an equivalent option for GCC. Further google results don't appear to be relevant to this.</p>
  <p>At this point we'll have to refactor our code (ugh) to get around this limitation. But I am still concerned that, with heavy templating, we could run into the issue again and again (we've already run into it with three source files).</p>
  <p>So my question is thus; is there a GCC equivalent to Microsoft's <code>/bigobj</code> option? Is there a third option that I'm not yet found?</p>