Liviu Gheorghisan
2014-May-02 20:11 UTC
[LLVMdev] clang build (Debug+Asserts) fails with Cygwin and Mingw (ASTContext.o: File too big)
Hello, After switching from a Linux development host to Windows7 with Cygwin, I notice the following problem when building clang (trunk, HEAD): (also happens with Mingw) ... llvm[4]: Compiling ParseInit.cpp for Debug+Asserts build as: /cygdrive/d/Projects/Cpp/llvm/cfgCygwin/tools/clang/lib/AST/Debug+Asserts/ASTContext.o: too many sections (33066) /tmp/ccmtDH7w.s: Assembler messages: /tmp/ccmtDH7w.s: Fatal error: can't write /cygdrive/d/Projects/Cpp/llvm/cfgCygwin/tools/clang/lib/AST/Debug+Asserts/ASTContext.o: File too big as: /cygdrive/d/Projects/Cpp/llvm/cfgCygwin/tools/clang/lib/AST/Debug+Asserts/ASTContext.o: too many sections (33066) /tmp/ccmtDH7w.s: Fatal error: can't close /cygdrive/d/Projects/Cpp/llvm/cfgCygwin/tools/clang/lib/AST/Debug+Asserts/ASTContext.o: File too big /cygdrive/d/Projects/Cpp/llvm/Makefile.rules:1509: recipe for target '/cygdrive/d/Projects/Cpp/llvm/cfgCygwin/tools/clang/lib/AST/Debug+Asserts/ASTContext.o' failed make[4]: *** [/cygdrive/d/Projects/Cpp/llvm/cfgCygwin/tools/clang/lib/AST/Debug+Asserts/ASTContext.o] Error 1 make[4]: Leaving directory '/cygdrive/d/Projects/Cpp/llvm/cfgCygwin/tools/clang/lib/AST' /cygdrive/d/Projects/Cpp/llvm/Makefile.rules:936: recipe for target 'AST/.makeall' failed make[3]: *** [AST/.makeall] Error 2 ... The reason for this seems to be that the COFF object format in Windows only supports a maximum of 2^15 sections (32768) for obj files. To work around this issue, Microsoft's compiler cl has a flag called /bigobj that allocates 32 bits in order to store the number of sections (instead of 16 bits, as this standard specifies: http://msdn.microsoft.com/en-us/library/gg463119.aspx ) Also check this for /bigobj: http://msdn.microsoft.com/en-us/library/ms173499.aspx Anybody else having this problem with Mingw/Cygwin? If yes, how did you overcome it? My Cygwin version is this: $ uname -a CYGWIN_NT-6.1 livghe-i5 1.7.29(0.272/5/3) 2014-04-07 13:46 x86_64 Cygwin The only option I currently see is to split the mammoth cpp file (ASTContext.cpp) in 2 parts, or to get rid of the debug info (not desired). -- Best Regards, -Liviu
David Blaikie
2014-May-02 20:41 UTC
[LLVMdev] clang build (Debug+Asserts) fails with Cygwin and Mingw (ASTContext.o: File too big)
Any idea what all those sections are - comdat inline functions? Does the debug info in COFF do something weird and emit a section per type or function? On Fri, May 2, 2014 at 1:11 PM, Liviu Gheorghisan <livghe at gmx.com> wrote:> Hello, > > After switching from a Linux development host to Windows7 with Cygwin, I > notice the following problem when building clang (trunk, HEAD): > (also happens with Mingw) > > ... > > llvm[4]: Compiling ParseInit.cpp for Debug+Asserts build > as: > /cygdrive/d/Projects/Cpp/llvm/cfgCygwin/tools/clang/lib/AST/Debug+Asserts/ASTContext.o: > too many sections (33066) > /tmp/ccmtDH7w.s: Assembler messages: > /tmp/ccmtDH7w.s: Fatal error: can't write > /cygdrive/d/Projects/Cpp/llvm/cfgCygwin/tools/clang/lib/AST/Debug+Asserts/ASTContext.o: > File too big > as: > /cygdrive/d/Projects/Cpp/llvm/cfgCygwin/tools/clang/lib/AST/Debug+Asserts/ASTContext.o: > too many sections (33066) > /tmp/ccmtDH7w.s: Fatal error: can't close > /cygdrive/d/Projects/Cpp/llvm/cfgCygwin/tools/clang/lib/AST/Debug+Asserts/ASTContext.o: > File too big > /cygdrive/d/Projects/Cpp/llvm/Makefile.rules:1509: recipe for target > '/cygdrive/d/Projects/Cpp/llvm/cfgCygwin/tools/clang/lib/AST/Debug+Asserts/ASTContext.o' > failed > make[4]: *** > [/cygdrive/d/Projects/Cpp/llvm/cfgCygwin/tools/clang/lib/AST/Debug+Asserts/ASTContext.o] > Error 1 > make[4]: Leaving directory > '/cygdrive/d/Projects/Cpp/llvm/cfgCygwin/tools/clang/lib/AST' > /cygdrive/d/Projects/Cpp/llvm/Makefile.rules:936: recipe for target > 'AST/.makeall' failed > make[3]: *** [AST/.makeall] Error 2 > > ... > > > The reason for this seems to be that the COFF object format in Windows only > supports a maximum of 2^15 sections (32768) for obj files. > > To work around this issue, Microsoft's compiler cl has a flag called /bigobj > that allocates 32 bits in order to store the number of sections (instead of > 16 bits, as this standard specifies: > http://msdn.microsoft.com/en-us/library/gg463119.aspx ) > > Also check this for /bigobj: > http://msdn.microsoft.com/en-us/library/ms173499.aspx > > Anybody else having this problem with Mingw/Cygwin? If yes, how did you > overcome it? > > My Cygwin version is this: > $ uname -a > CYGWIN_NT-6.1 livghe-i5 1.7.29(0.272/5/3) 2014-04-07 13:46 x86_64 Cygwin > > The only option I currently see is to split the mammoth cpp file > (ASTContext.cpp) in 2 parts, or to get rid of the debug info (not desired). > > > -- > Best Regards, > -Liviu > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Liviu Gheorghisan
2014-May-02 21:42 UTC
[LLVMdev] clang build (Debug+Asserts) fails with Cygwin and Mingw (ASTContext.o: File too big)
On 5/2/2014 11:41 PM, David Blaikie wrote:> Any idea what all those sections are - comdat inline functions? >No idea, as I cannot run objdump -h on a object file that I couldn't build :) Anyhow, I have an old, successful Debug+Asserts build of clang, made with Mingw also, for clang revision 206070. Apparently, the ASTContext.o file there contained 16453 sections, not 33066, as there are today.> Does the debug info in COFF do something weird and emit a section per > type or function? >I will do a release build tomorrow and check the sections. (in my timezone it's night) - I will let you know!> On Fri, May 2, 2014 at 1:11 PM, Liviu Gheorghisan <livghe at gmx.com> wrote: >> Hello, >> >> After switching from a Linux development host to Windows7 with Cygwin, I >> notice the following problem when building clang (trunk, HEAD): >> (also happens with Mingw) >> >> ... >> >> llvm[4]: Compiling ParseInit.cpp for Debug+Asserts build >> as: >> /cygdrive/d/Projects/Cpp/llvm/cfgCygwin/tools/clang/lib/AST/Debug+Asserts/ASTContext.o: >> too many sections (33066) >> /tmp/ccmtDH7w.s: Assembler messages: >> /tmp/ccmtDH7w.s: Fatal error: can't write >> /cygdrive/d/Projects/Cpp/llvm/cfgCygwin/tools/clang/lib/AST/Debug+Asserts/ASTContext.o: >> File too big >> as: >> /cygdrive/d/Projects/Cpp/llvm/cfgCygwin/tools/clang/lib/AST/Debug+Asserts/ASTContext.o: >> too many sections (33066) >> /tmp/ccmtDH7w.s: Fatal error: can't close >> /cygdrive/d/Projects/Cpp/llvm/cfgCygwin/tools/clang/lib/AST/Debug+Asserts/ASTContext.o: >> File too big >> /cygdrive/d/Projects/Cpp/llvm/Makefile.rules:1509: recipe for target >> '/cygdrive/d/Projects/Cpp/llvm/cfgCygwin/tools/clang/lib/AST/Debug+Asserts/ASTContext.o' >> failed >> make[4]: *** >> [/cygdrive/d/Projects/Cpp/llvm/cfgCygwin/tools/clang/lib/AST/Debug+Asserts/ASTContext.o] >> Error 1 >> make[4]: Leaving directory >> '/cygdrive/d/Projects/Cpp/llvm/cfgCygwin/tools/clang/lib/AST' >> /cygdrive/d/Projects/Cpp/llvm/Makefile.rules:936: recipe for target >> 'AST/.makeall' failed >> make[3]: *** [AST/.makeall] Error 2 >> >> ... >> >> >> The reason for this seems to be that the COFF object format in Windows only >> supports a maximum of 2^15 sections (32768) for obj files. >> >> To work around this issue, Microsoft's compiler cl has a flag called /bigobj >> that allocates 32 bits in order to store the number of sections (instead of >> 16 bits, as this standard specifies: >> http://msdn.microsoft.com/en-us/library/gg463119.aspx ) >> >> Also check this for /bigobj: >> http://msdn.microsoft.com/en-us/library/ms173499.aspx >> >> Anybody else having this problem with Mingw/Cygwin? If yes, how did you >> overcome it? >> >> My Cygwin version is this: >> $ uname -a >> CYGWIN_NT-6.1 livghe-i5 1.7.29(0.272/5/3) 2014-04-07 13:46 x86_64 Cygwin >> >> The only option I currently see is to split the mammoth cpp file >> (ASTContext.cpp) in 2 parts, or to get rid of the debug info (not desired). >> >> >> -- >> Best Regards, >> -Liviu >> _______________________________________________ >> LLVM Developers mailing list >> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev-- Best Regards, -Liviu
Seemingly Similar Threads
- [LLVMdev] clang build (Debug+Asserts) fails with Cygwin and Mingw (ASTContext.o: File too big)
- [LLVMdev] fix a "does not name a type" bug in VASTContext.h
- Communication between Clang Sema and the Clang Codegen...
- [LLVMdev] How to use WhileStmt to implement while loop in LLVM
- [LLVMdev] Switching to the new MingW ABI